LinePicker.xaml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <UserControl x:Class="ProximaAnalizer.Views.Dialog.LinePicker"
  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:ProximaAnalizer.Views.Dialog"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <Grid Margin="16">
  10. <Grid.ColumnDefinitions>
  11. <ColumnDefinition Width="auto"/>
  12. <ColumnDefinition Width="16"/>
  13. <ColumnDefinition Width="auto"/>
  14. </Grid.ColumnDefinitions>
  15. <GroupBox Background="Transparent" BorderBrush="{StaticResource DarkBorderColor}" Header="添加左侧坐标轴">
  16. <ItemsControl ItemsSource="{Binding LineCollection.LinesSolid}" Margin="8">
  17. <ItemsControl.ItemTemplate>
  18. <DataTemplate>
  19. <Button Width="140" Height="24" Margin="4" Background="Transparent" IsEnabled="{Binding IsEnable}"
  20. Command="{Binding RelativeSource={RelativeSource AncestorType=local:LinePicker, Mode=FindAncestor}, Path=DataContext.SelectLeftLineCommand}"
  21. CommandParameter="{Binding}">
  22. <Line X1="0" Y1="0" X2="100" Y2="0" Margin="8,0" Stretch="Fill" Stroke="{Binding Brush}" StrokeDashArray="{Binding DashArray}" StrokeThickness="3"/>
  23. </Button>
  24. </DataTemplate>
  25. </ItemsControl.ItemTemplate>
  26. </ItemsControl>
  27. </GroupBox>
  28. <GroupBox Grid.Column="2" Background="Transparent" BorderBrush="{StaticResource DarkBorderColor}" Header="添加右侧坐标轴">
  29. <ItemsControl ItemsSource="{Binding LineCollection.LinesDash}" Margin="8">
  30. <ItemsControl.ItemTemplate>
  31. <DataTemplate>
  32. <Button Width="140" Height="24" Margin="4" Background="Transparent" IsEnabled="{Binding IsEnable}"
  33. Command="{Binding RelativeSource={RelativeSource AncestorType=local:LinePicker, Mode=FindAncestor}, Path=DataContext.SelectRightLineCommand}"
  34. CommandParameter="{Binding}">
  35. <Line X1="0" Y1="0" X2="100" Y2="0" Margin="8,0" Stretch="Fill" Stroke="{Binding Brush}" StrokeDashArray="{Binding DashArray}" StrokeThickness="3"/>
  36. </Button>
  37. </DataTemplate>
  38. </ItemsControl.ItemTemplate>
  39. </ItemsControl>
  40. </GroupBox>
  41. </Grid>
  42. </UserControl>