|
20 | 20 | <converters:CursorConverter x:Key="ArrowCursorConverter" FallbackCursor="Arrow" />
|
21 | 21 | <converters:CursorConverter x:Key="IBeamCursorConverter" FallbackCursor="IBeam" />
|
22 | 22 |
|
| 23 | + <Style x:Key="MaterialDesignPasswordCharacterCounterTextBlock" |
| 24 | + TargetType="TextBlock" |
| 25 | + BasedOn="{StaticResource {x:Type TextBlock}}"> |
| 26 | + <Setter Property="FontSize" Value="10" /> |
| 27 | + <Setter Property="Margin" Value="0,0,16,0" /> |
| 28 | + <Setter Property="Opacity" Value="0.56" /> |
| 29 | + <Setter Property="Text"> |
| 30 | + <Setter.Value> |
| 31 | + <MultiBinding StringFormat="{}{0} / {1}"> |
| 32 | + <Binding Path="(wpf:TextFieldAssist.PasswordBoxCharacterCount)" RelativeSource="{RelativeSource FindAncestor, AncestorType=PasswordBox}" /> |
| 33 | + <Binding Path="MaxLength" RelativeSource="{RelativeSource FindAncestor, AncestorType=PasswordBox}" /> |
| 34 | + </MultiBinding> |
| 35 | + </Setter.Value> |
| 36 | + </Setter> |
| 37 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 38 | + <Setter Property="Visibility" Value="{Binding Path=(wpf:TextFieldAssist.CharacterCounterVisibility), RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type PasswordBox}}}" /> |
| 39 | + </Style> |
| 40 | + |
| 41 | + <Style x:Key="MaterialDesignPasswordHelperTextBlock" |
| 42 | + TargetType="TextBlock" |
| 43 | + BasedOn="{StaticResource {x:Type TextBlock}}"> |
| 44 | + <Setter Property="FontSize" Value="{Binding Path=(wpf:HintAssist.HelperTextFontSize), RelativeSource={RelativeSource Mode=TemplatedParent}}" /> |
| 45 | + <Setter Property="Opacity" Value="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource Mode=TemplatedParent}}" /> |
| 46 | + <Setter Property="Text" Value="{Binding Path=(wpf:HintAssist.HelperText), RelativeSource={RelativeSource Mode=TemplatedParent}}" /> |
| 47 | + </Style> |
| 48 | + |
23 | 49 | <Style x:Key="MaterialDesignPasswordBox" TargetType="{x:Type PasswordBox}">
|
24 | 50 | <Setter Property="AllowDrop" Value="true" />
|
25 | 51 | <Setter Property="Background" Value="Transparent" />
|
|
185 | 211 | Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}"
|
186 | 212 | CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
|
187 | 213 | Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}" />
|
188 |
| - <Canvas x:Name="HelperTextWrapper" VerticalAlignment="Bottom"> |
189 |
| - <TextBlock Canvas.Top="2" |
190 |
| - MaxWidth="{Binding ActualWidth, ElementName=border}" |
191 |
| - FontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}" |
192 |
| - Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}" |
193 |
| - Text="{TemplateBinding wpf:HintAssist.HelperText}" /> |
| 214 | + <Canvas VerticalAlignment="Bottom"> |
| 215 | + <Grid x:Name="FooterGrid" |
| 216 | + Canvas.Top="2" |
| 217 | + Width="{Binding ActualWidth, ElementName=border}"> |
| 218 | + <Grid.ColumnDefinitions> |
| 219 | + <ColumnDefinition /> |
| 220 | + <ColumnDefinition Width="Auto" /> |
| 221 | + </Grid.ColumnDefinitions> |
| 222 | + <TextBlock x:Name="HelperTextTextBlock" Style="{Binding Path=(wpf:HintAssist.HelperTextStyle), RelativeSource={RelativeSource TemplatedParent}}" /> |
| 223 | + <Border x:Name="CharacterCounterContainer" Grid.Column="1"> |
| 224 | + <TextBlock x:Name="CharacterCounterTextBlock" Style="{Binding Path=(wpf:TextFieldAssist.CharacterCounterStyle), RelativeSource={RelativeSource TemplatedParent}}" /> |
| 225 | + </Border> |
| 226 | + </Grid> |
194 | 227 | </Canvas>
|
195 | 228 | </Grid>
|
196 | 229 | <ControlTemplate.Triggers>
|
|
232 | 265 | <Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
|
233 | 266 | <Setter Property="Padding" Value="16,8,12,8" />
|
234 | 267 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
|
235 |
| - <Setter TargetName="HelperTextWrapper" Property="Margin" Value="16,0,0,0" /> |
| 268 | + <Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" /> |
236 | 269 | </Trigger>
|
237 | 270 | <Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
|
238 | 271 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
|
239 | 272 | <Setter Property="BorderThickness" Value="1" />
|
240 | 273 | <Setter Property="Padding" Value="16,16,12,16" />
|
241 | 274 | <Setter Property="VerticalContentAlignment" Value="Top" />
|
242 | 275 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
|
243 |
| - <Setter TargetName="HelperTextWrapper" Property="Margin" Value="16,0,0,0" /> |
| 276 | + <Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" /> |
244 | 277 | <Setter TargetName="Hint" Property="FloatingOffset">
|
245 | 278 | <Setter.Value>
|
246 | 279 | <MultiBinding Converter="{StaticResource FloatingHintOffsetCalculationConverter}">
|
|
394 | 427 | </MultiTrigger.Conditions>
|
395 | 428 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}" />
|
396 | 429 | <Setter Property="BorderThickness" Value="2" />
|
| 430 | + <Setter TargetName="FooterGrid" Property="Margin" Value="0,0,1,0" /> |
397 | 431 | <Setter TargetName="border" Property="Margin" Value="-1" />
|
398 | 432 | </MultiTrigger>
|
399 | 433 | </ControlTemplate.Triggers>
|
|
404 | 438 | <Setter Property="VerticalContentAlignment" Value="Top" />
|
405 | 439 | <Setter Property="internal:ClearText.HandlesClearCommand" Value="True" />
|
406 | 440 | <Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
|
| 441 | + <Setter Property="wpf:HintAssist.HelperTextStyle" Value="{StaticResource MaterialDesignPasswordHelperTextBlock}" /> |
407 | 442 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
|
408 | 443 | <Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
|
| 444 | + <Setter Property="wpf:TextFieldAssist.CharacterCounterStyle" Value="{StaticResource MaterialDesignPasswordCharacterCounterTextBlock}" /> |
| 445 | + <Setter Property="wpf:TextFieldAssist.CharacterCounterVisibility" Value="Hidden" /> |
409 | 446 | </Style>
|
410 | 447 |
|
411 | 448 | <Style x:Key="MaterialDesignFloatingHintPasswordBox"
|
|
661 | 698 | Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}"
|
662 | 699 | CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
|
663 | 700 | Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}" />
|
664 |
| - <Canvas x:Name="HelperTextWrapper" VerticalAlignment="Bottom"> |
665 |
| - <TextBlock Canvas.Top="2" |
666 |
| - MaxWidth="{Binding ActualWidth, ElementName=border}" |
667 |
| - FontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}" |
668 |
| - Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}" |
669 |
| - Text="{TemplateBinding wpf:HintAssist.HelperText}" /> |
| 701 | + <Canvas VerticalAlignment="Bottom"> |
| 702 | + <Grid x:Name="FooterGrid" |
| 703 | + Canvas.Top="2" |
| 704 | + Width="{Binding ActualWidth, ElementName=border}"> |
| 705 | + <Grid.ColumnDefinitions> |
| 706 | + <ColumnDefinition /> |
| 707 | + <ColumnDefinition Width="Auto" /> |
| 708 | + </Grid.ColumnDefinitions> |
| 709 | + <TextBlock x:Name="HelperTextTextBlock" Style="{Binding Path=(wpf:HintAssist.HelperTextStyle), RelativeSource={RelativeSource TemplatedParent}}" /> |
| 710 | + <Border x:Name="CharacterCounterContainer" Grid.Column="1"> |
| 711 | + <TextBlock x:Name="CharacterCounterTextBlock" Style="{Binding Path=(wpf:TextFieldAssist.CharacterCounterStyle), RelativeSource={RelativeSource TemplatedParent}}" /> |
| 712 | + </Border> |
| 713 | + </Grid> |
670 | 714 | </Canvas>
|
671 | 715 | </Grid>
|
672 | 716 | <ControlTemplate.Triggers>
|
|
717 | 761 | <Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
|
718 | 762 | <Setter Property="Padding" Value="16,8,12,8" />
|
719 | 763 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
|
720 |
| - <Setter TargetName="HelperTextWrapper" Property="Margin" Value="16,0,0,0" /> |
| 764 | + <Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" /> |
721 | 765 | </Trigger>
|
722 | 766 | <Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
|
723 | 767 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
|
724 | 768 | <Setter Property="BorderThickness" Value="1" />
|
725 | 769 | <Setter Property="Padding" Value="16,16,12,16" />
|
726 | 770 | <Setter Property="VerticalContentAlignment" Value="Top" />
|
727 | 771 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
|
728 |
| - <Setter TargetName="HelperTextWrapper" Property="Margin" Value="16,0,0,0" /> |
| 772 | + <Setter TargetName="HelperTextTextBlock" Property="Margin" Value="16,0,0,0" /> |
729 | 773 | <Setter TargetName="Hint" Property="FloatingOffset">
|
730 | 774 | <Setter.Value>
|
731 | 775 | <MultiBinding Converter="{StaticResource FloatingHintOffsetCalculationConverter}">
|
|
880 | 924 | </MultiTrigger.Conditions>
|
881 | 925 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}" />
|
882 | 926 | <Setter Property="BorderThickness" Value="2" />
|
| 927 | + <Setter TargetName="FooterGrid" Property="Margin" Value="0,0,1,0" /> |
883 | 928 | <Setter TargetName="border" Property="Margin" Value="-1" />
|
884 | 929 | </MultiTrigger>
|
885 | 930 |
|
|
900 | 945 | <Setter Property="VerticalContentAlignment" Value="Top" />
|
901 | 946 | <Setter Property="internal:ClearText.HandlesClearCommand" Value="True" />
|
902 | 947 | <Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
|
| 948 | + <Setter Property="wpf:HintAssist.HelperTextStyle" Value="{StaticResource MaterialDesignPasswordHelperTextBlock}" /> |
903 | 949 | <Setter Property="wpf:PasswordBoxAssist.InitialPassword" Value="" />
|
904 | 950 | <Setter Property="wpf:PasswordBoxAssist.IsPasswordRevealed" Value="False" />
|
905 | 951 | <Setter Property="wpf:PasswordBoxAssist.Password" Value="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:PasswordBoxAssist.InitialPassword)}" />
|
906 | 952 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
|
907 | 953 | <Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
|
| 954 | + <Setter Property="wpf:TextFieldAssist.CharacterCounterStyle" Value="{StaticResource MaterialDesignPasswordCharacterCounterTextBlock}" /> |
| 955 | + <Setter Property="wpf:TextFieldAssist.CharacterCounterVisibility" Value="Hidden" /> |
908 | 956 | </Style>
|
909 | 957 |
|
910 | 958 | <Style x:Key="MaterialDesignFloatingHintRevealPasswordBox"
|
|
0 commit comments