Skip to content

Commit 2c9ef4e

Browse files
committed
add DrawerContainer
1 parent e7ec39f commit 2c9ef4e

File tree

5 files changed

+183
-84
lines changed

5 files changed

+183
-84
lines changed

src/Net_40/HandyControl_Net_40/Themes/Theme.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3568,6 +3568,7 @@
35683568
<Style x:Key="RepeatButtonIcon" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
35693569
<Setter Property="Background" Value="Transparent" />
35703570
<Setter Property="BorderBrush" Value="Transparent" />
3571+
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
35713572
<Setter Property="hc:BorderElement.CornerRadius" Value="0" />
35723573
<Setter Property="Template">
35733574
<Setter.Value>
@@ -3886,9 +3887,9 @@
38863887
<RowDefinition Height="*" />
38873888
</Grid.RowDefinitions>
38883889
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='1,1,0,0'}" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" Grid.ColumnSpan="3" />
3889-
<Button x:Name="PART_PreviousButton" Width="50" HorizontalAlignment="Left" Grid.Column="0" Height="50" Padding="16" Focusable="False" Grid.Row="0" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource LeftGeometry}" />
3890-
<Button x:Name="PART_HeaderButton" Focusable="False" Foreground="White" Grid.Column="1" FontSize="20" HorizontalAlignment="Center" Grid.Row="0" Style="{StaticResource ButtonCustom}" />
3891-
<Button x:Name="PART_NextButton" Width="50" HorizontalAlignment="Right" Height="50" Padding="16" Grid.Column="2" Focusable="False" Grid.Row="0" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource RightGeometry}" />
3890+
<Button x:Name="PART_PreviousButton" Width="50" Foreground="{DynamicResource TextIconBrush}" HorizontalAlignment="Left" Grid.Column="0" Height="50" Padding="16" Focusable="False" Grid.Row="0" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource LeftGeometry}" />
3891+
<Button x:Name="PART_HeaderButton" Focusable="False" Foreground="{DynamicResource TextIconBrush}" Grid.Column="1" FontSize="20" HorizontalAlignment="Center" Grid.Row="0" Style="{StaticResource ButtonCustom}" />
3892+
<Button x:Name="PART_NextButton" Width="50" Foreground="{DynamicResource TextIconBrush}" HorizontalAlignment="Right" Height="50" Padding="16" Grid.Column="2" Focusable="False" Grid.Row="0" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource RightGeometry}" />
38923893
<Grid Width="240" Height="240" x:Name="PART_MonthView" Margin="10" Grid.ColumnSpan="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Visibility="Visible">
38933894
<Grid.ColumnDefinitions>
38943895
<ColumnDefinition />

src/Shared/HandyControlDemo_Shared/UserControl/Controls/DrawerDemoCtl.xaml

Lines changed: 128 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,73 +2,140 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:hc="https://handyorg.github.io/handycontrol"
5-
Background="{DynamicResource RegionBrush}">
5+
Background="{DynamicResource RegionBrush}"
6+
Height="400"
7+
Margin="32">
68
<hc:TransitioningContentControl>
7-
<hc:SimplePanel Margin="22">
8-
<hc:Drawer Name="DrawerLeft" Dock="Left" ShowMode="Push">
9-
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
10-
<Grid>
9+
<Border Style="{StaticResource BorderClip}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Padding="0">
10+
<hc:SimplePanel>
11+
<hc:Drawer Name="DrawerLeft" Dock="Left" ShowMode="Push">
12+
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
13+
<Grid>
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="Auto"/>
16+
<RowDefinition/>
17+
</Grid.RowDefinitions>
18+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
19+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
20+
</Grid>
21+
</Border>
22+
</hc:Drawer>
23+
<hc:Drawer Name="DrawerTop" Dock="Top" ShowMode="Press">
24+
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
25+
<Grid>
26+
<Grid.RowDefinitions>
27+
<RowDefinition Height="Auto"/>
28+
<RowDefinition/>
29+
</Grid.RowDefinitions>
30+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
31+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
32+
</Grid>
33+
</Border>
34+
</hc:Drawer>
35+
<hc:Drawer Name="DrawerRight" MaskCanClose="False">
36+
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
37+
<Grid>
38+
<Grid.RowDefinitions>
39+
<RowDefinition Height="Auto"/>
40+
<RowDefinition/>
41+
</Grid.RowDefinitions>
42+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
43+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
44+
</Grid>
45+
</Border>
46+
</hc:Drawer>
47+
<hc:Drawer Name="DrawerBottom" Dock="Bottom" ShowMask="False">
48+
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
49+
<Grid>
50+
<Grid.RowDefinitions>
51+
<RowDefinition Height="Auto"/>
52+
<RowDefinition/>
53+
</Grid.RowDefinitions>
54+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
55+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
56+
</Grid>
57+
</Border>
58+
</hc:Drawer>
59+
<hc:DrawerContainer>
60+
<Grid VerticalAlignment="Center">
1161
<Grid.RowDefinitions>
12-
<RowDefinition Height="Auto"/>
1362
<RowDefinition/>
14-
</Grid.RowDefinitions>
15-
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
16-
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
17-
</Grid>
18-
</Border>
19-
</hc:Drawer>
20-
<hc:Drawer Name="DrawerTop" Dock="Top" ShowMode="Press">
21-
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
22-
<Grid>
23-
<Grid.RowDefinitions>
24-
<RowDefinition Height="Auto"/>
25-
<RowDefinition/>
26-
</Grid.RowDefinitions>
27-
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
28-
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
29-
</Grid>
30-
</Border>
31-
</hc:Drawer>
32-
<hc:Drawer Name="DrawerRight" MaskCanClose="False">
33-
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
34-
<Grid>
35-
<Grid.RowDefinitions>
36-
<RowDefinition Height="Auto"/>
3763
<RowDefinition/>
38-
</Grid.RowDefinitions>
39-
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
40-
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
41-
</Grid>
42-
</Border>
43-
</hc:Drawer>
44-
<hc:Drawer Name="DrawerBottom" Dock="Bottom" ShowMask="False">
45-
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
46-
<Grid>
47-
<Grid.RowDefinitions>
48-
<RowDefinition Height="Auto"/>
4964
<RowDefinition/>
5065
</Grid.RowDefinitions>
51-
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
52-
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
66+
<Grid.ColumnDefinitions>
67+
<ColumnDefinition/>
68+
<ColumnDefinition/>
69+
<ColumnDefinition/>
70+
</Grid.ColumnDefinitions>
71+
<hc:Drawer Name="DrawerLeftInContainer" Dock="Left" ShowMode="Push">
72+
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderBrush="{DynamicResource BorderBrush}">
73+
<Grid>
74+
<Grid.RowDefinitions>
75+
<RowDefinition Height="Auto"/>
76+
<RowDefinition/>
77+
</Grid.RowDefinitions>
78+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
79+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
80+
</Grid>
81+
</Border>
82+
</hc:Drawer>
83+
<hc:Drawer Name="DrawerTopInContainer" Dock="Top" ShowMode="Press">
84+
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderBrush="{DynamicResource BorderBrush}">
85+
<Grid>
86+
<Grid.RowDefinitions>
87+
<RowDefinition Height="Auto"/>
88+
<RowDefinition/>
89+
</Grid.RowDefinitions>
90+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
91+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
92+
</Grid>
93+
</Border>
94+
</hc:Drawer>
95+
<hc:Drawer Name="DrawerRightInContainer" MaskCanClose="False">
96+
<Border Background="{DynamicResource RegionBrush}" Width="300" BorderBrush="{DynamicResource BorderBrush}">
97+
<Grid>
98+
<Grid.RowDefinitions>
99+
<RowDefinition Height="Auto"/>
100+
<RowDefinition/>
101+
</Grid.RowDefinitions>
102+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
103+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
104+
</Grid>
105+
</Border>
106+
</hc:Drawer>
107+
<hc:Drawer Name="DrawerBottomInContainer" Dock="Bottom" ShowMask="False">
108+
<Border Background="{DynamicResource RegionBrush}" Height="300" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource BorderBrush}">
109+
<Grid>
110+
<Grid.RowDefinitions>
111+
<RowDefinition Height="Auto"/>
112+
<RowDefinition/>
113+
</Grid.RowDefinitions>
114+
<TextBlock Margin="10,0,0,0" Text="Header" Style="{StaticResource TextBlockTitle}" HorizontalAlignment="Left"/>
115+
<Button Command="hc:ControlCommands.Close" Grid.Row="0" HorizontalAlignment="Right" Foreground="{DynamicResource PrimaryTextBrush}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}"/>
116+
</Grid>
117+
</Border>
118+
</hc:Drawer>
119+
120+
<hc:ButtonGroup Margin="10" Grid.Row="1" Grid.Column="0">
121+
<ToggleButton Content="Left-Window" IsChecked="{Binding IsOpen,ElementName=DrawerLeft}"/>
122+
<ToggleButton Content="Left-Container" IsChecked="{Binding IsOpen,ElementName=DrawerLeftInContainer}"/>
123+
</hc:ButtonGroup>
124+
<hc:ButtonGroup Margin="10" Grid.Row="0" Grid.Column="1">
125+
<ToggleButton Content="Top-Windows" IsChecked="{Binding IsOpen,ElementName=DrawerTop}"/>
126+
<ToggleButton Content="Top-Container" IsChecked="{Binding IsOpen,ElementName=DrawerTopInContainer}"/>
127+
</hc:ButtonGroup>
128+
<hc:ButtonGroup Margin="10" Grid.Row="1" Grid.Column="2">
129+
<ToggleButton Content="Right-Windows" IsChecked="{Binding IsOpen,ElementName=DrawerRight}"/>
130+
<ToggleButton Content="Right-Container" IsChecked="{Binding IsOpen,ElementName=DrawerRightInContainer}"/>
131+
</hc:ButtonGroup>
132+
<hc:ButtonGroup Margin="10" Grid.Row="2" Grid.Column="1">
133+
<ToggleButton Content="Bottom-Windows" IsChecked="{Binding IsOpen,ElementName=DrawerBottom}"/>
134+
<ToggleButton Content="Bottom-Container" IsChecked="{Binding IsOpen,ElementName=DrawerBottomInContainer}"/>
135+
</hc:ButtonGroup>
53136
</Grid>
54-
</Border>
55-
</hc:Drawer>
56-
<Grid>
57-
<Grid.RowDefinitions>
58-
<RowDefinition/>
59-
<RowDefinition/>
60-
<RowDefinition/>
61-
</Grid.RowDefinitions>
62-
<Grid.ColumnDefinitions>
63-
<ColumnDefinition/>
64-
<ColumnDefinition/>
65-
<ColumnDefinition/>
66-
</Grid.ColumnDefinitions>
67-
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" Content="Left" IsChecked="{Binding IsOpen,ElementName=DrawerLeft}"/>
68-
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="1" Content="Top" IsChecked="{Binding IsOpen,ElementName=DrawerTop}"/>
69-
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="2" Content="Right" IsChecked="{Binding IsOpen,ElementName=DrawerRight}"/>
70-
<ToggleButton Margin="10" HorizontalAlignment="Stretch" Grid.Row="2" Grid.Column="1" Content="Bottom" IsChecked="{Binding IsOpen,ElementName=DrawerBottom}"/>
71-
</Grid>
72-
</hc:SimplePanel>
137+
</hc:DrawerContainer>
138+
</hc:SimplePanel>
139+
</Border>
73140
</hc:TransitioningContentControl>
74141
</UserControl>

0 commit comments

Comments
 (0)