HistoryDataWindow.xaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <Window x:Class="NEIntelligentControl2.Windows.HistoryDataWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:NEIntelligentControl2.Windows"
  7. xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
  8. mc:Ignorable="d"
  9. Title="历史数据" Height="727" Width="1200" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
  10. <Window.Resources>
  11. <Style x:Key="ConfirmButtonStyle" TargetType="{x:Type Button}">
  12. <Setter Property="Background" Value="#FF006ACC"/>
  13. <Setter Property="Foreground" Value="WhiteSmoke"/>
  14. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  15. <Setter Property="VerticalContentAlignment" Value="Center"/>
  16. <Setter Property="Padding" Value="17,6"/>
  17. <Setter Property="FontSize" Value="14"/>
  18. <Setter Property="BorderThickness" Value="0"/>
  19. <Setter Property="Margin" Value="20,0"/>
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type Button}">
  23. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" CornerRadius="3">
  24. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  25. </Border>
  26. <ControlTemplate.Triggers>
  27. <Trigger Property="IsMouseOver" Value="true">
  28. <Setter Property="Background" TargetName="border" Value="#FF2E81CC"/>
  29. </Trigger>
  30. <Trigger Property="IsPressed" Value="true">
  31. <Setter Property="Background" TargetName="border" Value="#FF006ACC"/>
  32. </Trigger>
  33. </ControlTemplate.Triggers>
  34. </ControlTemplate>
  35. </Setter.Value>
  36. </Setter>
  37. </Style>
  38. </Window.Resources>
  39. <Grid>
  40. <Grid.RowDefinitions>
  41. <RowDefinition Height="Auto"/>
  42. <RowDefinition/>
  43. <RowDefinition Height="Auto"/>
  44. </Grid.RowDefinitions>
  45. <WrapPanel Margin="5">
  46. <StackPanel Orientation="Horizontal" Margin="5">
  47. <TextBlock Text="开始时间:"/>
  48. <TextBox Margin="5,0,0,0" x:Name="_TBStart" MinWidth="120" KeyDown="TextBox_KeyDown"/>
  49. </StackPanel>
  50. <StackPanel Orientation="Horizontal" Margin="5">
  51. <TextBlock Text="结束时间:"/>
  52. <TextBox Margin="5,0,0,0" x:Name="_TBEnd" MinWidth="120" KeyDown="TextBox_KeyDown"/>
  53. </StackPanel>
  54. <StackPanel Orientation="Horizontal" Margin="5" VerticalAlignment="Center">
  55. <TextBlock Text="快照间隔:" VerticalAlignment="Center"/>
  56. <RadioButton Content="一分钟" GroupName="interval" Tag="1" Click="RadioButton_Click" Margin="3"/>
  57. <RadioButton Content="五分钟" GroupName="interval" IsChecked="True" Tag="5" Margin="3" Click="RadioButton_Click"/>
  58. <RadioButton Content="十分钟" GroupName="interval" Tag="10" Click="RadioButton_Click" Margin="3"/>
  59. <RadioButton Content="原始值" Visibility="Collapsed" GroupName="interval" Tag="0" Click="RadioButton_Click" Margin="3"/>
  60. </StackPanel>
  61. <Button Content="查 询" Margin="5,0" Style="{DynamicResource ConfirmButtonStyle}" VerticalAlignment="Center" Click="Button_Click" Tag="search"/>
  62. <Button Content="数据导出" Margin="5,0" Style="{DynamicResource ConfirmButtonStyle}" VerticalAlignment="Center" Click="Button_Click" Tag="output"/>
  63. </WrapPanel>
  64. <lvc:CartesianChart x:Name="_Chart" Margin="5" Grid.Row="1" LegendLocation="Bottom" Foreground="#FF525252" DisableAnimations="True">
  65. <lvc:CartesianChart.AxisX>
  66. <lvc:Axis x:Name="_ChartAxisX" Foreground="#FF525252">
  67. <lvc:Axis.Separator>
  68. <lvc:Separator Stroke="{x:Null}"/>
  69. </lvc:Axis.Separator>
  70. </lvc:Axis>
  71. </lvc:CartesianChart.AxisX>
  72. <lvc:CartesianChart.AxisY>
  73. <lvc:Axis Foreground="#FF525252">
  74. <lvc:Axis.Separator>
  75. <lvc:Separator Stroke="#FFE2E2E2"/>
  76. </lvc:Axis.Separator>
  77. </lvc:Axis>
  78. </lvc:CartesianChart.AxisY>
  79. <lvc:CartesianChart.DataTooltip>
  80. <lvc:DefaultTooltip Background="#CCDEDEDE" CornerRadius="7"/>
  81. </lvc:CartesianChart.DataTooltip>
  82. <lvc:CartesianChart.Series>
  83. <lvc:LineSeries Title="" x:Name="_LSLine" PointForeground="Transparent" Stroke="#FF31B9FB" Fill="Transparent" PointGeometry="{x:Null}" StrokeThickness="1.2"/>
  84. </lvc:CartesianChart.Series>
  85. </lvc:CartesianChart>
  86. <StatusBar Grid.Row="2">
  87. </StatusBar>
  88. </Grid>
  89. </Window>