DateTimePickerPage.xaml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="ControlCatalog.Pages.DateTimePickerPage">
  7. <StackPanel Orientation="Vertical" Spacing="4" HorizontalAlignment="Stretch">
  8. <TextBlock Classes="h1">DatePicker and TimePicker</TextBlock>
  9. <TextBlock Name="DatePickerDesc" Classes="h2" TextWrapping="Wrap"/>
  10. <TextBlock Name="TimePickerDesc" Classes="h2" TextWrapping="Wrap"/>
  11. <StackPanel Orientation="Vertical"
  12. Margin="16"
  13. HorizontalAlignment="Stretch"
  14. Spacing="16">
  15. <TextBlock FontSize="18">A simple DatePicker with a header</TextBlock>
  16. <StackPanel Orientation="Vertical">
  17. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  18. BorderThickness="1" Padding="15">
  19. <DatePicker Header="Pick a date" />
  20. </Border>
  21. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  22. <TextBlock Padding="15">
  23. <TextBlock.Text>
  24. <x:String>
  25. &lt;DatePicker Header="Pick a date" /&gt;
  26. </x:String>
  27. </TextBlock.Text>
  28. </TextBlock>
  29. </Panel>
  30. </StackPanel>
  31. <TextBlock FontSize="18">A DatePicker with day formatted and year hidden.</TextBlock>
  32. <StackPanel Orientation="Vertical">
  33. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  34. BorderThickness="1" Padding="15">
  35. <DatePicker x:Name="Control2" DayFormat="d (ddd)"
  36. YearVisible="False" />
  37. </Border>
  38. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  39. <TextBlock Padding="15">
  40. <TextBlock.Text>
  41. <x:String>
  42. &lt;DatePicker DayFormat="d (ddd)" YearVisible="False" /&gt;
  43. </x:String>
  44. </TextBlock.Text>
  45. </TextBlock>
  46. </Panel>
  47. </StackPanel>
  48. <Border Background="{DynamicResource SystemControlHighlightBaseLowBrush}" BorderThickness="1" Margin="15" />
  49. <TextBlock FontSize="18">A simple TimePicker.</TextBlock>
  50. <StackPanel Orientation="Vertical">
  51. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  52. BorderThickness="1" Padding="15">
  53. <TimePicker />
  54. </Border>
  55. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  56. <TextBlock Padding="15">
  57. <TextBlock.Text>
  58. <x:String>
  59. &lt;TimePicker /&gt;
  60. </x:String>
  61. </TextBlock.Text>
  62. </TextBlock>
  63. </Panel>
  64. </StackPanel>
  65. <TextBlock FontSize="18">A TimePicker with a header and minute increments specified.</TextBlock>
  66. <StackPanel Orientation="Vertical">
  67. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  68. BorderThickness="1" Padding="15">
  69. <TimePicker Header="Arrival time" MinuteIncrement="15" />
  70. </Border>
  71. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  72. <TextBlock Padding="15">
  73. <TextBlock.Text>
  74. <x:String>
  75. &lt;TimePicker Header="Arrival time" MinuteIncrement="15" /&gt;
  76. </x:String>
  77. </TextBlock.Text>
  78. </TextBlock>
  79. </Panel>
  80. </StackPanel>
  81. <TextBlock FontSize="18">A TimePicker using a 12-hour clock.</TextBlock>
  82. <StackPanel Orientation="Vertical">
  83. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  84. BorderThickness="1" Padding="15">
  85. <TimePicker ClockIdentifier="12HourClock" Header="12 hour clock" />
  86. </Border>
  87. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  88. <TextBlock Padding="15">
  89. <TextBlock.Text>
  90. <x:String>
  91. &lt;TimePicker ClockIdentifier="12HourClock" Header="12 hour clock" /&gt;
  92. </x:String>
  93. </TextBlock.Text>
  94. </TextBlock>
  95. </Panel>
  96. </StackPanel>
  97. <TextBlock FontSize="18">A TimePicker using a 24-hour clock.</TextBlock>
  98. <StackPanel Orientation="Vertical">
  99. <Border BorderBrush="{DynamicResource SystemControlHighlightBaseLowBrush}"
  100. BorderThickness="1" Padding="15">
  101. <TimePicker ClockIdentifier="24HourClock" Header="24 hour clock" />
  102. </Border>
  103. <Panel Background="{DynamicResource SystemControlBackgroundBaseLowBrush}">
  104. <TextBlock Padding="15">
  105. <TextBlock.Text>
  106. <x:String>
  107. &lt;TimePicker ClockIdentifier="24HourClock" Header="24 hour clock" /&gt;
  108. </x:String>
  109. </TextBlock.Text>
  110. </TextBlock>
  111. </Panel>
  112. </StackPanel>
  113. </StackPanel>
  114. </StackPanel>
  115. </UserControl>