feat: DatePicker&TimePicker validations.
This commit is contained in:
parent
cece722496
commit
e8ef024d59
@ -135,6 +135,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="DatePicker">
|
||||
<DataValidationErrors>
|
||||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
|
||||
<Button
|
||||
Name="PART_FlyoutButton"
|
||||
@ -147,6 +148,7 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Cursor="Hand"
|
||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}"
|
||||
Theme="{StaticResource DateTimePickerFlyoutButton}">
|
||||
@ -219,6 +221,7 @@
|
||||
</Popup>
|
||||
|
||||
</Grid>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
@ -30,6 +30,25 @@
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerButtonDisabledBorderBrush}" />
|
||||
<Setter Property="Background" Value="{DynamicResource DateTimePickerButtonDisabledBackground}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:error">
|
||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsBackground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPointerOverBackground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsPressedBackground}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="^:focus /template/ ContentPresenter#PART_ContentPresenter">
|
||||
<Setter Property="Background" Value="{DynamicResource DataValidationErrorsSelectedBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource DataValidationErrorsSelectedBorderBrush}" />
|
||||
</Style>
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
<!-- Theme for the items displayed in the selectors -->
|
||||
|
@ -139,6 +139,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DataValidationErrors>
|
||||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}">
|
||||
<Button
|
||||
x:Name="PART_FlyoutButton"
|
||||
@ -151,6 +152,7 @@
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Cursor="Hand"
|
||||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsEnabled="{TemplateBinding IsEnabled}"
|
||||
Theme="{StaticResource DateTimePickerFlyoutButton}">
|
||||
@ -239,6 +241,7 @@
|
||||
<TimePickerPresenter Name="PART_PickerPresenter" />
|
||||
</Popup>
|
||||
</Grid>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user