Repository navigation
Expand file tree
/
Copy pathDateTimePickerExample.xaml
More file actions
30 lines (30 loc) · 1.68 KB
/
Copy pathDateTimePickerExample.xaml
File metadata and controls
30 lines (30 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<UserControl
x:Class="WPFDevelopers.Samples.ExampleViews.Basics.DateTimePickerExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
Background="{DynamicResource WD.BackgroundBrush}">
<controls:CodeViewer Header="DateTimePicker">
<StackPanel Margin="20,10">
<TextBlock Margin="0,20,0,0" FontSize="20" Text="DateTimePicker" />
<UniformGrid Margin="0,10" Rows="1">
<StackPanel Orientation="Horizontal">
<DatePicker wd:DatePickerHelper.SelectedDateTime="{Binding CurrentDateTime, RelativeSource={RelativeSource AncestorType=UserControl}}" wd:DatePickerHelper.ShowTime="True" />
<Button
Margin="4,0"
Click="BtnGetDateTime_Click"
Content="DateTime" />
</StackPanel>
<DatePicker
Margin="10,0"
wd:DatePickerHelper.SelectedDateTime="2025-11-12 15:20:00"
wd:DatePickerHelper.ShowTime="True" />
<DatePicker wd:DatePickerHelper.ShowTime="True" wd:DatePickerHelper.Watermark="日期 yyyy-MM-dd HH:mm:ss" />
</UniformGrid>
</StackPanel>
<controls:CodeViewer.SourceCodes>
<controls:SourceCodeModel CodeSource="/WPFDevelopers.SamplesCode;component/ExampleViews/Basics/DateTimePickerExample.xaml" CodeType="Xaml" />
</controls:CodeViewer.SourceCodes>
</controls:CodeViewer>
</UserControl>