DateTimePickerPage.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  74. BorderThickness="1" Padding="15">
  75. <TimePicker>
  76. <DataValidationErrors.Error>
  77. <sys:Exception />
  78. </DataValidationErrors.Error>
  79. </TimePicker>
  80. </Border>
  81. <TextBlock FontSize="18">A TimePicker with minute increments specified.</TextBlock>
  82. <StackPanel Orientation="Vertical">
  83. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  84. BorderThickness="1" Padding="15">
  85. <TimePicker MinuteIncrement="15" />
  86. </Border>
  87. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  88. <TextBlock Padding="15">
  89. <TextBlock.Text>
  90. <x:String>
  91. &lt;TimePicker MinuteIncrement="15" /&gt;
  92. </x:String>
  93. </TextBlock.Text>
  94. </TextBlock>
  95. </Panel>
  96. </StackPanel>
  97. <TextBlock FontSize="18">A TimePicker using a 12-hour clock.</TextBlock>
  98. <StackPanel Orientation="Vertical">
  99. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  100. BorderThickness="1" Padding="15">
  101. <TimePicker ClockIdentifier="12HourClock"/>
  102. </Border>
  103. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  104. <TextBlock Padding="15">
  105. <TextBlock.Text>
  106. <x:String>
  107. &lt;TimePicker ClockIdentifier="12HourClock" /&gt;
  108. </x:String>
  109. </TextBlock.Text>
  110. </TextBlock>
  111. </Panel>
  112. </StackPanel>
  113. <TextBlock FontSize="18">A TimePicker using a 24-hour clock.</TextBlock>
  114. <StackPanel Orientation="Vertical">
  115. <Border BorderBrush="{DynamicResource CatalogBaseLowColor}"
  116. BorderThickness="1" Padding="15">
  117. <TimePicker ClockIdentifier="24HourClock" />
  118. </Border>
  119. <Panel Background="{DynamicResource CatalogBaseLowColor}">
  120. <TextBlock Padding="15">
  121. <TextBlock.Text>
  122. <x:String>
  123. &lt;TimePicker ClockIdentifier="24HourClock" /&gt;
  124. </x:String>
  125. </TextBlock.Text>
  126. </TextBlock>
  127. </Panel>
  128. </StackPanel>
  129. </StackPanel>
  130. </StackPanel>
  131. </UserControl>