Добавлен проект UI
This commit is contained in:
70
Lattice.UI/Themes/Styles/LatticePane.xaml
Normal file
70
Lattice.UI/Themes/Styles/LatticePane.xaml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Lattice.UI.Controls">
|
||||
|
||||
<Style TargetType="local:LatticePane">
|
||||
<!-- Используем StaticResource, так как эти токены определены в нашем SharedResources -->
|
||||
<Setter Property="Background" Value="{StaticResource LatticePaneBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{StaticResource LatticePaneBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{StaticResource LatticePaneMargin}" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="local:LatticePane">
|
||||
<Grid Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{StaticResource LatticePaneCornerRadius}">
|
||||
<Grid.RowDefinitions>
|
||||
<!-- Используем токен высоты заголовка -->
|
||||
<RowDefinition Height="Auto" MinHeight="{StaticResource LatticePaneHeaderHeight}" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Заголовок панели -->
|
||||
<Grid x:Name="HeaderPresenter"
|
||||
Background="{StaticResource LatticePaneHeaderBackground}"
|
||||
Padding="8,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{TemplateBinding Title}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{ThemeResource CaptionTextBlockStyle}"
|
||||
MaxLines="1"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="1" VerticalAlignment="Center">
|
||||
<!-- Кастомный контент (кнопки пользователя) -->
|
||||
<ContentPresenter Content="{TemplateBinding HeaderContent}" />
|
||||
|
||||
<!-- Стандартная кнопка закрытия -->
|
||||
<!-- Используем стандартный стиль WinUI "отсутствие рамки", чтобы она выглядела как в VS -->
|
||||
<Button x:Name="PART_CloseButton"
|
||||
Content=""
|
||||
FontFamily="Segoe Fluent Icons"
|
||||
FontSize="10"
|
||||
Padding="8,4"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Style="{StaticResource DefaultButtonStyle}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Основной контент -->
|
||||
<ContentPresenter Grid.Row="1"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user