|
102 | 102 |
|
103 | 103 | <!--#region SAMPLE 2--> |
104 | 104 | <TextBlock Grid.Column="1" Grid.Row="0" TextWrapping="Wrap" VerticalAlignment="Top" Margin="8 0 8 0">SAMPLE 2: Top level dialog, using OpenDialog, passing content via the Parameter. You can pass a view model, provided a corresponding DataTemplate can be found in the scope of the root DialogHost.</TextBlock> |
105 | | - <StackPanel Grid.Column="1" Grid.Row="1" VerticalAlignment="Center"> |
106 | | - <!--the request to open the dialog will bubble up to the top-most DialogHost, but we can used the attached property based event to handle the response --> |
107 | | - <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" |
108 | | - materialDesign:DialogHost.DialogClosingAttached="Sample2_DialogHost_OnDialogClosing" |
109 | | - Width="128"> |
110 | | - <Button.CommandParameter> |
111 | | - <StackPanel Margin="16"> |
112 | | - <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="16" IsIndeterminate="True" Value="0" /> |
113 | | - <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" |
114 | | - Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" |
115 | | - CommandParameter="Sample2Cancel" |
116 | | - HorizontalAlignment="Center">CANCEL</Button> |
117 | | - </StackPanel> |
118 | | - </Button.CommandParameter> |
119 | | - PASS VIEW |
120 | | - </Button> |
121 | | - <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" |
122 | | - Width="128" Margin="0 32 0 0"> |
123 | | - <Button.CommandParameter> |
124 | | - <!-- the simplest view model of all, a DateTime. the view can be found in the resources of MainWindow.xaml --> |
125 | | - <system:DateTime>1966-JUL-30</system:DateTime> |
126 | | - </Button.CommandParameter> |
127 | | - PASS MODEL |
128 | | - </Button> |
129 | | - </StackPanel> |
| 105 | + <smtx:XamlDisplay Grid.Column="1" Grid.Row="1" Key="dialogs_sample2"> |
| 106 | + <StackPanel VerticalAlignment="Center"> |
| 107 | + <!--the request to open the dialog will bubble up to the top-most DialogHost, but we can used the attached property based event to handle the response --> |
| 108 | + <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" |
| 109 | + materialDesign:DialogHost.DialogClosingAttached="Sample2_DialogHost_OnDialogClosing" |
| 110 | + Width="128"> |
| 111 | + <Button.CommandParameter> |
| 112 | + <StackPanel Margin="16"> |
| 113 | + <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="16" IsIndeterminate="True" Value="0" /> |
| 114 | + <Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" |
| 115 | + Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" |
| 116 | + CommandParameter="Sample2Cancel" |
| 117 | + HorizontalAlignment="Center">CANCEL</Button> |
| 118 | + </StackPanel> |
| 119 | + </Button.CommandParameter> |
| 120 | + PASS VIEW |
| 121 | + </Button> |
| 122 | + <Button Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" |
| 123 | + Width="128" Margin="0 32 0 0"> |
| 124 | + <Button.CommandParameter> |
| 125 | + <!-- the simplest view model of all, a DateTime. the view can be found in the resources of MainWindow.xaml --> |
| 126 | + <system:DateTime>1966-JUL-30</system:DateTime> |
| 127 | + </Button.CommandParameter> |
| 128 | + PASS MODEL |
| 129 | + </Button> |
| 130 | + </StackPanel> |
| 131 | + </smtx:XamlDisplay> |
130 | 132 | <!--#endregion--> |
131 | 133 |
|
132 | 134 | <!--#region SAMPLE 3--> |
133 | 135 | <TextBlock Grid.Column="2" Grid.Row="0" TextWrapping="Wrap" VerticalAlignment="Top" Margin="8 0 8 0">SAMPLE 3: Open and listen to the dialog entirely from code in a view model.</TextBlock> |
134 | 136 | <!-- Executes a command on DialogsViewModel.cs, which will launch the dialog from code --> |
135 | | - <StackPanel Grid.Column="2" Grid.Row="1" > |
136 | | - <Button Command="{Binding RunDialogCommand}" |
137 | | - Width="128"> |
138 | | - RUN CODE |
139 | | - </Button> |
140 | | - <Button Command="{Binding RunExtendedDialogCommand}" |
141 | | - Width="128" Margin="0 32 0 0"> |
142 | | - EXTENDED |
143 | | - </Button> |
144 | | - </StackPanel> |
| 137 | + <smtx:XamlDisplay Grid.Column="2" Grid.Row="1" Key="dialogs_sample3"> |
| 138 | + <StackPanel> |
| 139 | + <Button Command="{Binding RunDialogCommand}" |
| 140 | + Width="128"> |
| 141 | + RUN CODE |
| 142 | + </Button> |
| 143 | + <Button Command="{Binding RunExtendedDialogCommand}" |
| 144 | + Width="128" Margin="0 32 0 0"> |
| 145 | + EXTENDED |
| 146 | + </Button> |
| 147 | + </StackPanel> |
| 148 | + </smtx:XamlDisplay> |
145 | 149 | <!--#endregion--> |
146 | 150 |
|
147 | | - |
148 | 151 | <!--#region SAMPLE 4--> |
149 | 152 | <TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Top" |
150 | 153 | Grid.Column="3" Margin="8 0 8 0" |
|
0 commit comments