|
| 1 | +<!-- Copyright (c) Files Community. Licensed under the MIT License. --> |
| 2 | +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:local="using:DevWinUI"> |
| 5 | + |
| 6 | + <x:Double x:Key="SamplePanelSideContentWidth">360</x:Double> |
| 7 | + <Thickness x:Key="SamplePanelPadding">24</Thickness> |
| 8 | + |
| 9 | + <Style TargetType="local:SamplePanel" BasedOn="{StaticResource DefaultSamplePanelStyle}" /> |
| 10 | + |
| 11 | + <Style x:Key="DefaultSamplePanelStyle" TargetType="local:SamplePanel"> |
| 12 | + <Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" /> |
| 13 | + <Setter Property="BorderBrush" Value="{ThemeResource DividerStrokeColorDefaultBrush}" /> |
| 14 | + <Setter Property="BorderThickness" Value="1" /> |
| 15 | + <Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" /> |
| 16 | + <Setter Property="Padding" Value="{ThemeResource SamplePanelPadding}" /> |
| 17 | + <Setter Property="HorizontalAlignment" Value="Stretch" /> |
| 18 | + <Setter Property="VerticalAlignment" Value="Center" /> |
| 19 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| 20 | + <Setter Property="IsTabStop" Value="True" /> |
| 21 | + <Setter Property="UseSystemFocusVisuals" Value="True" /> |
| 22 | + <Setter Property="IsFocusEngagementEnabled" Value="True" /> |
| 23 | + <Setter Property="Template"> |
| 24 | + <Setter.Value> |
| 25 | + <ControlTemplate TargetType="local:SamplePanel"> |
| 26 | + <Grid x:Name="PART_RootGrid" RowSpacing="8"> |
| 27 | + <Grid.RowDefinitions> |
| 28 | + <RowDefinition Height="Auto" /> |
| 29 | + <RowDefinition Height="Auto" /> |
| 30 | + </Grid.RowDefinitions> |
| 31 | + |
| 32 | + <TextBlock Grid.Row="0" |
| 33 | + Style="{StaticResource BodyStrongTextBlockStyle}" |
| 34 | + Text="{Binding Header, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" /> |
| 35 | + |
| 36 | + <Grid x:Name="PART_RootPanel" Grid.Row="1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> |
| 37 | + <Grid.ColumnDefinitions> |
| 38 | + <ColumnDefinition Width="*" /> |
| 39 | + <ColumnDefinition Width="Auto" /> |
| 40 | + </Grid.ColumnDefinitions> |
| 41 | + |
| 42 | + <ContentPresenter Grid.Column="0" |
| 43 | + Padding="{TemplateBinding Padding}" |
| 44 | + Content="{Binding MainContent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" /> |
| 45 | + |
| 46 | + <StackPanel Grid.Column="1" Width="{StaticResource SamplePanelSideContentWidth}" Padding="{TemplateBinding Padding}" Background="{ThemeResource LayerFillColorDefaultBrush}" BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}" BorderThickness="1,0,0,0" Spacing="12"> |
| 47 | + |
| 48 | + <ContentPresenter Margin="0,12,0,0" |
| 49 | + Content="{Binding SideContent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" /> |
| 50 | + |
| 51 | + </StackPanel> |
| 52 | + </Grid> |
| 53 | + </Grid> |
| 54 | + </ControlTemplate> |
| 55 | + </Setter.Value> |
| 56 | + </Setter> |
| 57 | + </Style> |
| 58 | + |
| 59 | +</ResourceDictionary> |
0 commit comments