Files
BeWoPlaner/BeWo/Styles/ControlStyles/DateEditStyles.xaml
2025-02-04 11:24:03 +01:00

74 lines
3.4 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxei="http://schemas.devexpress.com/winfx/2008/xaml/editors/internal"
xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys">
<Style
x:Key="BaseDateEdit"
BasedOn="{StaticResource {x:Type dxe:DateEdit}}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="Margin" Value="3" />
<Setter Property="Padding" Value="1" />
<Setter Property="Height" Value="23" />
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style
x:Key="PrimaryDateEdit"
BasedOn="{StaticResource BaseDateEdit}"
TargetType="{x:Type dxe:DateEdit}">
<Style.Resources>
<DataTemplate x:Key="{dxet:ButtonsThemeKey ResourceKey=ToggleButtonInfoTemplate, IsThemeIndependent=True}">
<dx:ToggleStateButton
x:Name="PART_Item"
Margin="2"
dxei:SetIsCheckedToButtonInfoBehavior.IsEnabled="True"
IsChecked="{Binding Path=IsChecked, Mode=TwoWay}"
Style="{StaticResource ComboBoxTransparentButtonStyle}" />
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=IsDefaultButton}" Value="True">
<Setter TargetName="PART_Item" Property="IsChecked" Value="{Binding Path=(dxe:BaseEdit.OwnerEdit).IsPopupOpen, RelativeSource={RelativeSource Self}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsDefaultButton}" Value="False">
<Setter TargetName="PART_Item" Property="HandleToggle" Value="False" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</Style.Resources>
</Style>
<Style
x:Key="DateEditDateOnly"
BasedOn="{StaticResource PrimaryDateEdit}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="MaskType" Value="DateOnlyAdvancingCaret" />
<Setter Property="MaskUseAsDisplayFormat" Value="true" />
</Style>
<Style
x:Key="DateEditDateOnlyShort"
BasedOn="{StaticResource DateEditDateOnly}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="Mask" Value="d" />
</Style>
<Style
x:Key="DateEditDateOnlyLong"
BasedOn="{StaticResource DateEditDateOnly}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="Mask" Value="D" />
</Style>
<Style
x:Key="DateEditDateTime"
BasedOn="{StaticResource PrimaryDateEdit}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="MaskType" Value="DateTimeAdvancingCaret" />
<Setter Property="MaskUseAsDisplayFormat" Value="true" />
</Style>
<Style
x:Key="DateEditDateTimeShort"
BasedOn="{StaticResource DateEditDateTime}"
TargetType="{x:Type dxe:DateEdit}">
<Setter Property="Mask" Value="F" />
</Style>
</ResourceDictionary>