-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expand file tree
/
Copy pathSamplePanel.xaml
More file actions
108 lines (94 loc) · 3.93 KB
/
SamplePanel.xaml
File metadata and controls
108 lines (94 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Files.App.Controls">
<x:Double x:Key="SamplePanelSideContentWidth">360</x:Double>
<Thickness x:Key="SamplePanelPadding">24</Thickness>
<Style BasedOn="{StaticResource DefaultSamplePanelStyle}" TargetType="local:SamplePanel" />
<Style x:Key="DefaultSamplePanelStyle" TargetType="local:SamplePanel">
<Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource DividerStrokeColorDefaultBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{ThemeResource OverlayCornerRadius}" />
<Setter Property="Padding" Value="{ThemeResource SamplePanelPadding}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="IsTabStop" Value="True" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="IsFocusEngagementEnabled" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:SamplePanel">
<Grid x:Name="PART_RootGrid" RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Style="{StaticResource BodyStrongTextBlockStyle}"
Text="{TemplateBinding Header}" />
<Grid
x:Name="PART_RootPanel"
Grid.Row="1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter
Grid.Column="0"
Padding="{TemplateBinding Padding}"
Content="{TemplateBinding MainContent}" />
<StackPanel
Grid.Column="1"
Width="{StaticResource SamplePanelSideContentWidth}"
Padding="{TemplateBinding Padding}"
Background="{ThemeResource LayerFillColorDefaultBrush}"
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
BorderThickness="1,0,0,0"
Spacing="12">
<SelectorBar Padding="-12,0">
<SelectorBarItem IsSelected="True" Text="Manipulation">
<SelectorBarItem.Icon>
<FontIcon Glyph="" />
</SelectorBarItem.Icon>
</SelectorBarItem>
<SelectorBarItem IsEnabled="False" Text="Code">
<SelectorBarItem.Icon>
<FontIcon Glyph="" />
</SelectorBarItem.Icon>
</SelectorBarItem>
</SelectorBar>
<ContentPresenter Margin="0,12,0,0" Content="{TemplateBinding SideContent}" />
<TextBlock
x:Name="PART_NothingToShowTextBlock"
Margin="24"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontStyle="Italic"
Text="Nothing to show"
Visibility="Collapsed" />
</StackPanel>
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SideContentVisibilityStates">
<VisualState x:Name="NothingToShowTextCollapsed" />
<VisualState x:Name="NothingToShowTextVisible">
<VisualState.Setters>
<Setter Target="PART_NothingToShowTextBlock.Visibility" Value="Visible" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>