InfoBar.xaml 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <UserControl x:Class="NEIntelligentControl2.Views.Basic.InfoBar"
  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:local="clr-namespace:NEIntelligentControl2.Views.Basic"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <UserControl.Resources>
  10. <!--下一页-->
  11. <ControlTemplate x:Key="btlast">
  12. <Viewbox Width="17" Height="17">
  13. <Canvas Width="1024" Height="1024">
  14. <Path x:Name="p1" Data="M736 512v0.3L288 960V64z" Fill="#FF497CAD"/>
  15. </Canvas>
  16. </Viewbox>
  17. </ControlTemplate>
  18. <!--最后一页-->
  19. <ControlTemplate x:Key="btlatest">
  20. <Viewbox Width="17" Height="17">
  21. <Canvas Width="1024" Height="1024">
  22. <Path x:Name="p1" Data="M704 64h224v896H704zM544.3 512v0.3L96 960V64z" Fill="#FF497CAD"/>
  23. </Canvas>
  24. </Viewbox>
  25. </ControlTemplate>
  26. <!--上一页-->
  27. <ControlTemplate x:Key="btprevious">
  28. <Viewbox Width="17" Height="17">
  29. <Canvas Width="1024" Height="1024">
  30. <Path x:Name="p1" Data="M288 512v0.3L736 960V64z" Fill="#FF497CAD"/>
  31. </Canvas>
  32. </Viewbox>
  33. </ControlTemplate>
  34. <!--第一页-->
  35. <ControlTemplate x:Key="btfirst">
  36. <Viewbox Width="17" Height="17">
  37. <Canvas Width="1024" Height="1024">
  38. <Path x:Name="p1" Data="M479.7 512v0.3L928 960V64zM96 64h224v896H96z" Fill="#FF497CAD"/>
  39. </Canvas>
  40. </Viewbox>
  41. </ControlTemplate>
  42. </UserControl.Resources>
  43. <StatusBar x:Name="_SBMain" Background="WhiteSmoke">
  44. <StatusBarItem>
  45. <StackPanel Orientation="Horizontal">
  46. <StackPanel.Style>
  47. <Style TargetType="StackPanel">
  48. <Style.Triggers>
  49. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsPagination}" Value="True">
  50. <Setter Property="Visibility" Value="Visible"/>
  51. </DataTrigger>
  52. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=IsPagination}" Value="False">
  53. <Setter Property="Visibility" Value="Collapsed"/>
  54. </DataTrigger>
  55. </Style.Triggers>
  56. </Style>
  57. </StackPanel.Style>
  58. <TextBlock Text="每页条数:" VerticalAlignment="Center" x:Name="_tbEachCountTitle"/>
  59. <TextBox MinWidth="30" Margin="0,0,5,0" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=EachPageCount}"/>
  60. <Button ToolTip="第一页" Margin="1,0" Click="Button_Click" Tag="first">
  61. <Button.Content>
  62. <ContentControl Template="{StaticResource btfirst}"/>
  63. </Button.Content>
  64. </Button>
  65. <Button ToolTip="上一页" Margin="1,0" Click="Button_Click" Tag="previous">
  66. <Button.Content>
  67. <ContentControl Template="{StaticResource btprevious}"/>
  68. </Button.Content>
  69. </Button>
  70. <TextBox MinWidth="30" VerticalAlignment="Center" Margin="1,0" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=PageIndex}"/>
  71. <TextBlock Text="/" VerticalAlignment="Center" Margin="1,0"/>
  72. <TextBlock MinWidth="30" VerticalAlignment="Center" Margin="1,0" Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=PageCount}"/>
  73. <Button ToolTip="下一页" Margin="1,0" Click="Button_Click" Tag="last">
  74. <Button.Content>
  75. <ContentControl Template="{StaticResource btlast}"/>
  76. </Button.Content>
  77. </Button>
  78. <Button ToolTip="最后一页" Margin="1,0" Click="Button_Click" Tag="latest">
  79. <Button.Content>
  80. <ContentControl Template="{StaticResource btlatest}"/>
  81. </Button.Content>
  82. </Button>
  83. </StackPanel>
  84. </StatusBarItem>
  85. <StatusBarItem HorizontalAlignment="Right">
  86. <TextBlock x:Name="_TBStatus" Text="就绪" Foreground="WhiteSmoke"/>
  87. </StatusBarItem>
  88. </StatusBar>
  89. </UserControl>