|
22 | 22 | <ColumnDefinition Width="Auto" /> |
23 | 23 | <ColumnDefinition Width="Auto" /> |
24 | 24 | <ColumnDefinition Width="Auto" /> |
| 25 | + <ColumnDefinition Width="Auto" /> |
25 | 26 | <ColumnDefinition /> |
26 | 27 | </Grid.ColumnDefinitions> |
27 | 28 | <TextBlock Grid.ColumnSpan="3">Classic WPF DatePicker control with Material Design theme, and new TimePicker control:</TextBlock> |
|
66 | 67 | Style="{StaticResource MaterialDesignFloatingHintTimePicker}" |
67 | 68 | materialDesign:HintAssist.Hint="Custom hint" /> |
68 | 69 | </smtx:XamlDisplay> |
69 | | - <smtx:XamlDisplay Key="pickers_6_disabled" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="0 16 0 0" VerticalAlignment="Top"> |
| 70 | + <smtx:XamlDisplay Key="pickers_6_disabled" HorizontalAlignment="Left" Margin="0 16 0 0" VerticalAlignment="Top"> |
70 | 71 | <materialDesign:TimePicker Width="100" IsEnabled="False" |
71 | 72 | Style="{StaticResource MaterialDesignFloatingHintTimePicker}" |
72 | 73 | materialDesign:HintAssist.Hint="Disabled" /> |
|
76 | 77 | <smtx:XamlDisplay Key="pickers_7" Grid.Row="1" Grid.Column="2" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0 16 0 0"> |
77 | 78 | <materialDesign:TimePicker Is24Hours="True" x:Name="PresetTimePicker" Width="100" SelectedTimeChanged="PresetTimePicker_SelectedTimeChanged"/> |
78 | 79 | </smtx:XamlDisplay> |
79 | | - <smtx:XamlDisplay Key="pickers_8" Grid.Row="1" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0 16 0 0"> |
80 | | - <materialDesign:TimePicker |
81 | | - materialDesign:HintAssist.Hint="Validates" |
82 | | - IsInvalidTextAllowed="True" |
83 | | - Is24Hours="True" Width="100"> |
84 | | - <materialDesign:TimePicker.Text> |
85 | | - <Binding Path="ValidatingTime" UpdateSourceTrigger="PropertyChanged"> |
86 | | - <Binding.ValidationRules> |
87 | | - <domain:SimpleDateValidationRule ValidatesOnTargetUpdated="True" /> |
88 | | - </Binding.ValidationRules> |
89 | | - </Binding> |
90 | | - </materialDesign:TimePicker.Text> |
91 | | - </materialDesign:TimePicker> |
| 80 | + <StackPanel Grid.Row="1" Grid.Column="3" VerticalAlignment="Top" HorizontalAlignment="Left"> |
| 81 | + <smtx:XamlDisplay Key="pickers_8" Margin="0 16 0 0"> |
| 82 | + <materialDesign:TimePicker |
| 83 | + materialDesign:HintAssist.Hint="Validates" |
| 84 | + IsInvalidTextAllowed="True" |
| 85 | + Is24Hours="{Binding IsChecked, ElementName=Is24HourCheckbox}" |
| 86 | + Width="100"> |
| 87 | + <materialDesign:TimePicker.Text> |
| 88 | + <Binding Path="ValidatingTime" UpdateSourceTrigger="PropertyChanged"> |
| 89 | + <Binding.ValidationRules> |
| 90 | + <domain:SimpleDateValidationRule ValidatesOnTargetUpdated="True" /> |
| 91 | + </Binding.ValidationRules> |
| 92 | + </Binding> |
| 93 | + </materialDesign:TimePicker.Text> |
| 94 | + </materialDesign:TimePicker> |
| 95 | + </smtx:XamlDisplay> |
| 96 | + <CheckBox Content="Is 24 Hour" x:Name="Is24HourCheckbox" IsChecked="True" Margin="0,10,0,0" VerticalAlignment="Top"/> |
| 97 | + </StackPanel> |
| 98 | + <smtx:XamlDisplay Key="pickers_11" Grid.Row="1" Grid.Column="4" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0 16 0 0"> |
| 99 | + <materialDesign:TimePicker |
| 100 | + materialDesign:HintAssist.Hint="With Seconds" |
| 101 | + Is24Hours="{Binding IsChecked, ElementName=Is24HourCheckbox}" |
| 102 | + x:Name="WithSecondsTimePicker" |
| 103 | + WithSeconds="True" |
| 104 | + Width="100" /> |
92 | 105 | </smtx:XamlDisplay> |
93 | 106 |
|
94 | | - <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Margin="0 128 0 0">By combining the DialogHost (see MainWindow.xaml) and the Calendar and Clock controls, custom popups can be built.</TextBlock> |
| 107 | + <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" Margin="0 128 0 0">By combining the DialogHost (see MainWindow.xaml) and the Calendar and Clock controls, custom popups can be built.</TextBlock> |
95 | 108 | <smtx:XamlDisplay Key="pickers_9" Grid.Row="3" Grid.Column="0" Margin="0 32 0 0" HorizontalAlignment="Left"> |
96 | 109 | <StackPanel Orientation="Horizontal"> |
97 | 110 | <TextBlock Text="{Binding Date, StringFormat=d}" VerticalAlignment="Center" FontSize="24" /> |
|
128 | 141 | <RowDefinition Height="Auto" /> |
129 | 142 | <RowDefinition Height="Auto" /> |
130 | 143 | </Grid.RowDefinitions> |
131 | | - <materialDesign:Clock DisplayAutomation="Cycle" x:Name="Clock" /> |
| 144 | + <materialDesign:Clock DisplayAutomation="ToSeconds" x:Name="Clock" /> |
| 145 | + <StackPanel Grid.Row="1" Margin="8" HorizontalAlignment="Right" Orientation="Horizontal"> |
| 146 | + <Button Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="1" Style="{DynamicResource MaterialDesignFlatButton}">OK</Button> |
| 147 | + <Button Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="0" Style="{DynamicResource MaterialDesignFlatButton}">CANCEL</Button> |
| 148 | + </StackPanel> |
| 149 | + </Grid> |
| 150 | + </Button.CommandParameter> |
| 151 | + </Button> |
| 152 | + </StackPanel> |
| 153 | + </smtx:XamlDisplay> |
| 154 | + <smtx:XamlDisplay Key="pickers_12" Grid.Row="3" Grid.Column="2" Margin="0 32 0 0" HorizontalAlignment="Left"> |
| 155 | + <StackPanel Orientation="Horizontal"> |
| 156 | + <TextBlock Text="{Binding Date, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" VerticalAlignment="Center" FontSize="24" /> |
| 157 | + <Button Margin="8 0 0 0" Content="..." |
| 158 | + Command="{x:Static materialDesign:DialogHost.OpenDialogCommand}" |
| 159 | + materialDesign:DialogHost.DialogOpenedAttached="CombinedDialogOpenedEventHandler" |
| 160 | + materialDesign:DialogHost.DialogClosingAttached="CombinedDialogClosingEventHandler"> |
| 161 | + <Button.CommandParameter> |
| 162 | + <Grid Margin="-1"> |
| 163 | + <Grid.RowDefinitions> |
| 164 | + <RowDefinition Height="*" /> |
| 165 | + <RowDefinition Height="Auto" /> |
| 166 | + </Grid.RowDefinitions> |
| 167 | + <StackPanel Grid.Row="0" Orientation="Horizontal"> |
| 168 | + <Calendar |
| 169 | + x:Name="CombinedCalendar" |
| 170 | + Margin="-1 -4 -1 0" |
| 171 | + /> |
| 172 | + <materialDesign:Clock |
| 173 | + x:Name="CombinedClock" |
| 174 | + DisplayAutomation="CycleWithSeconds" |
| 175 | + Is24Hours="True" |
| 176 | + /> |
| 177 | + </StackPanel> |
132 | 178 | <StackPanel Grid.Row="1" Margin="8" HorizontalAlignment="Right" Orientation="Horizontal"> |
133 | 179 | <Button Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="1" Style="{DynamicResource MaterialDesignFlatButton}">OK</Button> |
134 | 180 | <Button Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" CommandParameter="0" Style="{DynamicResource MaterialDesignFlatButton}">CANCEL</Button> |
|
0 commit comments