DataHistoryView.xaml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <UserControl x:Class="Venus_MainPages.Views.DataHistoryView"
  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:Venus_MainPages.Views"
  7. mc:Ignorable="d"
  8. xmlns:wfi ="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  9. xmlns:wf ="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
  10. xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  11. xmlns:prism="http://prismlibrary.com/"
  12. prism:ViewModelLocator.AutoWireViewModel="True"
  13. xmlns:ctrls="clr-namespace:Venus_Themes.UserControls;assembly=Venus_Themes"
  14. d:DesignHeight="450" d:DesignWidth="800" x:Name="dataHistoryView">
  15. <i:Interaction.Triggers>
  16. <i:EventTrigger EventName="Loaded">
  17. <i:InvokeCommandAction Command="{Binding LoadCommand}" CommandParameter="{Binding ElementName=dataHistoryView}"/>
  18. </i:EventTrigger>
  19. </i:Interaction.Triggers>
  20. <Grid>
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition Width="Auto"/>
  23. <ColumnDefinition />
  24. </Grid.ColumnDefinitions>
  25. <StackPanel>
  26. <StackPanel>
  27. <TextBlock Text="Start Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
  28. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="40" HorizontalAlignment="Left">
  29. <wf:DateTimePicker x:Name="wfTimeFrom" Value="2011-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  30. </wfi:WindowsFormsHost>
  31. <TextBlock Text="End Time:" Width="70" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" Margin="5,0,0,0"/>
  32. <wfi:WindowsFormsHost Margin="5,0,0,0" FontSize="14" FontFamily="Arial" Width="170" Height="22" HorizontalAlignment="Left">
  33. <wf:DateTimePicker x:Name="wfTimeTo" Value="2013-8-1" CustomFormat="yyyy/MM/dd HH:mm:ss" Format="Custom"></wf:DateTimePicker>
  34. </wfi:WindowsFormsHost>
  35. <StackPanel Orientation="Horizontal">
  36. <Button Content="Search" Command="{Binding StartCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0" IsEnabled="{Binding ElementName=TimeDataCheckBox,Path=IsChecked,Converter={StaticResource BoolToBool}}"/>
  37. <Button Content="Clear" Command="{Binding ClearCommand}" Width="80" Height="20" HorizontalAlignment="Left" Margin="5,10,0,0"/>
  38. </StackPanel>
  39. </StackPanel>
  40. <TreeView x:Name="ParameterTreeView" ItemsSource="{Binding ParameterNodes}" Canvas.Top="100" Height="800">
  41. <TreeView.ItemTemplate>
  42. <HierarchicalDataTemplate ItemsSource="{Binding ChildNodes}">
  43. <StackPanel Orientation="Horizontal">
  44. <CheckBox IsChecked="{Binding Selected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
  45. <i:Interaction.Triggers>
  46. <i:EventTrigger EventName="Click">
  47. <i:InvokeCommandAction Command="{Binding DataContext.ParameterCheckCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=TreeView}}" CommandParameter="{Binding }"/>
  48. </i:EventTrigger>
  49. </i:Interaction.Triggers>
  50. </CheckBox>
  51. <TextBlock Text="{Binding Name}" />
  52. </StackPanel>
  53. </HierarchicalDataTemplate>
  54. </TreeView.ItemTemplate>
  55. </TreeView>
  56. </StackPanel>
  57. <Grid Grid.Column="1">
  58. <Grid.RowDefinitions>
  59. <RowDefinition Height="60"/>
  60. <RowDefinition/>
  61. </Grid.RowDefinitions>
  62. <!--<Border BorderThickness="1" BorderBrush="Black" Margin="50,5,20,5">-->
  63. <StackPanel Orientation="Horizontal">
  64. <!--<TextBlock Text="MinX:" Padding="50,20,0,0" FontSize="20"/>
  65. <TextBox BorderThickness="0,0,0,1" BorderBrush="Black" Height="20" Width="80" Background="Transparent" HorizontalAlignment="Center" FontSize="20" Padding="3,0,0,0" Margin="2,0,0,-1" x:Name="MinXTextBox"/>
  66. <TextBlock Text="MaxX:" Padding="100,20,0,0" FontSize="20"/>
  67. <TextBox BorderThickness="0,0,0,1" BorderBrush="Black" Height="20" Width="80" Background="Transparent" HorizontalAlignment="Center" FontSize="20" Padding="3,0,0,0" Margin="2,0,0,-1" x:Name="MaxXTextBox"/>
  68. <TextBlock Text="MinY:" Padding="100,20,0,0" FontSize="20"/>
  69. <TextBox BorderThickness="0,0,0,1" BorderBrush="Black" Height="20" Width="80" Background="Transparent" HorizontalAlignment="Center" FontSize="20" Padding="3,0,0,0" Margin="2,0,0,-1" x:Name="MinYTextBox"/>
  70. <TextBlock Text="MaxY:" Padding="100,20,0,0" FontSize="20"/>
  71. <TextBox BorderThickness="0,0,0,1" BorderBrush="Black" Height="20" Width="80" Background="Transparent" HorizontalAlignment="Center" FontSize="20" Padding="3,0,0,0" Margin="2,0,0,-1" x:Name="MaxYTextBox"/>-->
  72. <!--<TextBlock Text="AutoX:" Padding="100,15,0,0" FontSize="20"/>-->
  73. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="3,-5,0,0" Margin="100,25,0,0" Content="AutoX Zoom" x:Name="AutoXCheckBox"/>
  74. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="3,-5,0,0" Margin="100,25,0,0" Content="AutoY Zoom" x:Name="AutoYCheckBox"/>
  75. <CheckBox HorizontalAlignment="Center" FontSize="20" Padding="3,-5,0,0" Margin="100,25,0,0" Content="查看实时数据" x:Name="TimeDataCheckBox">
  76. <i:Interaction.Triggers>
  77. <i:EventTrigger EventName="Checked">
  78. <i:InvokeCommandAction Command="{Binding StartRealTimeCommand}"/>
  79. </i:EventTrigger>
  80. <i:EventTrigger EventName="Unchecked">
  81. <i:InvokeCommandAction Command="{Binding StopRealTimeCommand}"/>
  82. </i:EventTrigger>
  83. </i:Interaction.Triggers>
  84. </CheckBox>
  85. </StackPanel>
  86. <!--</Border>-->
  87. <ctrls:DrawGraphicsControl x:Name="MyDrawGraphicsControl" Grid.Row="1" IsHorizontalNavigationEnabled="{Binding ElementName=AutoXCheckBox,Path=IsChecked}" IsVerticalNavigationEnabled="{Binding ElementName=AutoYCheckBox,Path=IsChecked}" WavePlotOriginX="{Binding ElementName=MinXTextBox,Path=Text}" WavePlotOriginWidth="{Binding ElementName=MaxXTextBox,Path=Text}" WavePlotOriginY="{Binding ElementName=MinYTextBox,Path=Text}" WavePlotOriginHeight="{Binding ElementName=MaxYTextBox,Path=Text,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsHorizontalDateTimeAxis="True"/>
  88. </Grid>
  89. </Grid>
  90. </UserControl>