|
8 | 8 | </ResourceDictionary.MergedDictionaries>
|
9 | 9 |
|
10 | 10 | <converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />
|
11 |
| - |
12 |
| - <Style x:Key="MaterialDesignTimePicker" TargetType="{x:Type wpf:TimePicker}"> |
13 |
| - <Setter Property="VerticalAlignment" Value="Top"/> |
14 |
| - <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/> |
15 |
| - <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" /> |
16 |
| - <Setter Property="Background" Value="Transparent"/> |
17 |
| - <Setter Property="BorderThickness" Value="0 0 0 1"/> |
18 |
| - <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
| 11 | + |
| 12 | + <Style x:Key="MaterialDesignTimePicker" TargetType="{x:Type wpf:TimePicker}"> |
| 13 | + <Setter Property="VerticalAlignment" Value="Top"/> |
| 14 | + <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/> |
| 15 | + <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" /> |
| 16 | + <Setter Property="Background" Value="Transparent"/> |
| 17 | + <Setter Property="BorderThickness" Value="0 0 0 1"/> |
| 18 | + <Setter Property="HorizontalContentAlignment" Value="Stretch"/> |
19 | 19 | <Setter Property="IsTabStop" Value="False"/>
|
20 | 20 | <Setter Property="Margin" Value="0 12 0 0" />
|
21 | 21 | <Setter Property="wpf:HintAssist.Hint" Value="Select time" />
|
22 |
| - <Setter Property="ClockStyle" Value="{DynamicResource MaterialDesignClock}" /> |
| 22 | + <Setter Property="ClockStyle" Value="{DynamicResource MaterialDesignClock}" /> |
23 | 23 | <Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
|
24 |
| - <Setter Property="ClockHostContentControlStyle"> |
25 |
| - <Setter.Value> |
26 |
| - <Style TargetType="{x:Type ContentControl}"> |
27 |
| - <Style.Setters> |
28 |
| - <Setter Property="Template"> |
29 |
| - <Setter.Value> |
| 24 | + <Setter Property="ClockHostContentControlStyle"> |
| 25 | + <Setter.Value> |
| 26 | + <Style TargetType="{x:Type ContentControl}"> |
| 27 | + <Style.Setters> |
| 28 | + <Setter Property="Template"> |
| 29 | + <Setter.Value> |
30 | 30 | <ControlTemplate TargetType="{x:Type ContentControl}">
|
31 | 31 | <AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
|
32 | 32 | <Border Effect="{DynamicResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
|
|
35 | 35 | </AdornerDecorator>
|
36 | 36 | </ControlTemplate>
|
37 | 37 | </Setter.Value>
|
38 |
| - </Setter> |
39 |
| - </Style.Setters> |
40 |
| - </Style> |
41 |
| - </Setter.Value> |
42 |
| - </Setter> |
43 |
| - <Setter Property="Template"> |
44 |
| - <Setter.Value> |
45 |
| - <ControlTemplate TargetType="{x:Type wpf:TimePicker}"> |
46 |
| - <ControlTemplate.Resources> |
47 |
| - <ControlTemplate x:Key="TextBoxTemplate" TargetType="{x:Type TextBox}"> |
48 |
| - <Grid> |
49 |
| - <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" |
50 |
| - /> |
| 38 | + </Setter> |
| 39 | + </Style.Setters> |
| 40 | + </Style> |
| 41 | + </Setter.Value> |
| 42 | + </Setter> |
| 43 | + <Setter Property="Template"> |
| 44 | + <Setter.Value> |
| 45 | + <ControlTemplate TargetType="{x:Type wpf:TimePicker}"> |
| 46 | + <ControlTemplate.Resources> |
| 47 | + <ControlTemplate x:Key="TextBoxTemplate" TargetType="{x:Type TextBox}"> |
| 48 | + <Grid> |
| 49 | + <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" /> |
51 | 50 | <wpf:SmartHint x:Name="Hint"
|
52 | 51 | FontSize="{TemplateBinding FontSize}"
|
53 | 52 | UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}"
|
| 53 | + FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}" |
| 54 | + FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}" |
54 | 55 | Hint="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}"
|
55 | 56 | HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}"
|
56 | 57 | HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"/>
|
57 |
| - </Grid> |
| 58 | + </Grid> |
58 | 59 | <ControlTemplate.Triggers>
|
59 | 60 | <MultiTrigger>
|
60 | 61 | <MultiTrigger.Conditions>
|
|
66 | 67 | </MultiTrigger>
|
67 | 68 | </ControlTemplate.Triggers>
|
68 | 69 | </ControlTemplate>
|
69 |
| - <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="{x:Type Button}"> |
70 |
| - <Grid Background="Transparent"> |
71 |
| - <VisualStateManager.VisualStateGroups> |
72 |
| - <VisualStateGroup x:Name="CommonStates"> |
73 |
| - <VisualStateGroup.Transitions> |
74 |
| - <VisualTransition GeneratedDuration="0"/> |
75 |
| - <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/> |
76 |
| - <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed"/> |
77 |
| - </VisualStateGroup.Transitions> |
78 |
| - <VisualState x:Name="Normal"/> |
79 |
| - <VisualState x:Name="MouseOver"/> |
80 |
| - <VisualState x:Name="Pressed"/> |
81 |
| - <VisualState x:Name="Disabled"/> |
82 |
| - </VisualStateGroup> |
83 |
| - </VisualStateManager.VisualStateGroups> |
84 |
| - <Viewbox> |
85 |
| - <Canvas Width="24" Height="24"> |
86 |
| - <Path Data="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z" Fill="{TemplateBinding Foreground}" /> |
87 |
| - </Canvas> |
88 |
| - </Viewbox> |
89 |
| - </Grid> |
90 |
| - </ControlTemplate> |
91 |
| - </ControlTemplate.Resources> |
| 70 | + <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="{x:Type Button}"> |
| 71 | + <Grid Background="Transparent"> |
| 72 | + <VisualStateManager.VisualStateGroups> |
| 73 | + <VisualStateGroup x:Name="CommonStates"> |
| 74 | + <VisualStateGroup.Transitions> |
| 75 | + <VisualTransition GeneratedDuration="0"/> |
| 76 | + <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/> |
| 77 | + <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed"/> |
| 78 | + </VisualStateGroup.Transitions> |
| 79 | + <VisualState x:Name="Normal"/> |
| 80 | + <VisualState x:Name="MouseOver"/> |
| 81 | + <VisualState x:Name="Pressed"/> |
| 82 | + <VisualState x:Name="Disabled"/> |
| 83 | + </VisualStateGroup> |
| 84 | + </VisualStateManager.VisualStateGroups> |
| 85 | + <Viewbox> |
| 86 | + <Canvas Width="24" Height="24"> |
| 87 | + <Path Data="M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z" Fill="{TemplateBinding Foreground}" /> |
| 88 | + </Canvas> |
| 89 | + </Viewbox> |
| 90 | + </Grid> |
| 91 | + </ControlTemplate> |
| 92 | + </ControlTemplate.Resources> |
92 | 93 | <Grid x:Name="TemplateRoot">
|
93 |
| - <Border BorderBrush="{TemplateBinding BorderBrush}" |
| 94 | + <Border BorderBrush="{TemplateBinding BorderBrush}" |
94 | 95 | BorderThickness="{TemplateBinding BorderThickness}"
|
95 | 96 | Background="{TemplateBinding Background}"
|
96 | 97 | x:Name="border"
|
97 | 98 | Padding="0 4 0 4"
|
98 | 99 | SnapsToDevicePixels="True">
|
99 |
| - <Grid> |
100 |
| - <Grid.ColumnDefinitions> |
101 |
| - <ColumnDefinition Width="*" /> |
102 |
| - <ColumnDefinition Width="Auto" /> |
103 |
| - </Grid.ColumnDefinitions> |
104 |
| - <TextBox BorderThickness="0" x:Name="PART_TextBox" |
105 |
| - wpf:TextFieldAssist.TextBoxViewMargin=".5 0 0 0" |
106 |
| - Margin="0" |
107 |
| - Template="{StaticResource TextBoxTemplate}" |
108 |
| - /> |
109 |
| - <Button Grid.Column="1" Foreground="{TemplateBinding BorderBrush}" Focusable="False" HorizontalAlignment="Right" Margin="4 0 0 -3" Grid.Row="0" Padding="0" |
110 |
| - x:Name="PART_Button" |
111 |
| - Height="17" |
112 |
| - Template="{StaticResource DropDownButtonTemplate}" /> |
113 |
| - <Popup x:Name="PART_Popup" AllowsTransparency="True" |
| 100 | + <Grid> |
| 101 | + <Grid.ColumnDefinitions> |
| 102 | + <ColumnDefinition Width="*" /> |
| 103 | + <ColumnDefinition Width="Auto" /> |
| 104 | + </Grid.ColumnDefinitions> |
| 105 | + <TextBox BorderThickness="0" x:Name="PART_TextBox" |
| 106 | + wpf:TextFieldAssist.TextBoxViewMargin=".5 0 0 0" |
| 107 | + Margin="0" |
| 108 | + Template="{StaticResource TextBoxTemplate}" |
| 109 | + /> |
| 110 | + <Button Grid.Column="1" Foreground="{TemplateBinding BorderBrush}" Focusable="False" HorizontalAlignment="Right" Margin="4 0 0 -3" Grid.Row="0" Padding="0" |
| 111 | + x:Name="PART_Button" |
| 112 | + Height="17" |
| 113 | + Template="{StaticResource DropDownButtonTemplate}" /> |
| 114 | + <Popup x:Name="PART_Popup" AllowsTransparency="True" |
114 | 115 | Placement="Custom"
|
115 | 116 | CustomPopupPlacementCallback="{x:Static wpf:CustomPopupPlacementCallbackHelper.LargePopupCallback}"
|
116 | 117 | PlacementTarget="{Binding ElementName=PART_TextBox}" StaysOpen="False"
|
117 |
| - PopupAnimation="Fade"/> |
118 |
| - </Grid> |
| 118 | + PopupAnimation="Fade"/> |
| 119 | + </Grid> |
119 | 120 | </Border>
|
120 | 121 | <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/>
|
121 | 122 | </Grid>
|
|
124 | 125 | <Setter Property="Opacity" TargetName="TemplateRoot" Value="0.56"/>
|
125 | 126 | </Trigger>
|
126 | 127 | <Trigger Property="IsMouseOver" Value="true">
|
127 |
| - <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> |
128 |
| - </Trigger> |
129 |
| - <Trigger Property="IsKeyboardFocusWithin" Value="true"> |
| 128 | + <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> |
| 129 | + </Trigger> |
| 130 | + <Trigger Property="IsKeyboardFocusWithin" Value="true"> |
130 | 131 | <Setter Property="IsActive" TargetName="Underline" Value="True"/>
|
131 |
| - <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> |
132 |
| - </Trigger> |
| 132 | + <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> |
| 133 | + </Trigger> |
133 | 134 | <Trigger Property="Validation.HasError" Value="true">
|
134 | 135 | <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
|
135 | 136 | <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
|
136 |
| - </Trigger> |
137 |
| - </ControlTemplate.Triggers> |
138 |
| - </ControlTemplate> |
139 |
| - </Setter.Value> |
140 |
| - </Setter> |
141 |
| - </Style> |
| 137 | + </Trigger> |
| 138 | + </ControlTemplate.Triggers> |
| 139 | + </ControlTemplate> |
| 140 | + </Setter.Value> |
| 141 | + </Setter> |
| 142 | + </Style> |
142 | 143 |
|
143 | 144 |
|
144 | 145 | <Style x:Key="MaterialDesignFloatingHintTimePicker" TargetType="{x:Type wpf:TimePicker}" BasedOn="{StaticResource MaterialDesignTimePicker}">
|
|
0 commit comments