livia-test/Livia/Resources/Themes/LiviaCard.xaml
2025-03-28 14:31:53 +08:00

35 lines
1.9 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:attachedProperties="clr-namespace:Livia.Views.AttachedProperties">
<Style TargetType="{x:Type materialDesign:Card}"
x:Key="LiviaCard">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type materialDesign:Card}">
<materialDesign:Card UniformCornerRadius="6"
Background="Transparent">
<StackPanel>
<Border Height="64"
CornerRadius="6, 6, 0, 0"
Background="{StaticResource PrimaryColorBrush}">
<TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(attachedProperties:StringItemProperties.ItemName)}"
Style="{StaticResource MaterialDesignBody1TextBlock}"
Margin="20, 0"
Foreground="{StaticResource White1Brush}"
VerticalAlignment="Center" />
</Border>
<Border CornerRadius="0, 0, 6, 6"
Background="{StaticResource White1Brush}">
<ContentPresenter x:Name="ContentPresenter"
Margin="20" />
</Border>
</StackPanel>
</materialDesign:Card>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>