|
1 | 1 | <ResourceDictionary |
2 | 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | | - xmlns:local="clr-namespace:Community.VisualStudio.Toolkit;assembly=Community.VisualStudio.Toolkit" |
5 | | - xmlns:shell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0" |
6 | | - xmlns:platform="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.15.0" |
| 4 | + xmlns:local="clr-namespace:Community.VisualStudio.Toolkit" |
7 | 5 | xmlns:system="clr-namespace:System;assembly=mscorlib" |
8 | 6 | > |
9 | 7 |
|
10 | 8 | <!-- This is the same padding used by WatermarkedTextBox. --> |
11 | 9 | <Thickness x:Key="{x:Static local:ToolkitResourceKeys.InputPaddingKey}">6,8,6,8</Thickness> |
12 | | - |
| 10 | + |
13 | 11 | <!-- This is the same height used in the IVsThreadedWaitDialog. --> |
14 | 12 | <system:Double x:Key="{x:Static local:ToolkitResourceKeys.ThickProgressBarHeight}">16</system:Double> |
15 | 13 |
|
16 | | - <Style TargetType="TextBox" BasedOn="{StaticResource {x:Static shell:VsResourceKeys.TextBoxStyleKey}}"> |
| 14 | + <Style x:Key="{x:Static local:ToolkitResourceKeys.TextBoxStyleKey}" TargetType="TextBox" BasedOn="{StaticResource {x:Static local:InternalResourceKeys.VsResourceKeys_TextBoxStyleKey}}"> |
17 | 15 | <Setter Property="Padding" Value="{StaticResource {x:Static local:ToolkitResourceKeys.InputPaddingKey}}" /> |
18 | 16 | </Style> |
19 | 17 |
|
20 | | - <Style TargetType="ComboBox" BasedOn="{StaticResource {x:Static shell:VsResourceKeys.ComboBoxStyleKey}}"> |
| 18 | + <Style x:Key="{x:Static local:ToolkitResourceKeys.ComboBoxStyleKey}" TargetType="ComboBox" BasedOn="{StaticResource {x:Static local:InternalResourceKeys.VsResourceKeys_ComboBoxStyleKey}}"> |
21 | 19 | <Setter Property="Padding" Value="{StaticResource {x:Static local:ToolkitResourceKeys.InputPaddingKey}}" /> |
22 | 20 | </Style> |
23 | 21 |
|
24 | | - <Style TargetType="PasswordBox"> |
25 | | - <Setter Property="Padding" Value="{StaticResource {x:Static local:ToolkitResourceKeys.InputPaddingKey}}" /> |
26 | | - <Setter Property="Background" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBackgroundBrushKey}}" /> |
27 | | - <Setter Property="Foreground" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxTextBrushKey}}" /> |
28 | | - <Setter Property="BorderBrush" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBorderBrushKey}}" /> |
| 22 | + <ControlTemplate x:Key="{x:Static local:ToolkitResourceKeys.PasswordBoxControlTemplateKey}" TargetType="{x:Type PasswordBox}"> |
| 23 | + <!-- |
| 24 | + The default template for a PasswordBox defines a trigger for IsMouseOver that changes the |
| 25 | + border brush. To get our style triggers to apply, we need to override the template. |
| 26 | + --> |
| 27 | + <Border |
| 28 | + x:Name="border" |
| 29 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 30 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 31 | + Background="{TemplateBinding Background}" |
| 32 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 33 | + > |
29 | 34 |
|
30 | | - <Setter Property="Template"> |
31 | | - <Setter.Value> |
32 | | - <!-- |
33 | | - The default template defines a trigger for IsMouseOver that changes the border |
34 | | - brush. To get our style triggers to apply, we need to override the template. |
35 | | - --> |
36 | | - <ControlTemplate TargetType="{x:Type PasswordBox}"> |
37 | | - <Border |
38 | | - x:Name="border" |
39 | | - BorderBrush="{TemplateBinding BorderBrush}" |
40 | | - BorderThickness="{TemplateBinding BorderThickness}" |
41 | | - Background="{TemplateBinding Background}" |
42 | | - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
43 | | - > |
| 35 | + <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> |
| 36 | + </Border> |
| 37 | + </ControlTemplate> |
44 | 38 |
|
45 | | - <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> |
46 | | - </Border> |
47 | | - </ControlTemplate> |
48 | | - </Setter.Value> |
49 | | - </Setter> |
| 39 | + <Style x:Key="{x:Static local:ToolkitResourceKeys.PasswordBoxStyleKey}" TargetType="PasswordBox"> |
| 40 | + <Setter Property="Padding" Value="{StaticResource {x:Static local:ToolkitResourceKeys.InputPaddingKey}}" /> |
| 41 | + <Setter Property="Background" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBackgroundBrushKey}}" /> |
| 42 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxTextBrushKey}}" /> |
| 43 | + <Setter Property="BorderBrush" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBorderBrushKey}}" /> |
50 | 44 |
|
| 45 | + <Setter Property="Template" Value="{StaticResource {x:Static local:ToolkitResourceKeys.PasswordBoxControlTemplateKey}}"/> |
| 46 | + |
51 | 47 | <Style.Triggers> |
52 | 48 | <Trigger Property="IsMouseOver" Value="True"> |
53 | | - <Setter Property="Background" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBackgroundBrushKey}}" /> |
54 | | - <Setter Property="Foreground" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxTextBrushKey}}" /> |
55 | | - <Setter Property="BorderBrush" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBorderBrushKey}}" /> |
| 49 | + <Setter Property="Background" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBackgroundBrushKey}}" /> |
| 50 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxTextBrushKey}}" /> |
| 51 | + <Setter Property="BorderBrush" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBorderBrushKey}}" /> |
56 | 52 | </Trigger> |
57 | 53 |
|
58 | 54 | <Trigger Property="IsFocused" Value="True"> |
59 | | - <Setter Property="Background" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBackgroundFocusedBrushKey}}" /> |
60 | | - <Setter Property="Foreground" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxTextFocusedBrushKey}}" /> |
61 | | - <Setter Property="BorderBrush" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBorderFocusedBrushKey}}" /> |
| 55 | + <Setter Property="Background" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBackgroundFocusedBrushKey}}" /> |
| 56 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxTextFocusedBrushKey}}" /> |
| 57 | + <Setter Property="BorderBrush" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBorderFocusedBrushKey}}" /> |
62 | 58 | </Trigger> |
63 | 59 |
|
64 | 60 | <Trigger Property="IsEnabled" Value="False"> |
65 | | - <Setter Property="Background" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBackgroundDisabledBrushKey}}" /> |
66 | | - <Setter Property="Foreground" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxTextDisabledBrushKey}}" /> |
67 | | - <Setter Property="BorderBrush" Value="{DynamicResource {x:Static platform:CommonControlsColors.TextBoxBorderDisabledBrushKey}}" /> |
| 61 | + <Setter Property="Background" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBackgroundDisabledBrushKey}}" /> |
| 62 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxTextDisabledBrushKey}}" /> |
| 63 | + <Setter Property="BorderBrush" Value="{DynamicResource {x:Static local:InternalResourceKeys.CommonControlsColors_TextBoxBorderDisabledBrushKey}}" /> |
68 | 64 | </Trigger> |
69 | 65 | </Style.Triggers> |
70 | 66 | </Style> |
| 67 | + |
| 68 | + <!-- Default styles. --> |
| 69 | + <Style TargetType="TextBox" BasedOn="{StaticResource {x:Static local:ToolkitResourceKeys.TextBoxStyleKey}}" /> |
| 70 | + <Style TargetType="ComboBox" BasedOn="{StaticResource {x:Static local:ToolkitResourceKeys.ComboBoxStyleKey}}" /> |
| 71 | + <Style TargetType="PasswordBox" BasedOn="{StaticResource {x:Static local:ToolkitResourceKeys.PasswordBoxStyleKey}}" /> |
71 | 72 | </ResourceDictionary> |
0 commit comments