|
1 |
| -<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 1 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
3 | 3 | xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
|
4 | 4 | xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"
|
|
22 | 22 | <converters:CursorConverter x:Key="ArrowCursorConverter" FallbackCursor="Arrow" />
|
23 | 23 | <converters:CursorConverter x:Key="IBeamCursorConverter" FallbackCursor="IBeam" />
|
24 | 24 | <converters:ThicknessCloneConverter x:Key="HelperTextMarginConverter" CloneEdges="Left" />
|
| 25 | + <converters:ThicknessCloneConverter x:Key="DefaultOrFilledStyleLeadingIconMarginConverterTop" |
| 26 | + AdditionalOffsetTop="-2" |
| 27 | + CloneEdges="Top" |
| 28 | + FixedRight="6" /> |
| 29 | + <converters:ThicknessCloneConverter x:Key="DefaultOrFilledStyleLeadingIconMarginConverterCenter" |
| 30 | + AdditionalOffsetTop="-12" |
| 31 | + CloneEdges="Top" |
| 32 | + FixedRight="6" /> |
| 33 | + <converters:ThicknessCloneConverter x:Key="DefaultOrFilledStyleLeadingIconMarginConverterBottom" |
| 34 | + CloneEdges="Top" |
| 35 | + FixedBottom="-2" |
| 36 | + FixedRight="6" /> |
25 | 37 | <converters:ThicknessCloneConverter x:Key="DefaultOrFilledStyleTrailingIconMarginConverterTop"
|
26 | 38 | AdditionalOffsetTop="-2"
|
27 | 39 | CloneEdges="Top" />
|
|
31 | 43 | <converters:ThicknessCloneConverter x:Key="DefaultOrFilledStyleTrailingIconMarginConverterBottom"
|
32 | 44 | CloneEdges="Top"
|
33 | 45 | FixedBottom="-2" />
|
| 46 | + <converters:ThicknessCloneConverter x:Key="OutlinedStyleLeadingIconMarginConverterTop" |
| 47 | + AdditionalOffsetTop="-2" |
| 48 | + CloneEdges="Top" |
| 49 | + FixedRight="6" /> |
| 50 | + <converters:ThicknessCloneConverter x:Key="OutlinedStyleLeadingIconMarginConverterCenter" |
| 51 | + AdditionalOffsetTop="0" |
| 52 | + CloneEdges="Top" |
| 53 | + FixedRight="6" /> |
| 54 | + <converters:ThicknessCloneConverter x:Key="OutlinedStyleLeadingIconMarginConverterBottom" |
| 55 | + AdditionalOffsetTop="0" |
| 56 | + CloneEdges="Top" |
| 57 | + FixedBottom="-2" |
| 58 | + FixedRight="6" /> |
34 | 59 | <converters:ThicknessCloneConverter x:Key="OutlinedStyleTrailingIconMarginConverterTop"
|
35 | 60 | AdditionalOffsetTop="-2"
|
36 | 61 | CloneEdges="Top" />
|
|
41 | 66 | AdditionalOffsetTop="0"
|
42 | 67 | CloneEdges="Top"
|
43 | 68 | FixedBottom="-2" />
|
| 69 | + |
| 70 | + |
44 | 71 | <wpf:VerticalAlignmentConverter x:Key="VerticalAlignmentConverter" />
|
45 | 72 | <converters:NullableToVisibilityConverter x:Key="NullableToVisibilityConverter" />
|
46 | 73 |
|
|
156 | 183 | SnapsToDevicePixels="True">
|
157 | 184 | <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
158 | 185 | <Grid.ColumnDefinitions>
|
| 186 | + <ColumnDefinition Width="Auto" /> |
159 | 187 | <ColumnDefinition />
|
160 | 188 | <ColumnDefinition Width="Auto" />
|
161 | 189 | </Grid.ColumnDefinitions>
|
| 190 | + <wpf:PackIcon x:Name="LeadingPackIcon" |
| 191 | + Grid.Column="0" |
| 192 | + Width="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}" |
| 193 | + Height="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}" |
| 194 | + Margin="0,0,6,0" |
| 195 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment, Converter={StaticResource VerticalAlignmentConverter}}" |
| 196 | + Kind="{TemplateBinding wpf:TextFieldAssist.LeadingIcon}" |
| 197 | + Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}" |
| 198 | + Visibility="{TemplateBinding wpf:TextFieldAssist.HasLeadingIcon, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
162 | 199 | <Grid x:Name="grid"
|
| 200 | + Grid.Column="1" |
163 | 201 | MinWidth="1"
|
164 | 202 | HorizontalAlignment="Stretch"
|
165 | 203 | VerticalAlignment="Stretch">
|
|
220 | 258 | Visibility="{TemplateBinding wpf:TextFieldAssist.SuffixText, Converter={StaticResource NullableToVisibilityConverter}}" />
|
221 | 259 | </Grid>
|
222 | 260 | <Button x:Name="PART_ClearButton"
|
223 |
| - Grid.Column="1" |
| 261 | + Grid.Column="2" |
224 | 262 | Height="Auto"
|
225 | 263 | Padding="2,0,0,0"
|
226 | 264 | VerticalAlignment="{TemplateBinding VerticalContentAlignment, Converter={StaticResource VerticalAlignmentConverter}}"
|
|
310 | 348 | </MultiTrigger.Conditions>
|
311 | 349 | <Setter TargetName="Hint" Property="InitialVerticalOffset" Value="-6" />
|
312 | 350 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterCenter}}" />
|
| 351 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterCenter}}" /> |
313 | 352 | </MultiTrigger>
|
314 | 353 | <MultiTrigger>
|
315 | 354 | <MultiTrigger.Conditions>
|
316 | 355 | <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
|
317 | 356 | <Condition SourceName="PART_ClearButton" Property="VerticalAlignment" Value="Top" />
|
318 | 357 | </MultiTrigger.Conditions>
|
319 | 358 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterTop}}" />
|
| 359 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterTop}}" /> |
320 | 360 | </MultiTrigger>
|
321 | 361 | <MultiTrigger>
|
322 | 362 | <MultiTrigger.Conditions>
|
323 | 363 | <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
|
324 | 364 | <Condition SourceName="PART_ClearButton" Property="VerticalAlignment" Value="Bottom" />
|
325 | 365 | </MultiTrigger.Conditions>
|
326 | 366 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterBottom}}" />
|
| 367 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterBottom}}" /> |
327 | 368 | </MultiTrigger>
|
328 | 369 |
|
329 | 370 | <!-- Icon margins adhering to VerticalContentAlignment for outlined style -->
|
|
333 | 374 | <Condition SourceName="PART_ClearButton" Property="VerticalAlignment" Value="Center" />
|
334 | 375 | </MultiTrigger.Conditions>
|
335 | 376 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterCenter}}" />
|
| 377 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterCenter}}" /> |
336 | 378 | </MultiTrigger>
|
337 | 379 | <MultiTrigger>
|
338 | 380 | <MultiTrigger.Conditions>
|
339 | 381 | <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
|
340 | 382 | <Condition SourceName="PART_ClearButton" Property="VerticalAlignment" Value="Top" />
|
341 | 383 | </MultiTrigger.Conditions>
|
342 | 384 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterTop}}" />
|
| 385 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterTop}}" /> |
343 | 386 | </MultiTrigger>
|
344 | 387 | <MultiTrigger>
|
345 | 388 | <MultiTrigger.Conditions>
|
346 | 389 | <Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
|
347 | 390 | <Condition SourceName="PART_ClearButton" Property="VerticalAlignment" Value="Bottom" />
|
348 | 391 | </MultiTrigger.Conditions>
|
349 | 392 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterBottom}}" />
|
| 393 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterBottom}}" /> |
350 | 394 | </MultiTrigger>
|
351 | 395 |
|
352 | 396 | <Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
|
|
680 | 724 | SnapsToDevicePixels="True">
|
681 | 725 | <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
682 | 726 | <Grid.ColumnDefinitions>
|
| 727 | + <ColumnDefinition Width="Auto" /> |
683 | 728 | <ColumnDefinition Width="*" />
|
684 | 729 | <ColumnDefinition Width="Auto" />
|
685 | 730 | <ColumnDefinition Width="Auto" />
|
686 | 731 | </Grid.ColumnDefinitions>
|
| 732 | + <wpf:PackIcon x:Name="LeadingPackIcon" |
| 733 | + Grid.Column="0" |
| 734 | + Width="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}" |
| 735 | + Height="{TemplateBinding wpf:TextFieldAssist.LeadingIconSize}" |
| 736 | + Margin="0,0,6,0" |
| 737 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment, Converter={StaticResource VerticalAlignmentConverter}}" |
| 738 | + Kind="{TemplateBinding wpf:TextFieldAssist.LeadingIcon}" |
| 739 | + Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}" |
| 740 | + Visibility="{TemplateBinding wpf:TextFieldAssist.HasLeadingIcon, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
687 | 741 | <Grid x:Name="grid"
|
| 742 | + Grid.Column="1" |
688 | 743 | MinWidth="1"
|
689 | 744 | HorizontalAlignment="Stretch"
|
690 | 745 | VerticalAlignment="Stretch">
|
|
774 | 829 | Visibility="{TemplateBinding wpf:TextFieldAssist.SuffixText, Converter={StaticResource NullableToVisibilityConverter}}" />
|
775 | 830 | </Grid>
|
776 | 831 | <ToggleButton x:Name="RevealPasswordButton"
|
777 |
| - Grid.Column="1" |
| 832 | + Grid.Column="2" |
778 | 833 | Height="Auto"
|
779 | 834 | Padding="2,0,0,0"
|
780 | 835 | VerticalAlignment="{TemplateBinding VerticalContentAlignment, Converter={StaticResource VerticalAlignmentConverter}}"
|
|
785 | 840 | Foreground="{Binding ElementName=PART_ClearButton, Path=Foreground}" />
|
786 | 841 | </ToggleButton>
|
787 | 842 | <Button x:Name="PART_ClearButton"
|
788 |
| - Grid.Column="2" |
| 843 | + Grid.Column="3" |
789 | 844 | Height="Auto"
|
790 | 845 | Padding="2,0,0,0"
|
791 | 846 | VerticalAlignment="{TemplateBinding VerticalContentAlignment, Converter={StaticResource VerticalAlignmentConverter}}"
|
|
876 | 931 | <Setter TargetName="Hint" Property="InitialVerticalOffset" Value="-6" />
|
877 | 932 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterCenter}}" />
|
878 | 933 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterCenter}}" />
|
| 934 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterCenter}}" /> |
879 | 935 | </MultiTrigger>
|
880 | 936 | <MultiTrigger>
|
881 | 937 | <MultiTrigger.Conditions>
|
|
884 | 940 | </MultiTrigger.Conditions>
|
885 | 941 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterTop}}" />
|
886 | 942 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterTop}}" />
|
| 943 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterTop}}" /> |
887 | 944 | </MultiTrigger>
|
888 | 945 | <MultiTrigger>
|
889 | 946 | <MultiTrigger.Conditions>
|
|
892 | 949 | </MultiTrigger.Conditions>
|
893 | 950 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterBottom}}" />
|
894 | 951 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleTrailingIconMarginConverterBottom}}" />
|
| 952 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource DefaultOrFilledStyleLeadingIconMarginConverterBottom}}" /> |
895 | 953 | </MultiTrigger>
|
896 | 954 |
|
897 | 955 | <!-- Icon margins adhering to VerticalContentAlignment for outlined style -->
|
|
902 | 960 | </MultiTrigger.Conditions>
|
903 | 961 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterCenter}}" />
|
904 | 962 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterCenter}}" />
|
| 963 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterCenter}}" /> |
905 | 964 | </MultiTrigger>
|
906 | 965 | <MultiTrigger>
|
907 | 966 | <MultiTrigger.Conditions>
|
|
910 | 969 | </MultiTrigger.Conditions>
|
911 | 970 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterTop}}" />
|
912 | 971 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterTop}}" />
|
| 972 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterTop}}" /> |
913 | 973 | </MultiTrigger>
|
914 | 974 | <MultiTrigger>
|
915 | 975 | <MultiTrigger.Conditions>
|
|
918 | 978 | </MultiTrigger.Conditions>
|
919 | 979 | <Setter TargetName="PART_ClearButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterBottom}}" />
|
920 | 980 | <Setter TargetName="RevealPasswordButton" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleTrailingIconMarginConverterBottom}}" />
|
| 981 | + <Setter TargetName="LeadingPackIcon" Property="Margin" Value="{Binding ElementName=grid, Path=Margin, Converter={StaticResource OutlinedStyleLeadingIconMarginConverterBottom}}" /> |
921 | 982 | </MultiTrigger>
|
922 | 983 |
|
923 | 984 | <Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
|
|
0 commit comments