Skip to content

Commit e7c49e6

Browse files
sankeKeboo
authored andcommitted
Fixed #1117 (#1118)
* Fixed #1117 * Fixes DatePicker misalignment between picker and bottom line. Changed default alignment to center for DatePicker,TimePicker controls. * Fixing alignment between date picker and time picker controls. * Removing un-needed vertical alignment setter.
1 parent 94b64b2 commit e7c49e6

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.DatePicker.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />
1212
<converters:MathConverter Operation="Divide" x:Key="DivisionMathConverter" />
13-
13+
1414
<Style x:Key="MaterialDesignDatePickerTextBox" TargetType="{x:Type DatePickerTextBox}">
1515
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
1616
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="0 0 0 0" />
@@ -100,6 +100,7 @@
100100
</Style>
101101

102102
<Style x:Key="MaterialDesignDatePicker" TargetType="{x:Type DatePicker}">
103+
<Setter Property="VerticalAlignment" Value="Center" />
103104
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
104105
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
105106
<Setter Property="Background" Value="Transparent" />
@@ -168,8 +169,8 @@
168169
Focusable="False"
169170
HorizontalAlignment="Right"
170171
Margin="4 0 0 -3"
171-
Grid.Row="0"
172-
Template="{StaticResource DropDownButtonTemplate}" Padding="0"
172+
Template="{StaticResource DropDownButtonTemplate}"
173+
Padding="0"
173174
Height="17" />
174175
<DatePickerTextBox x:Name="PART_TextBox"
175176
Grid.Column="0"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TimePicker.xaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
<converters:MathConverter Operation="Divide" x:Key="DivisionMathConverter" />
1010

1111
<Style x:Key="MaterialDesignTimePicker" TargetType="{x:Type wpf:TimePicker}">
12-
<Setter Property="VerticalAlignment" Value="Top"/>
12+
<Setter Property="VerticalAlignment" Value="Center"/>
1313
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
1414
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
1515
<Setter Property="Background" Value="Transparent"/>
1616
<Setter Property="BorderThickness" Value="0 0 0 1"/>
1717
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
1818
<Setter Property="IsTabStop" Value="False"/>
19-
<Setter Property="Margin" Value="0 12 0 0" />
2019
<Setter Property="wpf:HintAssist.Hint" Value="Select time" />
2120
<Setter Property="ClockStyle" Value="{DynamicResource MaterialDesignClock}" />
2221
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}"/>
@@ -106,10 +105,15 @@
106105
Margin="0"
107106
Template="{StaticResource TextBoxTemplate}"
108107
/>
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}" />
108+
<Button x:Name="PART_Button"
109+
Grid.Column="1"
110+
Foreground="{TemplateBinding BorderBrush}"
111+
Focusable="False"
112+
HorizontalAlignment="Right"
113+
Margin="4 0 0 -3"
114+
Template="{StaticResource DropDownButtonTemplate}"
115+
Padding="0"
116+
Height="17" />
113117
<Popup x:Name="PART_Popup" AllowsTransparency="True"
114118
Placement="Custom"
115119
CustomPopupPlacementCallback="{x:Static wpf:CustomPopupPlacementCallbackHelper.LargePopupCallback}"

0 commit comments

Comments
 (0)