DateTimePickerPage.xaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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. xmlns:sys="using:System"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="ControlCatalog.Pages.DateTimePickerPage">
  8. <StackPanel Orientation="Vertical" Spacing="4" HorizontalAlignment="Stretch">
  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</TextBlock>
  16. <StackPanel Orientation="Vertical">
  17. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  18. BorderThickness="1" Padding="15">
  19. <DatePicker />
  20. </Border>
  21. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  22. <TextBlock Padding="15">
  23. <TextBlock.Text>
  24. <x:String>
  25. &lt;DatePicker/&gt;
  26. </x:String>
  27. </TextBlock.Text>
  28. </TextBlock>
  29. </Panel>
  30. </StackPanel>
  31. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  32. BorderThickness="1" Padding="15">
  33. <DatePicker >
  34. <DataValidationErrors.Error>
  35. <sys:Exception />
  36. </DataValidationErrors.Error>
  37. </DatePicker>
  38. </Border>
  39. <TextBlock FontSize="18">A DatePicker with day formatted and year hidden.</TextBlock>
  40. <StackPanel Orientation="Vertical">
  41. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  42. BorderThickness="1" Padding="15">
  43. <DatePicker x:Name="Control2" DayFormat="d (ddd)"
  44. YearVisible="False" />
  45. </Border>
  46. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  47. <TextBlock Padding="15">
  48. <TextBlock.Text>
  49. <x:String>
  50. &lt;DatePicker DayFormat="d (ddd)" YearVisible="False" /&gt;
  51. </x:String>
  52. </TextBlock.Text>
  53. </TextBlock>
  54. </Panel>
  55. </StackPanel>
  56. <Border Background="{DynamicResource CatalogBaseLowColor}" BorderThickness="1" Margin="15" />
  57. <TextBlock FontSize="18">A simple TimePicker.</TextBlock>
  58. <StackPanel Orientation="Vertical">
  59. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  60. BorderThickness="1" Padding="15">
  61. <TimePicker />
  62. </Border>
  63. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  64. <TextBlock Padding="15">
  65. <TextBlock.Text>
  66. <x:String>
  67. &lt;TimePicker /&gt;
  68. </x:String>
  69. </TextBlock.Text>
  70. </TextBlock>
  71. </Panel>
  72. </StackPanel>
  73. <TextBlock FontSize="18">A TimePicker with seconds enabled.</TextBlock>
  74. <StackPanel Orientation="Vertical">
  75. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  76. BorderThickness="1" Padding="15">
  77. <TimePicker UseSeconds="True" />
  78. </Border>
  79. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  80. <TextBlock Padding="15">
  81. <TextBlock.Text>
  82. <x:String>
  83. &lt;TimePicker UseSeconds="True" /&gt;
  84. </x:String>
  85. </TextBlock.Text>
  86. </TextBlock>
  87. </Panel>
  88. </StackPanel>
  89. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  90. BorderThickness="1" Padding="15">
  91. <TimePicker>
  92. <DataValidationErrors.Error>
  93. <sys:Exception />
  94. </DataValidationErrors.Error>
  95. </TimePicker>
  96. </Border>
  97. <TextBlock FontSize="18">A TimePicker with minute increment specified.</TextBlock>
  98. <StackPanel Orientation="Vertical">
  99. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  100. BorderThickness="1" Padding="15">
  101. <TimePicker MinuteIncrement="15" />
  102. </Border>
  103. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  104. <TextBlock Padding="15">
  105. <TextBlock.Text>
  106. <x:String>
  107. &lt;TimePicker MinuteIncrement="15" SecondIncrement="30" /&gt;
  108. </x:String>
  109. </TextBlock.Text>
  110. </TextBlock>
  111. </Panel>
  112. </StackPanel>
  113. <TextBlock FontSize="18">A TimePicker with seconds enabled and minute &amp; second increments specified.</TextBlock>
  114. <StackPanel Orientation="Vertical">
  115. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  116. BorderThickness="1" Padding="15">
  117. <TimePicker UseSeconds="True" MinuteIncrement="15" SecondIncrement="30" />
  118. </Border>
  119. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  120. <TextBlock Padding="15">
  121. <TextBlock.Text>
  122. <x:String>
  123. &lt;TimePicker UseSeconds="True" MinuteIncrement="15" SecondIncrement="30" /&gt;
  124. </x:String>
  125. </TextBlock.Text>
  126. </TextBlock>
  127. </Panel>
  128. </StackPanel>
  129. <TextBlock FontSize="18">A TimePicker using a 12-hour clock.</TextBlock>
  130. <StackPanel Orientation="Vertical">
  131. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  132. BorderThickness="1" Padding="15">
  133. <TimePicker ClockIdentifier="12HourClock"/>
  134. </Border>
  135. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  136. <TextBlock Padding="15">
  137. <TextBlock.Text>
  138. <x:String>
  139. &lt;TimePicker ClockIdentifier="12HourClock" /&gt;
  140. </x:String>
  141. </TextBlock.Text>
  142. </TextBlock>
  143. </Panel>
  144. </StackPanel>
  145. <TextBlock FontSize="18">A TimePicker using a 24-hour clock.</TextBlock>
  146. <StackPanel Orientation="Vertical">
  147. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  148. BorderThickness="1" Padding="15">
  149. <TimePicker ClockIdentifier="24HourClock" />
  150. </Border>
  151. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  152. <TextBlock Padding="15">
  153. <TextBlock.Text>
  154. <x:String>
  155. &lt;TimePicker ClockIdentifier="24HourClock" /&gt;
  156. </x:String>
  157. </TextBlock.Text>
  158. </TextBlock>
  159. </Panel>
  160. </StackPanel>
  161. <TextBlock FontSize="18">A TimePicker using a 12-hour clock and seconds.</TextBlock>
  162. <StackPanel Orientation="Vertical">
  163. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  164. BorderThickness="1" Padding="15">
  165. <TimePicker ClockIdentifier="12HourClock" UseSeconds="True" />
  166. </Border>
  167. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  168. <TextBlock Padding="15">
  169. <TextBlock.Text>
  170. <x:String>
  171. &lt;TimePicker ClockIdentifier="12HourClock" UseSeconds="True" /&gt;
  172. </x:String>
  173. </TextBlock.Text>
  174. </TextBlock>
  175. </Panel>
  176. </StackPanel>
  177. <TextBlock FontSize="18">A TimePicker using a 24-hour clock and seconds.</TextBlock>
  178. <StackPanel Orientation="Vertical">
  179. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  180. BorderThickness="1" Padding="15">
  181. <TimePicker ClockIdentifier="24HourClock" UseSeconds="True" />
  182. </Border>
  183. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  184. <TextBlock Padding="15">
  185. <TextBlock.Text>
  186. <x:String>
  187. &lt;TimePicker ClockIdentifier="24HourClock" UseSeconds="True" /&gt;
  188. </x:String>
  189. </TextBlock.Text>
  190. </TextBlock>
  191. </Panel>
  192. </StackPanel>
  193. </StackPanel>
  194. </StackPanel>
  195. </UserControl>