Files
ShrlAlgoToolkit/AntDesignWPF/Controls/AntContentControl.xaml
2025-07-31 20:12:24 +08:00

62 lines
3.7 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:AntDesignWPF.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntDesignWPF;component/Themes/Converters.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type controls:AntContentControl}" x:Key="Ant.ContentControl">
<!--<Setter Property="Foreground" Value="{DynamicResource AntDesign.Brush.TextOnPrimary}" />-->
<Setter Property="Background" Value="Transparent" />
<Setter Property="Focusable" Value="False" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AntContentControl}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="{TemplateBinding RecognizesAccessKey}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_ContentPresenter" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ContentCharacterCasing" Value="Normal">
<Setter Property="Content" TargetName="PART_ContentPresenter" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />
</Trigger>
<Trigger Property="ContentCharacterCasing" Value="Upper">
<Setter Property="Content" TargetName="PART_ContentPresenter" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToUpperConverter}}" />
</Trigger>
<Trigger Property="ContentCharacterCasing" Value="Lower">
<Setter Property="Content" TargetName="PART_ContentPresenter" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToLowerConverter}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style
BasedOn="{StaticResource Ant.ContentControl}"
TargetType="{x:Type controls:ThumbContentControl}"
x:Key="Ant.ThumbContentControl" />
<Style BasedOn="{StaticResource Ant.ThumbContentControl}" TargetType="{x:Type controls:ThumbContentControl}" />
<!--<Style BasedOn="{StaticResource Antd.ContentControl}" TargetType="{x:Type controls:AntContentControl}" />-->
</ResourceDictionary>