-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml
47 lines (42 loc) · 2.61 KB
/
App.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<Application x:Class="FIRST.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:aero ="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
StartupUri="MainWindow.xaml">
<Application.Resources>
<!-- Text box with preview text -->
<ControlTemplate x:Key="WatermarkedTextBox" TargetType="{x:Type TextBox}">
<aero:ListBoxChrome Name="Bd"
Background="{TemplateBinding Panel.Background}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
BorderThickness="{TemplateBinding Border.BorderThickness}"
RenderMouseOver="{TemplateBinding UIElement.IsMouseOver}"
RenderFocused="{TemplateBinding UIElement.IsKeyboardFocusWithin}">
<Grid>
<ScrollViewer x:Name="PART_ContentHost" Foreground="{DynamicResource OutsideFontColor}"
MinHeight="{TemplateBinding MinHeight}" Height="{TemplateBinding Height}" FontSize="{TemplateBinding FontSize}" />
<TextBlock x:Name="TextPrompt" Text="{TemplateBinding Tag}" Foreground="Gray"
HorizontalAlignment="Center" Opacity=".65"
Focusable="False" Visibility="Collapsed"/>
</Grid>
</aero:ListBoxChrome>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsFocused" Value="False"></Condition>
<Condition Property="Text" Value=""></Condition>
</MultiTrigger.Conditions>
<MultiTrigger.Setters>
<Setter Property="Visibility" TargetName="TextPrompt" Value="Visible"></Setter>
</MultiTrigger.Setters>
</MultiTrigger>
<Trigger Property="UIElement.IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Panel.Background"
Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
<Setter Property="TextElement.Foreground"
Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Application.Resources>
</Application>