PlotConfigView.axaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <UserControl
  2. x:Class="ShakerApp.Views.PlotConfigView"
  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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:vm="using:ShakerApp.ViewModels"
  8. d:DesignHeight="600"
  9. d:DesignWidth="750"
  10. x:DataType="vm:PlotConfigViewModel"
  11. DataContext="{Binding Source={x:Static vm:PlotConfigViewModel.Instance}}"
  12. mc:Ignorable="d">
  13. <Grid>
  14. <StackPanel IsVisible="{Binding !NoSeries}" Orientation="Vertical">
  15. <Grid
  16. Height="42"
  17. Background="#3FAAAAAA"
  18. ColumnDefinitions="200,150,200,*,80">
  19. <TextBlock
  20. HorizontalAlignment="Center"
  21. VerticalAlignment="Center"
  22. FontWeight="Bold"
  23. Text="{DynamicResource PlotName}" />
  24. <TextBlock
  25. Grid.Column="1"
  26. HorizontalAlignment="Center"
  27. VerticalAlignment="Center"
  28. FontWeight="Bold"
  29. Text="{DynamicResource PlotColor}" />
  30. <TextBlock
  31. Grid.Column="2"
  32. HorizontalAlignment="Center"
  33. VerticalAlignment="Center"
  34. FontWeight="Bold"
  35. Text="{DynamicResource PlotLineStyle}" />
  36. <TextBlock
  37. Grid.Column="3"
  38. HorizontalAlignment="Center"
  39. VerticalAlignment="Center"
  40. FontWeight="Bold"
  41. Text="{DynamicResource PlotMarkerType}" />
  42. <TextBlock
  43. Grid.Column="4"
  44. HorizontalAlignment="Center"
  45. VerticalAlignment="Center"
  46. FontWeight="Bold"
  47. Text="{DynamicResource PlotStrokeThickness}" />
  48. </Grid>
  49. <ScrollViewer Height="450">
  50. <ItemsControl ItemsSource="{Binding SeriesConfigs}">
  51. <ItemsControl.ItemTemplate>
  52. <DataTemplate>
  53. <Grid
  54. Height="42"
  55. x:DataType="vm:SeriesConfigViewModel"
  56. ColumnDefinitions="200,150,200,*,80">
  57. <TextBlock
  58. HorizontalAlignment="Center"
  59. VerticalAlignment="Center"
  60. Text="{Binding Name}" />
  61. <ColorPicker
  62. Grid.Column="1"
  63. Width="130"
  64. Margin="10,0,10,0"
  65. Color="{Binding Color}" />
  66. <ComboBox
  67. Grid.Column="2"
  68. HorizontalAlignment="Center"
  69. VerticalAlignment="Center"
  70. HorizontalContentAlignment="Center"
  71. VerticalContentAlignment="Center"
  72. DisplayMemberBinding="{Binding Key}"
  73. ItemsSource="{Binding LineStyle, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  74. SelectedValue="{Binding LineStyle}"
  75. SelectedValueBinding="{Binding Value}" />
  76. <ComboBox
  77. Grid.Column="3"
  78. HorizontalAlignment="Center"
  79. VerticalAlignment="Center"
  80. HorizontalContentAlignment="Center"
  81. VerticalContentAlignment="Center"
  82. DisplayMemberBinding="{Binding Key}"
  83. ItemsSource="{Binding MarkerType, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
  84. SelectedValue="{Binding MarkerType}"
  85. SelectedValueBinding="{Binding Value}" />
  86. <NumericUpDown
  87. Grid.Column="4"
  88. HorizontalAlignment="Center"
  89. VerticalAlignment="Center"
  90. HorizontalContentAlignment="Center"
  91. VerticalContentAlignment="Center"
  92. Maximum="10"
  93. Minimum="1"
  94. Value="{Binding StrokeThickness}" />
  95. </Grid>
  96. </DataTemplate>
  97. </ItemsControl.ItemTemplate>
  98. </ItemsControl>
  99. </ScrollViewer>
  100. </StackPanel>
  101. <TextBlock
  102. HorizontalAlignment="Center"
  103. VerticalAlignment="Center"
  104. FontSize="42"
  105. IsVisible="{Binding NoSeries}"
  106. Text="{DynamicResource NoSeries}" />
  107. </Grid>
  108. </UserControl>