StateTimePage.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <Page x:Class="NEIntelligentControl2.Pages.Home.StateTimePage"
  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.Pages.Home"
  7. xmlns:bc="clr-namespace:NEIntelligentControl2.Views.Basic"
  8. xmlns:ifs="clr-namespace:NEIntelligentControl2.Views.Infos"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800"
  11. Title="StateTimePage" Loaded="Page_Loaded">
  12. <Page.Resources>
  13. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  14. <Setter Property="VerticalAlignment" Value="Center"/>
  15. </Style>
  16. <Style TargetType="{x:Type ScrollBar}">
  17. <Setter Property="Background" Value="#77F0F8FF"/>
  18. <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
  19. <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
  20. <!--滚动条宽度-->
  21. <Setter Property="Width" Value="8"/>
  22. <Setter Property="MinWidth" Value="6"/>
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate TargetType="{x:Type ScrollBar}">
  26. <!--滚动条背景色-->
  27. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
  28. <Grid.RowDefinitions>
  29. <RowDefinition />
  30. </Grid.RowDefinitions>
  31. <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
  32. <Track.DecreaseRepeatButton>
  33. <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  34. </Track.DecreaseRepeatButton>
  35. <Track.IncreaseRepeatButton>
  36. <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
  37. </Track.IncreaseRepeatButton>
  38. <Track.Thumb>
  39. <Thumb Style="{StaticResource ScrollBarThumb}"/>
  40. </Track.Thumb>
  41. </Track>
  42. </Grid>
  43. <ControlTemplate.Triggers>
  44. <Trigger Property="IsEnabled" Value="false">
  45. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  46. </Trigger>
  47. </ControlTemplate.Triggers>
  48. </ControlTemplate>
  49. </Setter.Value>
  50. </Setter>
  51. <Style.Triggers>
  52. <Trigger Property="Orientation" Value="Horizontal">
  53. <Setter Property="Width" Value="Auto"/>
  54. <Setter Property="MinWidth" Value="0"/>
  55. <Setter Property="Height" Value="6"/>
  56. <Setter Property="MinHeight" Value="6"/>
  57. <Setter Property="Background" Value="#77F0F8FF"/>
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate TargetType="{x:Type ScrollBar}">
  61. <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true">
  62. <Grid.ColumnDefinitions>
  63. <ColumnDefinition />
  64. </Grid.ColumnDefinitions>
  65. <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
  66. <Track.DecreaseRepeatButton>
  67. <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  68. </Track.DecreaseRepeatButton>
  69. <Track.IncreaseRepeatButton>
  70. <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
  71. </Track.IncreaseRepeatButton>
  72. <Track.Thumb>
  73. <Thumb Style="{StaticResource ScrollBarThumb}" />
  74. </Track.Thumb>
  75. </Track>
  76. </Grid>
  77. <ControlTemplate.Triggers>
  78. <Trigger Property="IsEnabled" Value="false">
  79. <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
  80. </Trigger>
  81. </ControlTemplate.Triggers>
  82. </ControlTemplate>
  83. </Setter.Value>
  84. </Setter>
  85. </Trigger>
  86. </Style.Triggers>
  87. </Style>
  88. <Style x:Key="ListBoxItemContainerStyleMain" TargetType="{x:Type ListBoxItem}">
  89. <Setter Property="SnapsToDevicePixels" Value="True"/>
  90. <Setter Property="Padding" Value="4,1"/>
  91. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  92. <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  93. <Setter Property="Background" Value="Transparent"/>
  94. <Setter Property="BorderBrush" Value="Transparent"/>
  95. <Setter Property="BorderThickness" Value="1"/>
  96. <Setter Property="Template">
  97. <Setter.Value>
  98. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  99. <Border x:Name="Bd" Background="WhiteSmoke" CornerRadius="5" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" Margin="0,2">
  100. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  101. </Border>
  102. <ControlTemplate.Triggers>
  103. <MultiTrigger>
  104. <MultiTrigger.Conditions>
  105. <Condition Property="IsMouseOver" Value="True"/>
  106. </MultiTrigger.Conditions>
  107. <Setter Property="Background" TargetName="Bd" Value="WhiteSmoke"/>
  108. </MultiTrigger>
  109. </ControlTemplate.Triggers>
  110. </ControlTemplate>
  111. </Setter.Value>
  112. </Setter>
  113. </Style>
  114. </Page.Resources>
  115. <Grid>
  116. <Grid.RowDefinitions>
  117. <RowDefinition Height="Auto"/>
  118. <RowDefinition/>
  119. <RowDefinition Height="Auto"/>
  120. </Grid.RowDefinitions>
  121. <StackPanel Orientation="Horizontal">
  122. <TextBlock Text="时间:" Style="{StaticResource TextBlockStyle}"/>
  123. <bc:TimePicker VerticalAlignment="Center" x:Name="_tpstart"/>
  124. <TextBlock Text="-" Style="{StaticResource TextBlockStyle}"/>
  125. <bc:TimePicker VerticalAlignment="Center" x:Name="_tpend"/>
  126. <Button Content="查 询" Padding="12,3" Style="{StaticResource ConfirmButtonStyle}" Click="Button_Click" Tag="search"/>
  127. <Button Content="导 出" Padding="12,3" Style="{StaticResource ConfirmButtonStyle}" Click="Button_Click" Tag="output"/>
  128. </StackPanel>
  129. <ListBox ItemContainerStyle="{DynamicResource ListBoxItemContainerStyleMain}" Grid.Row="1" x:Name="_lb" ScrollViewer.HorizontalScrollBarVisibility="Hidden"/>
  130. <bc:HintBar x:Name="_IBMain" Grid.Row="2"/>
  131. </Grid>
  132. </Page>