THDReviewView.axaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <UserControl
  2. x:Class="ShakerApp.Views.THDReviewView"
  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:vm="using:ShakerApp.ViewModels"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. DataContext="{Binding Source={x:Static vm:DataReviewViewModel.Instance}, Path=CurrentDataReview.THDReview}"
  13. mc:Ignorable="d">
  14. <Grid RowDefinitions="56,*">
  15. <UniformGrid
  16. Height="56"
  17. Margin="10,0,0,0"
  18. Rows="1">
  19. <StackPanel Orientation="Horizontal">
  20. <TextBlock VerticalAlignment="Center" Text="{local:ResourceBinding Title}" />
  21. <ComboBox
  22. Width="108"
  23. Height="42"
  24. ItemsSource="{Binding Frames, Mode=OneWay}"
  25. SelectedValue="{Binding Current}" />
  26. </StackPanel>
  27. </UniformGrid>
  28. <oxy:PlotView
  29. Grid.Row="1"
  30. Background="Transparent"
  31. Model="{Binding PlotModel}">
  32. <oxy:PlotView.DefaultTrackerTemplate>
  33. <ControlTemplate>
  34. <oxy:TrackerControl
  35. Background="#6F999999"
  36. BorderBrush="Transparent"
  37. CornerRadius="6"
  38. HorizontalLineVisibility="False"
  39. LineExtents="{Binding PlotModel.PlotArea}"
  40. LineStroke="Gray"
  41. Position="{Binding Position}"
  42. ShowPointer="True"
  43. VerticalLineVisibility="True">
  44. <oxy:TrackerControl.Content>
  45. <StackPanel Margin="10">
  46. <TextBlock Text="{DynamicResource Value}" />
  47. <TextBlock>
  48. <Run Text="{Binding XAxis.Title}" />
  49. <Run Text=":" />
  50. <Run Text="{Binding TrackerDatas[0].DataPoint.X, StringFormat='{}{0:F2}'}" />
  51. <Run Text="{Binding XAxis.Unit}" />
  52. </TextBlock>
  53. <ItemsControl ItemsSource="{Binding TrackerDatas}">
  54. <ItemsControl.ItemTemplate>
  55. <DataTemplate>
  56. <TextBlock IsVisible="{Binding Series.IsVisible}">
  57. <Run Text="{Binding Series.Title}" />
  58. <Run Text=":" />
  59. <Run Text="{Binding DataPoint.Y, StringFormat='{}{0:F4}'}" />
  60. <Run Text="{Binding $parent[ItemsControl].DataContext.YAxis.Unit}" />
  61. </TextBlock>
  62. </DataTemplate>
  63. </ItemsControl.ItemTemplate>
  64. </ItemsControl>
  65. </StackPanel>
  66. </oxy:TrackerControl.Content>
  67. </oxy:TrackerControl>
  68. </ControlTemplate>
  69. </oxy:PlotView.DefaultTrackerTemplate>
  70. </oxy:PlotView>
  71. <Button
  72. Grid.Row="1"
  73. Margin="0,0,16,56"
  74. HorizontalAlignment="Right"
  75. VerticalAlignment="Bottom"
  76. Classes="Basic"
  77. Cursor="Hand">
  78. <Interaction.Behaviors>
  79. <EventTriggerBehavior EventName="Click">
  80. <InvokeCommandAction Command="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}, Path=PlotConfigCommand}" CommandParameter="{Binding PlotModel}" />
  81. </EventTriggerBehavior>
  82. </Interaction.Behaviors>
  83. <PathIcon Background="Transparent" Data="{StaticResource SettingGeometry}">
  84. <PathIcon.Styles>
  85. <Style Selector="PathIcon:pointerover">
  86. <Setter Property="Foreground" Value="Black" />
  87. </Style>
  88. <Style Selector="PathIcon">
  89. <Setter Property="Foreground" Value="#AAAAAAAA" />
  90. </Style>
  91. </PathIcon.Styles>
  92. </PathIcon>
  93. </Button>
  94. </Grid>
  95. </UserControl>