|
10 | 10 | <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
11 | 11 | <Converters:ThicknessToDoubleConverter x:Key="ThicknessToDoubleConverter" />
|
12 | 12 |
|
| 13 | + <Grid x:Key="DefaultCapsLockIcon" |
| 14 | + x:Shared="False" |
| 15 | + Background="{DynamicResource BlackBrush}" |
| 16 | + Opacity="0.8" |
| 17 | + Width="16" |
| 18 | + Height="16"> |
| 19 | + <Grid.OpacityMask> |
| 20 | + <VisualBrush> |
| 21 | + <VisualBrush.Visual> |
| 22 | + <Canvas Width="24" |
| 23 | + Height="24"> |
| 24 | + <Path Data="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" |
| 25 | + Fill="Black" /> |
| 26 | + </Canvas> |
| 27 | + </VisualBrush.Visual> |
| 28 | + </VisualBrush> |
| 29 | + </Grid.OpacityMask> |
| 30 | + </Grid> |
| 31 | + |
13 | 32 | <!--PasswordBox Style-->
|
14 | 33 | <Style TargetType="{x:Type PasswordBox}"
|
15 | 34 | x:Key="MetroPasswordBox">
|
| 35 | + <Setter Property="Controls:PasswordBoxHelper.CapsLockIcon" |
| 36 | + Value="{StaticResource DefaultCapsLockIcon}" /> |
16 | 37 | <Setter Property="ContextMenu"
|
17 | 38 | Value="{DynamicResource TextBoxMetroContextMenu}" />
|
18 | 39 | <Setter Property="Controls:TextBoxHelper.IsMonitoring"
|
|
87 | 108 | <Grid Margin="2">
|
88 | 109 | <Grid.ColumnDefinitions>
|
89 | 110 | <ColumnDefinition Width="*" />
|
90 |
| - <ColumnDefinition Width="{Binding ElementName=ButtonRow, Path=ActualHeight, Mode=OneWay}" /> |
91 | 111 | <ColumnDefinition Width="Auto" />
|
92 | 112 | <ColumnDefinition x:Name="ButtonColumn"
|
93 | 113 | Width="Auto" />
|
|
151 | 171 | FontFamily="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonFontFamily), Mode=OneWay}"
|
152 | 172 | Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ButtonContent), Mode=OneWay}"
|
153 | 173 | Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
|
| 174 | + Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ButtonWidth), Mode=OneWay}" |
154 | 175 | IsTabStop="False" />
|
155 | 176 | <ContentPresenter x:Name="PART_CapsLockIndicator"
|
156 | 177 | Grid.Row="0"
|
157 | 178 | Grid.Column="1"
|
158 | 179 | Grid.RowSpan="2"
|
| 180 | + Margin="1" |
159 | 181 | TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
|
160 | 182 | Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
|
161 | 183 | VerticalAlignment="Center"
|
162 | 184 | HorizontalAlignment="Right"
|
163 | 185 | ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
|
164 |
| - Visibility="Collapsed" |
165 |
| - Width="16" /> |
| 186 | + Visibility="Collapsed" /> |
166 | 187 | </Grid>
|
167 | 188 | <Rectangle x:Name="DisabledVisualElement"
|
168 | 189 | Stroke="{DynamicResource ControlsDisabledBrush}"
|
|
210 | 231 | </DataTrigger.ExitActions>
|
211 | 232 | </DataTrigger>
|
212 | 233 |
|
213 |
| - <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.ClearTextButton)}" |
214 |
| - Value="False"> |
215 |
| - <Setter TargetName="PART_ContentHost" |
216 |
| - Property="Grid.ColumnSpan" |
217 |
| - Value="2" /> |
218 |
| - <Setter TargetName="Message" |
219 |
| - Property="Grid.ColumnSpan" |
220 |
| - Value="2" /> |
221 |
| - </DataTrigger> |
222 | 234 | <Trigger Property="IsMouseOver"
|
223 | 235 | Value="True">
|
224 | 236 | <Setter TargetName="FocusRectangle"
|
|
419 | 431 | Grid.Row="0"
|
420 | 432 | Grid.Column="1"
|
421 | 433 | Grid.RowSpan="2"
|
| 434 | + Margin="1" |
422 | 435 | TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
|
423 | 436 | Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
|
424 | 437 | VerticalAlignment="Center"
|
425 | 438 | HorizontalAlignment="Right"
|
426 | 439 | ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
|
427 |
| - Visibility="Collapsed" |
428 |
| - Width="16" /> |
| 440 | + Visibility="Collapsed" /> |
429 | 441 | </Grid>
|
430 | 442 | <Rectangle x:Name="DisabledVisualElement"
|
431 | 443 | Stroke="{DynamicResource ControlsDisabledBrush}"
|
|
0 commit comments