|
24 | 24 | </ResourceDictionary.MergedDictionaries>
|
25 | 25 |
|
26 | 26 |
|
27 |
| - |
| 27 | + |
28 | 28 | <Style TargetType="{x:Type provingGroundStuff:MeasuringTextBox}" BasedOn="{StaticResource MaterialDesignTextBox}" />
|
29 | 29 |
|
30 | 30 |
|
|
33 | 33 | </UserControl.Resources>
|
34 | 34 |
|
35 | 35 | <Grid HorizontalAlignment="Left">
|
36 |
| - <Grid.RowDefinitions> |
37 |
| - <RowDefinition /> |
38 |
| - <RowDefinition /> |
39 |
| - </Grid.RowDefinitions> |
40 | 36 | <Grid.ColumnDefinitions>
|
41 | 37 | <ColumnDefinition />
|
42 | 38 | <ColumnDefinition />
|
43 | 39 | <ColumnDefinition />
|
44 | 40 | <ColumnDefinition />
|
45 | 41 | </Grid.ColumnDefinitions>
|
46 |
| - |
| 42 | + <Grid.RowDefinitions> |
| 43 | + <RowDefinition /> |
| 44 | + <RowDefinition /> |
| 45 | + </Grid.RowDefinitions> |
| 46 | + |
47 | 47 | <!-- example 1 -->
|
48 |
| - <!-- simplest form --> |
49 |
| - <materialDesign:Snackbar2 Message="hello 1" |
50 |
| - IsActive="False" |
51 |
| - x:Name="SnackbarOne" /> |
52 |
| - |
53 |
| - <ToggleButton IsChecked="{Binding ElementName=SnackbarOne, Path=IsActive, Mode=TwoWay}" |
54 |
| - Grid.Row="1" Grid.Column="0" /> |
| 48 | + <Border Background="{DynamicResource MaterialDesignSelection}" Grid.RowSpan="2" |
| 49 | + Padding="8 0 8 0"> |
| 50 | + <Grid> |
| 51 | + <ToggleButton IsChecked="{Binding ElementName=SnackbarOne, Path=IsActive, Mode=TwoWay}" /> |
55 | 52 |
|
56 |
| - <!-- example 2 --> |
57 |
| - <!-- long hand form for setting the message --> |
58 |
| - <materialDesign:Snackbar2 IsActive="True" |
59 |
| - Grid.Row="0" |
60 |
| - Grid.Column="1" |
61 |
| - x:Name="SnackbarTwo" > |
62 |
| - <materialDesign:SnackbarMessage Content="Hello 2" ActionContent="UNDO" /> |
63 |
| - </materialDesign:Snackbar2> |
64 |
| - |
65 |
| - <ToggleButton IsChecked="{Binding ElementName=SnackbarTwo, Path=IsActive, Mode=TwoWay}" |
66 |
| - Grid.Row="1" Grid.Column="1" /> |
| 53 | + <!-- simplest form --> |
| 54 | + <materialDesign:Snackbar2 Message="hello 1" |
| 55 | + IsActive="False" |
| 56 | + x:Name="SnackbarOne" /> |
| 57 | + </Grid> |
| 58 | + </Border> |
67 | 59 |
|
| 60 | + <!-- example 2 --> |
| 61 | + <Border Background="{DynamicResource MaterialDesignPaper}" |
| 62 | + Padding="8 0 8 0" |
| 63 | + Grid.Column="1"> |
| 64 | + <Grid> |
| 65 | + <ToggleButton IsChecked="{Binding ElementName=SnackbarTwo, Path=IsActive, Mode=TwoWay}" /> |
| 66 | + <!-- long hand form for setting the message --> |
| 67 | + <materialDesign:Snackbar2 IsActive="False" |
| 68 | + x:Name="SnackbarTwo" > |
| 69 | + <materialDesign:SnackbarMessage Content="Hello 2" ActionContent="UNDO" /> |
| 70 | + </materialDesign:Snackbar2> |
| 71 | + </Grid> |
| 72 | + </Border> |
68 | 73 |
|
69 |
| - <!-- example 3 --> |
70 |
| - <!-- |
| 74 | + <!-- example 3 --> |
| 75 | + <!-- |
71 | 76 | * using a message queue to manage queuing of messages, and getting onto correct thread
|
72 | 77 | * notice the shorthand syntax {materialDesign:MessageQueue} for creating a new message
|
73 | 78 | queue without expanded XAML. useful in code-behind scenarios if you dont want to bind
|
74 | 79 | a message queue in to the snackbar.
|
75 | 80 | -->
|
76 |
| - <materialDesign:Snackbar2 MessageQueue="{materialDesign:MessageQueue}" |
77 |
| - Grid.Row="0" |
78 |
| - Grid.Column="2" |
79 |
| - x:Name="SnackbarThree" /> |
80 |
| - |
81 |
| - <StackPanel Orientation="Horizontal" |
82 |
| - Grid.Row="1" |
83 |
| - Grid.Column="2"> |
84 |
| - <TextBlock HorizontalAlignment="Center">Message: </TextBlock> |
85 |
| - <TextBox x:Name="MessageTextBox" HorizontalAlignment="Center">Hello World</TextBox> |
86 |
| - <Button Click="SnackBar3_OnClick" HorizontalAlignment="Center">Send</Button> |
87 |
| - </StackPanel> |
| 81 | + <Border Background="{DynamicResource MaterialDesignSelection}" |
| 82 | + Padding="8 0 8 0" |
| 83 | + Grid.Column="2"> |
| 84 | + <Grid> |
| 85 | + <StackPanel Orientation="Horizontal"> |
| 86 | + <TextBlock HorizontalAlignment="Center">Message:</TextBlock> |
| 87 | + <TextBox x:Name="MessageTextBox" HorizontalAlignment="Center">Hello World</TextBox> |
| 88 | + <Button Click="SnackBar3_OnClick" HorizontalAlignment="Center">Send</Button> |
| 89 | + </StackPanel> |
| 90 | + <materialDesign:Snackbar2 MessageQueue="{materialDesign:MessageQueue}" |
| 91 | + x:Name="SnackbarThree" /> |
| 92 | + </Grid> |
| 93 | + </Border> |
88 | 94 |
|
89 | 95 | <!-- example 4 -->
|
90 |
| - <!-- uses some action command call backs --> |
91 |
| - <materialDesign:Snackbar2 MessageQueue="{materialDesign:MessageQueue}" |
92 |
| - Grid.Row="0" |
93 |
| - Grid.Column="3" |
94 |
| - x:Name="SnackbarFour" /> |
95 |
| - |
96 |
| - <Button Click="SnackBar4_OnClick" HorizontalAlignment="Center" |
97 |
| - Grid.Row="1" Grid.Column="3" |
98 |
| - >Send</Button> |
| 96 | + <!-- uses some action command call backs --> |
| 97 | + <Border Background="{DynamicResource MaterialDesignPaper}" |
| 98 | + Padding="8 0 8 0" |
| 99 | + Grid.Column="3"> |
| 100 | + <Grid> |
| 101 | + <materialDesign:Snackbar2 MessageQueue="{materialDesign:MessageQueue}" |
| 102 | + x:Name="SnackbarFour" /> |
| 103 | + <Button Click="SnackBar4_OnClick" HorizontalAlignment="Center">Send</Button> |
| 104 | + </Grid> |
| 105 | + </Border> |
99 | 106 |
|
| 107 | + <Border Background="{DynamicResource MaterialDesignSelection}" |
| 108 | + Grid.ColumnSpan="4" |
| 109 | + Grid.Row="1"> |
| 110 | + <StackPanel VerticalAlignment="Bottom"> |
| 111 | + <ToggleButton IsChecked="{Binding ElementName=SnackbarFive, Path=IsActive, Mode=TwoWay}" |
| 112 | + Margin="0 0 0 24"/> |
| 113 | + <materialDesign:Snackbar2 HorizontalAlignment="Stretch" |
| 114 | + x:Name="SnackbarFive"> |
| 115 | + <materialDesign:SnackbarMessage Content="This Snackbar is stretched horizontally. You should ensure your content is pushed up." |
| 116 | + ActionContent="OK" /> |
| 117 | + </materialDesign:Snackbar2> |
| 118 | + </StackPanel> |
| 119 | + </Border> |
100 | 120 |
|
101 | 121 | </Grid>
|
102 | 122 |
|
|
0 commit comments