CustomControlPagination.xaml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <UserControl x:Class="ivf_tl_Operate.CustomUserControls.CustomControlPagination"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:customControl="clr-namespace:ivf_tl_CustomControls;assembly=ivf_tl_CustomControls_Surface"
  7. mc:Ignorable="d"
  8. Width="1824">
  9. <UserControl.Resources>
  10. <VisualBrush x:Key="HelpBrush" TileMode="None" Stretch="None">
  11. <VisualBrush.Visual>
  12. <Border Width="184" Height="92" Background="White">
  13. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="38" Foreground="#C7C7C7" Text="跳转到" />
  14. </Border>
  15. </VisualBrush.Visual>
  16. </VisualBrush>
  17. <PathFigureCollection x:Key="FirstPath">
  18. M16695.859,19854.273l-4.883,4.035-9.227,7.631,14.109,9.674
  19. </PathFigureCollection>
  20. <DrawingImage x:Key="FirstPathImageSource">
  21. <DrawingImage.Drawing>
  22. <GeometryDrawing Brush="Blue">
  23. <GeometryDrawing.Geometry>
  24. <PathGeometry FillRule="Nonzero" Figures="{StaticResource FirstPath}" />
  25. </GeometryDrawing.Geometry>
  26. </GeometryDrawing>
  27. </DrawingImage.Drawing>
  28. </DrawingImage>
  29. <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
  30. <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
  31. <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
  32. <Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}">
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type TextBox}">
  36. <Border x:Name="border" CornerRadius="10" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
  37. <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
  38. </Border>
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="IsEnabled" Value="false">
  41. <Setter Property="Opacity" TargetName="border" Value="0.56"/>
  42. </Trigger>
  43. <Trigger Property="Text" Value="">
  44. <Setter Property="Background" TargetName="border">
  45. <Setter.Value>
  46. <VisualBrush TileMode="None" Stretch="None">
  47. <VisualBrush.Visual>
  48. <Border Width="184" Height="92" Background="White">
  49. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="38" Foreground="#C7C7C7" Text="{DynamicResource C0274}" />
  50. </Border>
  51. </VisualBrush.Visual>
  52. </VisualBrush>
  53. </Setter.Value>
  54. </Setter>
  55. </Trigger>
  56. <Trigger Property="Text" Value="{x:Null}">
  57. <Setter Property="Background" TargetName="border">
  58. <Setter.Value>
  59. <VisualBrush TileMode="None" Stretch="None">
  60. <VisualBrush.Visual>
  61. <Border Width="184" Height="92" Background="White">
  62. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="38" Foreground="#C7C7C7" Text="跳转到" />
  63. </Border>
  64. </VisualBrush.Visual>
  65. </VisualBrush>
  66. </Setter.Value>
  67. </Setter>
  68. </Trigger>
  69. </ControlTemplate.Triggers>
  70. </ControlTemplate>
  71. </Setter.Value>
  72. </Setter>
  73. <Style.Triggers>
  74. <MultiTrigger>
  75. <MultiTrigger.Conditions>
  76. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
  77. <Condition Property="IsSelectionActive" Value="false"/>
  78. </MultiTrigger.Conditions>
  79. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
  80. </MultiTrigger>
  81. </Style.Triggers>
  82. </Style>
  83. <Style x:Key="FocusVisual">
  84. <Setter Property="Control.Template">
  85. <Setter.Value>
  86. <ControlTemplate>
  87. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  88. </ControlTemplate>
  89. </Setter.Value>
  90. </Setter>
  91. </Style>
  92. <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
  93. <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
  94. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
  95. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
  96. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
  97. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  98. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
  99. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
  100. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
  101. <Style TargetType="{x:Type Button}">
  102. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  103. <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
  104. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  105. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  106. <Setter Property="BorderThickness" Value="0"/>
  107. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  108. <Setter Property="VerticalContentAlignment" Value="Center"/>
  109. <Setter Property="Padding" Value="1"/>
  110. <Setter Property="Template">
  111. <Setter.Value>
  112. <ControlTemplate TargetType="{x:Type Button}">
  113. <Border x:Name="border" CornerRadius="10" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  114. <!--<Image Source="{TemplateBinding }"/>-->
  115. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  116. </Border>
  117. <ControlTemplate.Triggers>
  118. <Trigger Property="IsEnabled" Value="false">
  119. <Setter Property="Background" TargetName="border" Value="#D9D9D9"/>
  120. </Trigger>
  121. </ControlTemplate.Triggers>
  122. </ControlTemplate>
  123. </Setter.Value>
  124. </Setter>
  125. </Style>
  126. <Style x:Key="FocusVisual2">
  127. <Setter Property="Control.Template">
  128. <Setter.Value>
  129. <ControlTemplate>
  130. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  131. </ControlTemplate>
  132. </Setter.Value>
  133. </Setter>
  134. </Style>
  135. <SolidColorBrush x:Key="Item.MouseOver.Background1" Color="#1F26A0DA"/>
  136. <SolidColorBrush x:Key="Item.MouseOver.Border1" Color="#a826A0Da"/>
  137. <SolidColorBrush x:Key="Item.SelectedActive.Background1" Color="#3D26A0DA"/>
  138. <SolidColorBrush x:Key="Item.SelectedActive.Border1" Color="#FF26A0DA"/>
  139. <SolidColorBrush x:Key="Item.SelectedInactive.Background1" Color="#3DDADADA"/>
  140. <SolidColorBrush x:Key="Item.SelectedInactive.Border1" Color="#FFDADADA"/>
  141. <Style x:Key="ListBoxItemStyle2" TargetType="{x:Type ListBoxItem}">
  142. <Setter Property="SnapsToDevicePixels" Value="True"/>
  143. <Setter Property="Padding" Value="4,1"/>
  144. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  145. <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  146. <Setter Property="Background" Value="Transparent"/>
  147. <Setter Property="BorderBrush" Value="Transparent"/>
  148. <Setter Property="BorderThickness" Value="0"/>
  149. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual2}"/>
  150. <Setter Property="Template">
  151. <Setter.Value>
  152. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  153. <Border x:Name="Bd" CornerRadius="10" Width="92" Height="92" Margin="30 0 0 0" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
  154. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  155. </Border>
  156. <ControlTemplate.Triggers>
  157. <Trigger Property="IsSelected" Value="True">
  158. <Setter Property="TextElement.Foreground" TargetName="Bd" Value="White"/>
  159. <Setter Property="Background" TargetName="Bd" Value="#4D75AC"/>
  160. </Trigger>
  161. </ControlTemplate.Triggers>
  162. </ControlTemplate>
  163. </Setter.Value>
  164. </Setter>
  165. </Style>
  166. <SolidColorBrush x:Key="ListBox.Static.Background" Color="#FFFFFFFF"/>
  167. <SolidColorBrush x:Key="ListBox.Static.Border" Color="#FFABADB3"/>
  168. <SolidColorBrush x:Key="ListBox.Disabled.Background" Color="#FFFFFFFF"/>
  169. <SolidColorBrush x:Key="ListBox.Disabled.Border" Color="#FFD9D9D9"/>
  170. <Style x:Key="ListBoxStyle1" TargetType="{x:Type ListBox}">
  171. <Setter Property="Background" Value="{StaticResource ListBox.Static.Background}"/>
  172. <Setter Property="BorderBrush" Value="{StaticResource ListBox.Static.Border}"/>
  173. <Setter Property="BorderThickness" Value="1"/>
  174. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  175. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
  176. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
  177. <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
  178. <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
  179. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  180. <Setter Property="VerticalContentAlignment" Value="Center"/>
  181. <Setter Property="Template">
  182. <Setter.Value>
  183. <ControlTemplate TargetType="{x:Type ListBox}">
  184. <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1" SnapsToDevicePixels="true">
  185. <ScrollViewer x:Name="scroll" Focusable="false" Padding="{TemplateBinding Padding}">
  186. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  187. </ScrollViewer>
  188. </Border>
  189. <ControlTemplate.Triggers>
  190. <Trigger Property="IsEnabled" Value="false">
  191. <Setter Property="Background" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Background}"/>
  192. <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource ListBox.Disabled.Border}"/>
  193. </Trigger>
  194. <MultiTrigger>
  195. <MultiTrigger.Conditions>
  196. <Condition Property="IsGrouping" Value="true"/>
  197. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  198. </MultiTrigger.Conditions>
  199. <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  200. </MultiTrigger>
  201. </ControlTemplate.Triggers>
  202. </ControlTemplate>
  203. </Setter.Value>
  204. </Setter>
  205. </Style>
  206. </UserControl.Resources>
  207. <Grid x:Name="grid" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Center">
  208. <Grid.ColumnDefinitions>
  209. <ColumnDefinition Width="auto"/>
  210. <ColumnDefinition Width="auto"/>
  211. <ColumnDefinition Width="auto"/>
  212. </Grid.ColumnDefinitions>
  213. <StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  214. <customControl:ButtomSmallImage Click="FirstPage_Click" Background="White" ButtomSmallImageCornerRadius="10" IconWidth="33" IconHeight="27" Width="92" Height="92" Margin="0 0 30 0" Icon="/ivf_tl_Operate;component/Resources/Image/FirstPage.png" IsEnabledIcon="/ivf_tl_Operate;component/Resources/Image/FirstPageIsEnable.png">
  215. <customControl:ButtomSmallImage.IsEnabled>
  216. <MultiBinding Mode="OneWay" Converter="{StaticResource ConvertButtonIsEnable}" ConverterParameter="1">
  217. <Binding ElementName="pageListBox" Path="SelectedIndex"/>
  218. <Binding ElementName="pageListBox" Path="Items.Count"/>
  219. </MultiBinding>
  220. </customControl:ButtomSmallImage.IsEnabled>
  221. </customControl:ButtomSmallImage>
  222. <!--<customControl:ButtonImage Click="FirstPage_Click" Background="White" CustomImageButtonCornerRadius="10" IconWidth="33" IconHeight="27" Width="92" Height="92" Margin="0 0 30 0" Icon="/Image/FirstPage.png" IsEnabledIcon="/Image/FirstPageIsEnable.png">
  223. <local:CustomImageButton.IsEnabled>
  224. <MultiBinding Mode="OneWay" Converter="{StaticResource ConvertButtonIsEnable}" ConverterParameter="1">
  225. <Binding ElementName="pageListBox" Path="SelectedIndex"/>
  226. <Binding ElementName="pageListBox" Path="Items.Count"/>
  227. </MultiBinding>
  228. </local:CustomImageButton.IsEnabled>
  229. </customControl:ButtonImage>-->
  230. <customControl:ButtomSmallImage Click="PreviousPage_Click" Background="White" ButtomSmallImageCornerRadius="10" IconWidth="19" IconHeight="27" Width="92" Height="92" Margin="0 0 30 0" Icon="/ivf_tl_Operate;component/Resources/Image/PreviousPage.png" IsEnabledIcon="/ivf_tl_Operate;component/Resources/Image/PreviousPageIsEnable.png">
  231. <customControl:ButtomSmallImage.IsEnabled>
  232. <MultiBinding Mode="OneWay" Converter="{StaticResource ConvertButtonIsEnable}" ConverterParameter="1">
  233. <Binding ElementName="pageListBox" Path="SelectedIndex"/>
  234. <Binding ElementName="pageListBox" Path="Items.Count"/>
  235. </MultiBinding>
  236. </customControl:ButtomSmallImage.IsEnabled>
  237. </customControl:ButtomSmallImage>
  238. </StackPanel>
  239. <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  240. <ListBox Style="{DynamicResource ListBoxStyle1}" x:Name="pageListBox" ScrollViewer.PanningMode="None" SelectionChanged="ListBox_SelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" MaxWidth="370" Foreground="#4D75AC" ItemContainerStyle="{StaticResource ListBoxItemStyle2}" FontSize="38" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="Transparent" BorderThickness="0">
  241. <ListBox.ItemsPanel>
  242. <ItemsPanelTemplate>
  243. <StackPanel Orientation="Horizontal"/>
  244. </ItemsPanelTemplate>
  245. </ListBox.ItemsPanel>
  246. <!--<ListBoxItem>123</ListBoxItem>
  247. <ListBoxItem>123</ListBoxItem>
  248. <ListBoxItem>123</ListBoxItem>
  249. <ListBoxItem>123</ListBoxItem>
  250. <ListBoxItem>123</ListBoxItem>
  251. <ListBoxItem>123</ListBoxItem>-->
  252. </ListBox>
  253. <!--<Button Width="92" Height="92" Background="White" Content="1"/>
  254. <Button Width="92" Height="92" Background="White" Margin="30 0 0 0" Content="2"/>
  255. <Button Width="92" Height="92" Background="White" Margin="30 0 0 0" Content="3"/>-->
  256. </StackPanel>
  257. <StackPanel Margin="30 0 0 0" Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  258. <customControl:ButtomSmallImage Click="NextPage_Click" Background="White" ButtomSmallImageCornerRadius="10" IconWidth="19" IconHeight="27" Width="92" Height="92" Margin="0 0 30 0" Icon="/ivf_tl_Operate;component/Resources/Image/NextPage.png" IsEnabledIcon="/ivf_tl_Operate;component/Resources/Image/NextPageIsEnable.png">
  259. <customControl:ButtomSmallImage.IsEnabled>
  260. <MultiBinding Mode="OneWay" Converter="{StaticResource ConvertButtonIsEnable}" ConverterParameter="2">
  261. <Binding ElementName="pageListBox" Path="SelectedIndex"/>
  262. <Binding ElementName="pageListBox" Path="Items.Count"/>
  263. </MultiBinding>
  264. </customControl:ButtomSmallImage.IsEnabled>
  265. </customControl:ButtomSmallImage>
  266. <customControl:ButtomSmallImage Click="LastPage_Click" Background="White" ButtomSmallImageCornerRadius="10" IconWidth="33" IconHeight="27" Width="92" Height="92" Margin="0 0 30 0" Icon="/ivf_tl_Operate;component/Resources/Image/LastPage.png" IsEnabledIcon="/ivf_tl_Operate;component/Resources/Image/LastPageIsEnable.png">
  267. <customControl:ButtomSmallImage.IsEnabled>
  268. <MultiBinding Mode="OneWay" Converter="{StaticResource ConvertButtonIsEnable}" ConverterParameter="2">
  269. <Binding ElementName="pageListBox" Path="SelectedIndex"/>
  270. <Binding ElementName="pageListBox" Path="Items.Count"/>
  271. </MultiBinding>
  272. </customControl:ButtomSmallImage.IsEnabled>
  273. </customControl:ButtomSmallImage>
  274. <TextBox x:Name="jumpPage_TextBox" BorderThickness="0" Background="White" FontSize="38" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="#C7C7C7" Style="{StaticResource TextBoxStyle1}" Width="184" Height="92" Margin="30 0 0 0"/>
  275. <Button Click="JumpPage_Click" Width="146" Height="92" Margin="30 0 0 0" Foreground="#4D75AC" FontSize="38" Background="White" BorderThickness="0" Content="{DynamicResource C0273}"/>
  276. <TextBlock x:Name="countPageText" Foreground="#9D9D9D" Margin="30 0 0 0" FontSize="38" Text="共23页" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  277. </StackPanel>
  278. </Grid>
  279. </UserControl>