You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 rivejä
9.9 KiB

  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:bpa="clr-namespace:BPA.UIControl">
  4. <ResourceDictionary.MergedDictionaries>
  5. <ResourceDictionary Source="pack://application:,,,/BPA.UIControl;component/Themes/FlipView.xaml" />
  6. </ResourceDictionary.MergedDictionaries>
  7. <Style x:Key="ClockListBox"
  8. BasedOn="{StaticResource RubyerListBox}"
  9. TargetType="ListBox">
  10. <Setter Property="HorizontalContentAlignment" Value="Center" />
  11. <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllControlCornerRadius}" />
  12. <Setter Property="bpa:ControlHelper.FocusedBrush" Value="{Binding Path=(bpa:ControlHelper.FocusedBrush), RelativeSource={RelativeSource AncestorType=bpa:Clock}}" />
  13. <Setter Property="bpa:ControlHelper.FocusedForegroundBrush" Value="{Binding Path=(bpa:ControlHelper.FocusedForegroundBrush), RelativeSource={RelativeSource AncestorType=bpa:Clock}}" />
  14. <Setter Property="bpa:ControlHelper.MaskOpacity" Value="1" />
  15. <Setter Property="bpa:ItemsControlHelper.ItemMargin" Value="5 0" />
  16. <Setter Property="bpa:ItemsControlHelper.ItemPadding" Value="2 4" />
  17. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Visible" />
  18. <Style.Resources>
  19. <Style BasedOn="{StaticResource SmallScrollViewer}" TargetType="ScrollViewer">
  20. <Setter Property="bpa:ScrollViewerHelper.ScrollBarSize" Value="5" />
  21. </Style>
  22. </Style.Resources>
  23. </Style>
  24. <Style x:Key="RubyerClock" TargetType="{x:Type bpa:Clock}">
  25. <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
  26. <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
  27. <Setter Property="BorderThickness" Value="0" />
  28. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  29. <Setter Property="Margin" Value="5" />
  30. <Setter Property="Height" Value="330" />
  31. <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
  32. <Setter Property="bpa:ControlHelper.FocusedBrush" Value="{DynamicResource Primary}" />
  33. <Setter Property="bpa:ControlHelper.FocusedForegroundBrush" Value="{DynamicResource WhiteForeground}" />
  34. <Setter Property="Template">
  35. <Setter.Value>
  36. <ControlTemplate TargetType="{x:Type bpa:Clock}">
  37. <Grid>
  38. <Border Background="{TemplateBinding Background}"
  39. BorderBrush="{TemplateBinding BorderBrush}"
  40. BorderThickness="{TemplateBinding BorderThickness}"
  41. CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  42. Effect="{DynamicResource AllDirectionEffect3}" />
  43. <Border x:Name="border"
  44. Background="{TemplateBinding Background}"
  45. BorderBrush="{TemplateBinding BorderBrush}"
  46. BorderThickness="{TemplateBinding BorderThickness}"
  47. CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  48. <Grid>
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="*" />
  51. <RowDefinition Height="Auto" />
  52. </Grid.RowDefinitions>
  53. <Border x:Name="content">
  54. <Grid MinWidth="200">
  55. <Grid.ColumnDefinitions>
  56. <ColumnDefinition />
  57. <ColumnDefinition />
  58. </Grid.ColumnDefinitions>
  59. <bpa:FlipView Style="{StaticResource SelecterFlipView}"
  60. Grid.Column="0"
  61. Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Grid}}"
  62. BorderBrush="{DynamicResource BorderLighter}"
  63. BorderThickness="0 0 1 0"
  64. ItemStringFormat="D2"
  65. ItemsSource="{TemplateBinding Hours}"
  66. SelectedItem="{Binding Hour, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  67. <bpa:FlipView Style="{StaticResource SelecterFlipView}"
  68. Grid.Column="1"
  69. Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=Grid}}"
  70. ItemStringFormat="D2"
  71. ItemsSource="{TemplateBinding Minutes}"
  72. SelectedItem="{Binding Minute, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  73. </Grid>
  74. </Border>
  75. <Button x:Name="PART_ConfirmButton"
  76. Grid.Row="1"
  77. Margin="5"
  78. Padding="20 5"
  79. Content="{DynamicResource I18N_Clock_Ok}"
  80. Visibility="{TemplateBinding IsShowConfirmButton, Converter={StaticResource BooleanToVisibleConverter}}" />
  81. </Grid>
  82. </Border>
  83. </Grid>
  84. </ControlTemplate>
  85. </Setter.Value>
  86. </Setter>
  87. </Style>
  88. <Style x:Key="ComboBoxClock" TargetType="{x:Type bpa:Clock}">
  89. <Setter Property="Background" Value="{DynamicResource FloatBackground}" />
  90. <Setter Property="BorderBrush" Value="{DynamicResource Border}" />
  91. <Setter Property="BorderThickness" Value="0" />
  92. <Setter Property="VerticalAlignment" Value="Center" />
  93. <Setter Property="Padding" Value="5" />
  94. <Setter Property="Height" Value="Auto" />
  95. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  96. <Setter Property="bpa:ControlHelper.CornerRadius" Value="{DynamicResource AllContainerCornerRadius}" />
  97. <Setter Property="bpa:ControlHelper.FocusBorderBrush" Value="{DynamicResource Primary}" />
  98. <Setter Property="bpa:ControlHelper.MouseOverBrush" Value="{DynamicResource Primary}" />
  99. <Setter Property="Template">
  100. <Setter.Value>
  101. <ControlTemplate TargetType="{x:Type bpa:Clock}">
  102. <Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}">
  103. <Border x:Name="border"
  104. Background="{TemplateBinding Background}"
  105. BorderBrush="{TemplateBinding BorderBrush}"
  106. BorderThickness="{TemplateBinding BorderThickness}"
  107. CornerRadius="{Binding Path=(bpa:ControlHelper.CornerRadius), RelativeSource={RelativeSource Mode=TemplatedParent}}">
  108. <UniformGrid Margin="{TemplateBinding Padding}"
  109. Columns="2"
  110. Rows="1">
  111. <ComboBox Grid.Column="0"
  112. Margin="0 0 2 0"
  113. bpa:ControlHelper.FocusBorderBrush="{Binding Path=(bpa:ControlHelper.FocusBorderBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  114. bpa:ControlHelper.MouseOverBrush="{Binding Path=(bpa:ControlHelper.MouseOverBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  115. bpa:InputBoxHelper.PostContent="{DynamicResource I18N_Clock_Hour}"
  116. bpa:ItemsControlHelper.ItemPadding="5 2"
  117. ItemStringFormat="D2"
  118. ItemsSource="{TemplateBinding Hours}"
  119. SelectedItem="{Binding Hour, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  120. <ComboBox Grid.Column="1"
  121. Margin="2 0"
  122. bpa:ControlHelper.FocusBorderBrush="{Binding Path=(bpa:ControlHelper.FocusBorderBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  123. bpa:ControlHelper.MouseOverBrush="{Binding Path=(bpa:ControlHelper.MouseOverBrush), RelativeSource={RelativeSource Mode=TemplatedParent}}"
  124. bpa:InputBoxHelper.PostContent="{DynamicResource I18N_Clock_Minute}"
  125. bpa:ItemsControlHelper.ItemPadding="5 2"
  126. ItemStringFormat="D2"
  127. ItemsSource="{TemplateBinding Minutes}"
  128. SelectedItem="{Binding Minute, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  129. </UniformGrid>
  130. </Border>
  131. </Grid>
  132. </ControlTemplate>
  133. </Setter.Value>
  134. </Setter>
  135. </Style>
  136. </ResourceDictionary>