Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions MainDemo.Wpf/ComboBoxes.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,21 @@
</ComboBox.SelectedItem>
</ComboBox>
</smtx:XamlDisplay>

<smtx:XamlDisplay
UniqueKey="comboboxes_helpertext_filled_combobox"
HorizontalAlignment="Left">

<ComboBox
Style="{StaticResource MaterialDesignFilledComboBox}"
materialDesign:HintAssist.Hint="With helper text"
materialDesign:HintAssist.HelperText="Helper text"
Width="256">
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
<ComboBoxItem Content="Item 3"/>
</ComboBox>
</smtx:XamlDisplay>
</StackPanel>

<TextBlock
Expand Down Expand Up @@ -375,6 +390,21 @@
</ComboBox.SelectedItem>
</ComboBox>
</smtx:XamlDisplay>

<smtx:XamlDisplay
UniqueKey="comboboxes_helpertext_outlined_combobox"
HorizontalAlignment="Left">

<ComboBox
Style="{StaticResource MaterialDesignOutlinedComboBox}"
materialDesign:HintAssist.Hint="With helper text"
materialDesign:HintAssist.HelperText="Helper text"
Width="256">
<ComboBoxItem Content="Item 1"/>
<ComboBoxItem Content="Item 2"/>
<ComboBoxItem Content="Item 3"/>
</ComboBox>
</smtx:XamlDisplay>
</StackPanel>
</StackPanel>
</UserControl>
24 changes: 24 additions & 0 deletions MainDemo.Wpf/Fields.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<Grid.Resources>
Expand Down Expand Up @@ -377,6 +378,17 @@
materialDesign:HintAssist.Hint="Password"/>
</StackPanel>
</smtx:XamlDisplay>

<smtx:XamlDisplay
Grid.Row="1"
Grid.Column="4"
UniqueKey="passwordFilled1"
VerticalAlignment="Bottom">
<PasswordBox
Style="{StaticResource MaterialDesignFilledPasswordBox}"
materialDesign:HintAssist.Hint="Password"
materialDesign:HintAssist.HelperText="Helper text"/>
</smtx:XamlDisplay>
</Grid>

<Grid Margin="0 48 0 0">
Expand All @@ -389,6 +401,7 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<Grid.Resources>
Expand Down Expand Up @@ -470,6 +483,17 @@
materialDesign:HintAssist.Hint="Password"/>
</StackPanel>
</smtx:XamlDisplay>

<smtx:XamlDisplay
Grid.Row="1"
Grid.Column="4"
UniqueKey="passwordOutlined1"
Margin="0 34 0 0">
<PasswordBox
Style="{StaticResource MaterialDesignOutlinedPasswordBox}"
materialDesign:HintAssist.Hint="Password"
materialDesign:HintAssist.HelperText="Helper text"/>
</smtx:XamlDisplay>
</Grid>

<Grid
Expand Down
2 changes: 2 additions & 0 deletions MainDemo.Wpf/Pickers.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<DatePicker
Width="140"
materialDesign:HintAssist.Hint="Pick Date"
materialDesign:HintAssist.HelperText="Helper text"
Style="{StaticResource MaterialDesignFilledDatePicker}"/>
</smtx:XamlDisplay>

Expand All @@ -194,6 +195,7 @@
<DatePicker
Width="140"
materialDesign:HintAssist.Hint="Pick Date"
materialDesign:HintAssist.HelperText="Helper text"
Style="{StaticResource MaterialDesignOutlinedDatePicker}"/>
</smtx:XamlDisplay>
</StackPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@
CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}" />
<Canvas
x:Name="HelperTextWrapper"
VerticalAlignment="Bottom">
<TextBlock
Canvas.Top="2"
Expand Down Expand Up @@ -535,6 +536,10 @@
</Grid>
</AdornerDecorator>
<ControlTemplate.Triggers>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16 8 12 8" />
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<Trigger
Property="wpf:TextFieldAssist.HasOutlinedTextField"
Value="True">
Expand Down Expand Up @@ -606,6 +611,7 @@
</MultiBinding>
</Setter.Value>
</Setter>
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<Trigger
Property="IsEditable"
Expand Down Expand Up @@ -1360,6 +1366,7 @@
</Style>

<Style x:Key="MaterialDesignFilledComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignFloatingHintComboBox}">
<Setter Property="wpf:TextFieldAssist.HasFilledTextField" Value="True"/>
<Setter Property="wpf:TextFieldAssist.TextFieldCornerRadius" Value="4,4,0,0" />
<Setter Property="wpf:ComboBoxAssist.ShowSelectedItem" Value="True"/>
<Setter Property="VerticalContentAlignment" Value="Stretch" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}" />
<Canvas VerticalAlignment="Bottom">
<Canvas x:Name="HelperTextWrapper" VerticalAlignment="Bottom">
<TextBlock
Canvas.Top="2"
FontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}"
Expand Down Expand Up @@ -258,14 +258,15 @@
</Setter>
</MultiTrigger>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16 8" />
<Setter Property="Padding" Value="16 8 12 8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
<Setter Property="Padding" Value="16" />
<Setter Property="Padding" Value="16 16 12 16" />
<Setter TargetName="Underline" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Hint" Property="HintOpacity" Value="1" />
<Setter TargetName="HintWrapper" Property="Opacity"
Expand All @@ -281,6 +282,7 @@
</MultiBinding>
</Setter.Value>
</Setter>
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
Background="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}"
CornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
Visibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}" />
<Canvas VerticalAlignment="Bottom">
<Canvas x:Name="HelperTextWrapper" VerticalAlignment="Bottom">
<TextBlock
Canvas.Top="2"
MaxWidth="{Binding ActualWidth, ElementName=border}"
Expand Down Expand Up @@ -251,15 +251,16 @@
</Setter>
</MultiTrigger>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16,8" />
<Setter Property="Padding" Value="16 8 12 8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
<Setter Property="Padding" Value="16" />
<Setter Property="Padding" Value="16 16 12 16" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
<Setter TargetName="Underline" Property="Visibility" Value="Collapsed" />
<Setter TargetName="Hint" Property="HintOpacity" Value="1" />
Expand All @@ -275,6 +276,7 @@
</MultiBinding>
</Setter.Value>
</Setter>
<Setter TargetName="HelperTextWrapper" Property="Margin" Value="16 0 0 0" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
Expand Down