|
| 1 | +<UserControl |
| 2 | + x:Class="WPFDevelopers.Samples.ExampleViews.DrawerExample" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers" |
| 10 | + d:DesignHeight="450" |
| 11 | + d:DesignWidth="800" |
| 12 | + mc:Ignorable="d"> |
| 13 | + <controls:CodeViewer> |
| 14 | + <Grid> |
| 15 | + <Grid.ColumnDefinitions> |
| 16 | + <ColumnDefinition /> |
| 17 | + <ColumnDefinition /> |
| 18 | + </Grid.ColumnDefinitions> |
| 19 | + <Grid.RowDefinitions> |
| 20 | + <RowDefinition /> |
| 21 | + <RowDefinition /> |
| 22 | + </Grid.RowDefinitions> |
| 23 | + <wd:Drawer |
| 24 | + x:Name="MyDrawerTop" |
| 25 | + Margin="2" |
| 26 | + Position="Top"> |
| 27 | + <wd:Drawer.Header> |
| 28 | + <Grid Height="120"> |
| 29 | + <StackPanel HorizontalAlignment="Center"> |
| 30 | + <TextBlock FontSize="18" Text="Drawer" /> |
| 31 | + <Button HorizontalAlignment="Center" Content="contents..." /> |
| 32 | + </StackPanel> |
| 33 | + </Grid> |
| 34 | + </wd:Drawer.Header> |
| 35 | + <wd:Drawer.Content> |
| 36 | + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom"> |
| 37 | + <TextBlock Text="抽屉从顶部置滑出,点击遮罩区关闭。" /> |
| 38 | + <Button |
| 39 | + Margin="0,10" |
| 40 | + HorizontalAlignment="Center" |
| 41 | + Click="ButtonTop_Click" |
| 42 | + Content="Open" |
| 43 | + Style="{StaticResource WD.PrimaryButton}" /> |
| 44 | + </StackPanel> |
| 45 | + </wd:Drawer.Content> |
| 46 | + </wd:Drawer> |
| 47 | + <wd:Drawer |
| 48 | + x:Name="MyDrawerBottom" |
| 49 | + Grid.Column="1" |
| 50 | + Margin="2" |
| 51 | + wd:ElementHelper.CornerRadius="3" |
| 52 | + Position="Bottom"> |
| 53 | + <wd:Drawer.Header> |
| 54 | + <Grid Height="130"> |
| 55 | + <StackPanel HorizontalAlignment="Center"> |
| 56 | + <TextBlock FontSize="18" Text="Drawer" /> |
| 57 | + <Button |
| 58 | + HorizontalAlignment="Center" |
| 59 | + wd:ElementHelper.CornerRadius="3" |
| 60 | + Content="contents..." |
| 61 | + Style="{StaticResource WD.DangerDefaultButton}" /> |
| 62 | + </StackPanel> |
| 63 | + </Grid> |
| 64 | + </wd:Drawer.Header> |
| 65 | + <wd:Drawer.Content> |
| 66 | + <StackPanel HorizontalAlignment="Center"> |
| 67 | + <TextBlock Text="抽屉从底部滑出,点击遮罩区关闭。" /> |
| 68 | + <Button |
| 69 | + Margin="0,10" |
| 70 | + HorizontalAlignment="Center" |
| 71 | + wd:ElementHelper.CornerRadius="3" |
| 72 | + Click="ButtonBottom_Click" |
| 73 | + Content="Open" |
| 74 | + Style="{StaticResource WD.DangerPrimaryButton}" /> |
| 75 | + </StackPanel> |
| 76 | + </wd:Drawer.Content> |
| 77 | + </wd:Drawer> |
| 78 | + |
| 79 | + <wd:Drawer |
| 80 | + x:Name="MyDrawerLeft" |
| 81 | + Grid.Row="1" |
| 82 | + Margin="2" |
| 83 | + wd:ElementHelper.CornerRadius="3" |
| 84 | + Position="Left"> |
| 85 | + <wd:Drawer.Header> |
| 86 | + <Grid Width="140" Background="HotPink"> |
| 87 | + <StackPanel> |
| 88 | + <TextBlock |
| 89 | + HorizontalAlignment="Center" |
| 90 | + FontSize="18" |
| 91 | + Text="Drawer" /> |
| 92 | + <Button |
| 93 | + HorizontalAlignment="Center" |
| 94 | + wd:ElementHelper.CornerRadius="3" |
| 95 | + Content="contents..." |
| 96 | + Style="{StaticResource WD.SuccessDefaultButton}" /> |
| 97 | + </StackPanel> |
| 98 | + </Grid> |
| 99 | + </wd:Drawer.Header> |
| 100 | + <wd:Drawer.Content> |
| 101 | + <StackPanel HorizontalAlignment="Center"> |
| 102 | + <TextBlock Text="抽屉从左侧滑出,点击遮罩区关闭。" /> |
| 103 | + <Button |
| 104 | + Margin="0,10" |
| 105 | + HorizontalAlignment="Center" |
| 106 | + wd:ElementHelper.CornerRadius="3" |
| 107 | + Click="ButtonLeft_Click" |
| 108 | + Content="Open" |
| 109 | + Style="{StaticResource WD.SuccessPrimaryButton}" /> |
| 110 | + </StackPanel> |
| 111 | + </wd:Drawer.Content> |
| 112 | + </wd:Drawer> |
| 113 | + <wd:Drawer |
| 114 | + x:Name="MyDrawerRight" |
| 115 | + Grid.Row="1" |
| 116 | + Grid.Column="1" |
| 117 | + Margin="2" |
| 118 | + Position="Right"> |
| 119 | + <wd:Drawer.Header> |
| 120 | + <Grid Width="100"> |
| 121 | + <StackPanel HorizontalAlignment="Center"> |
| 122 | + <TextBlock |
| 123 | + HorizontalAlignment="Center" |
| 124 | + FontSize="18" |
| 125 | + Text="Drawer" /> |
| 126 | + <Button |
| 127 | + HorizontalAlignment="Center" |
| 128 | + Content="contents..." |
| 129 | + Style="{StaticResource WD.WarningDefaultButton}" /> |
| 130 | + </StackPanel> |
| 131 | + </Grid> |
| 132 | + </wd:Drawer.Header> |
| 133 | + <wd:Drawer.Content> |
| 134 | + <StackPanel HorizontalAlignment="Center"> |
| 135 | + <TextBlock Text="抽屉从右侧滑出,点击遮罩区关闭。" /> |
| 136 | + <Button |
| 137 | + Margin="0,10" |
| 138 | + HorizontalAlignment="Center" |
| 139 | + Click="ButtonRight_Click" |
| 140 | + Content="Open" |
| 141 | + Style="{StaticResource WD.WarningPrimaryButton}" /> |
| 142 | + </StackPanel> |
| 143 | + </wd:Drawer.Content> |
| 144 | + </wd:Drawer> |
| 145 | + </Grid> |
| 146 | + <controls:CodeViewer.SourceCodes> |
| 147 | + <controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/DrawerExample.xaml" CodeType="Xaml" /> |
| 148 | + <controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/DrawerExample.xaml.cs" CodeType="CSharp" /> |
| 149 | + </controls:CodeViewer.SourceCodes> |
| 150 | + </controls:CodeViewer> |
| 151 | +</UserControl> |
0 commit comments