|
5 | 5 | <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" />
|
6 | 6 | </ResourceDictionary.MergedDictionaries>
|
7 | 7 |
|
8 |
| - <Style x:Key="StandardTextBox" TargetType="TextBox"> |
| 8 | + <Style x:Key="StandardTextBox" TargetType="{x:Type TextBox}"> |
9 | 9 | <Setter Property="Background" Value="{StaticResource TextBoxBackground}" />
|
10 | 10 | <Setter Property="CaretBrush" Value="{StaticResource Foreground}" />
|
11 | 11 | <Setter Property="Foreground" Value="{StaticResource Foreground}" />
|
| 12 | + <Setter Property="Padding" Value="1" /> |
| 13 | + <Setter Property="SnapsToDevicePixels" Value="True" /> |
| 14 | + <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorTemplate}" /> |
12 | 15 | <Setter Property="Template">
|
13 | 16 | <Setter.Value>
|
14 | 17 | <ControlTemplate TargetType="{x:Type TextBox}">
|
15 |
| - <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
16 |
| - <ScrollViewer x:Name="PART_ContentHost" Margin="1" /> |
| 18 | + <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
| 19 | + <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" /> |
17 | 20 | </Grid>
|
18 | 21 | <ControlTemplate.Triggers>
|
19 | 22 | <Trigger Property="IsMouseOver" Value="true">
|
|
28 | 31 | </Setter>
|
29 | 32 | </Style>
|
30 | 33 |
|
31 |
| - <Style x:Key="SearchTextBox" TargetType="TextBox"> |
32 |
| - <Setter Property="Background" Value="{StaticResource TextBoxBackground}" /> |
33 |
| - <Setter Property="CaretBrush" Value="{StaticResource Foreground}" /> |
34 |
| - <Setter Property="Foreground" Value="{StaticResource Foreground}" /> |
| 34 | + <Style x:Key="SearchTextBox" |
| 35 | + TargetType="{x:Type TextBox}" |
| 36 | + BasedOn="{StaticResource StandardTextBox}"> |
35 | 37 | <Setter Property="Template">
|
36 | 38 | <Setter.Value>
|
37 | 39 | <ControlTemplate TargetType="{x:Type TextBox}">
|
38 |
| - <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> |
| 40 | + <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
39 | 41 | <TextBlock Name="search"
|
40 | 42 | Margin="5 0 0 0"
|
41 | 43 | VerticalAlignment="Center"
|
42 | 44 | Foreground="{StaticResource SearchTextForeground}"
|
43 | 45 | Text="Search ..."
|
44 | 46 | Visibility="Hidden" />
|
45 |
| - <ScrollViewer x:Name="PART_ContentHost" Margin="1" /> |
| 47 | + <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}" /> |
46 | 48 | </Grid>
|
47 | 49 | <ControlTemplate.Triggers>
|
48 | 50 | <Trigger Property="TextBox.Text" Value="">
|
|
0 commit comments