Skip to content

Commit 0109758

Browse files
authored
Merge pull request #3 from wongjiahau/smtx-minor-fix
Added some missing components for some demo pages
2 parents d5d7314 + a92f88b commit 0109758

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

MainDemo.Wpf/Dialogs.xaml

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -102,49 +102,52 @@
102102

103103
<!--#region SAMPLE 2-->
104104
<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>
130132
<!--#endregion-->
131133

132134
<!--#region SAMPLE 3-->
133135
<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>
134136
<!-- 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>
145149
<!--#endregion-->
146150

147-
148151
<!--#region SAMPLE 4-->
149152
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" VerticalAlignment="Top"
150153
Grid.Column="3" Margin="8 0 8 0"

MainDemo.Wpf/Pickers.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
d:DesignHeight="300" d:DesignWidth="300">
1111
<!-- for some reason to get the validation templates to show on this page need an extra decorator. haven't figure out why yet -->
1212
<AdornerDecorator>
13+
<ScrollViewer>
1314
<Grid Margin="32">
1415
<Grid.RowDefinitions>
1516
<RowDefinition Height="Auto" />
@@ -127,6 +128,7 @@
127128
</StackPanel>
128129
</smtx:XamlDisplay>
129130
</Grid>
131+
</ScrollViewer>
130132
</AdornerDecorator>
131133
</UserControl>
132134

0 commit comments

Comments
 (0)