SineDataReviewView.axaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <UserControl
  2. x:Class="ShakerApp.Views.SineDataReviewView"
  3. xmlns="https://github.com/avaloniaui"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="using:ShakerApp"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:oxy="http://oxyplot.org/avalonia"
  9. xmlns:view="using:ShakerApp.Views"
  10. xmlns:vm="using:ShakerApp.ViewModels"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. x:DataType="vm:SineDataReviewViewModel"
  14. DataContext="{Binding CurrentDataReview}"
  15. mc:Ignorable="d">
  16. <TabControl>
  17. <TabItem Header="{DynamicResource TimeDomainData}">
  18. <view:TimeDomainReviewView />
  19. </TabItem>
  20. <TabItem Header="{DynamicResource SweepData}">
  21. <Grid RowDefinitions="40,*">
  22. <UniformGrid Margin="10,0,0,0" Rows="1">
  23. <StackPanel Orientation="Horizontal">
  24. <TextBlock VerticalAlignment="Center">
  25. <Run Text="{DynamicResource SweepDirection}" />
  26. <Run Text=":" />
  27. </TextBlock>
  28. <TextBlock VerticalAlignment="Center" Text="{local:ResourceBinding SweepDirection}" />
  29. </StackPanel>
  30. <StackPanel Orientation="Horizontal">
  31. <TextBlock VerticalAlignment="Center">
  32. <Run Text="{DynamicResource SweepCount}" />
  33. <Run Text=":" />
  34. </TextBlock>
  35. <ComboBox
  36. Width="120"
  37. ItemsSource="{Binding Frames}"
  38. SelectedValue="{Binding CurrentFrame}" />
  39. </StackPanel>
  40. </UniformGrid>
  41. <oxy:PlotView
  42. Grid.Row="1"
  43. Background="Transparent"
  44. Model="{Binding PlotModel}">
  45. <oxy:PlotView.DefaultTrackerTemplate>
  46. <ControlTemplate>
  47. <oxy:TrackerControl
  48. Background="#6F999999"
  49. BorderBrush="Transparent"
  50. CornerRadius="6"
  51. HorizontalLineVisibility="False"
  52. LineExtents="{Binding PlotModel.PlotArea}"
  53. LineStroke="Gray"
  54. Position="{Binding Position}"
  55. ShowPointer="True"
  56. VerticalLineVisibility="True">
  57. <oxy:TrackerControl.Content>
  58. <StackPanel Margin="10">
  59. <TextBlock Text="{DynamicResource Value}" />
  60. <TextBlock>
  61. <Run Text="{Binding XAxis.Title}" />
  62. <Run Text=":" />
  63. <Run Text="{Binding TrackerDatas[0].DataPoint.X, StringFormat='{}{0:F2}'}" />
  64. <Run Text="{Binding XAxis.Unit}" />
  65. </TextBlock>
  66. <ItemsControl ItemsSource="{Binding TrackerDatas}">
  67. <ItemsControl.ItemTemplate>
  68. <DataTemplate>
  69. <TextBlock IsVisible="{Binding Series.IsVisible}">
  70. <Run Text="{Binding Series.Title}" />
  71. <Run Text=":" />
  72. <Run Text="{Binding DataPoint.Y, StringFormat='{}{0:F4}'}" />
  73. <Run Text="{Binding $parent[ItemsControl].DataContext.YAxis.Unit}" />
  74. </TextBlock>
  75. </DataTemplate>
  76. </ItemsControl.ItemTemplate>
  77. </ItemsControl>
  78. </StackPanel>
  79. </oxy:TrackerControl.Content>
  80. </oxy:TrackerControl>
  81. </ControlTemplate>
  82. </oxy:PlotView.DefaultTrackerTemplate>
  83. </oxy:PlotView>
  84. <Button
  85. Grid.Row="1"
  86. Margin="0,0,16,56"
  87. HorizontalAlignment="Right"
  88. VerticalAlignment="Bottom"
  89. Classes="Basic"
  90. Cursor="Hand">
  91. <Interaction.Behaviors>
  92. <EventTriggerBehavior EventName="Click">
  93. <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding PlotModel}" />
  94. </EventTriggerBehavior>
  95. </Interaction.Behaviors>
  96. <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
  97. <PathIcon.Styles>
  98. <Style Selector="PathIcon:pointerover">
  99. <Setter Property="Foreground" Value="Black" />
  100. </Style>
  101. <Style Selector="PathIcon">
  102. <Setter Property="Foreground" Value="#AAAAAAAA" />
  103. </Style>
  104. </PathIcon.Styles>
  105. </PathIcon>
  106. </Button>
  107. </Grid>
  108. </TabItem>
  109. <TabItem Header="THD" IsVisible="{Binding THDReview.IsEnabled}">
  110. <view:THDReviewView />
  111. </TabItem>
  112. </TabControl>
  113. </UserControl>