123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- <UserControl
- x:Class="ShakerManger.View.SetPlotConfigView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- Width="800"
- Height="616"
- d:DataContext="{d:DesignInstance {x:Type vm:ShakerControlViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- Foreground="{StaticResource LableBrush}"
- mc:Ignorable="d">
- <Border
- Background="{StaticResource MainBrush}"
- BorderBrush="{StaticResource AuxiliaryBrush}"
- BorderThickness="1"
- CornerRadius="6">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="46" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Background="{StaticResource EmbellishBrush}" CornerRadius="6,6,0,0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="66" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.ColumnSpan="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="36"
- Foreground="{StaticResource MainBrush}"
- Text="波形设置" />
- <Button
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource CloseGeometry}">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Setter Property="Foreground" Value="{StaticResource MainBrush}" />
- </Style>
- </Button.Style>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:SetPropertyAction
- PropertyName="SetPlotConfigIsOpen"
- PropertyValue="False"
- TargetObject="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Button}, Path=DataContext}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- </Grid>
- </Border>
- <ListView
- Grid.Row="1"
- Margin="10"
- ItemsSource="{Binding PlotConfig}">
- <ListView.Style>
- <Style TargetType="ListView">
- <Setter Property="Background" Value="White" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListView}">
- <Border
- BorderBrush="{StaticResource AuxiliaryBrush}"
- BorderThickness="1"
- CornerRadius="6,6,0,0">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="42" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Background="{StaticResource EmbellishBrush}" CornerRadius="6,6,0,0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="46" />
- <ColumnDefinition Width="280" />
- <ColumnDefinition Width="126" />
- <ColumnDefinition Width="126" />
- <ColumnDefinition Width="80" />
- <ColumnDefinition Width="120" />
- </Grid.ColumnDefinitions>
- <Line
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="1"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="2"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="3"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="4"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="可见" />
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="曲线名称" />
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="数据点样式" />
- <TextBlock
- Grid.Column="3"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="曲线样式" />
- <TextBlock
- Grid.Column="4"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="线宽" />
- <TextBlock
- Grid.Column="5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="{StaticResource MainBrush}"
- Text="曲线颜色" />
- </Grid>
- </Border>
- <ScrollViewer
- Grid.Row="1"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ScrollViewer>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="46" />
- <ColumnDefinition Width="280" />
- <ColumnDefinition Width="126" />
- <ColumnDefinition Width="126" />
- <ColumnDefinition Width="80" />
- <ColumnDefinition Width="120" />
- </Grid.ColumnDefinitions>
- <Line
- Grid.ColumnSpan="6"
- VerticalAlignment="Bottom"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border}, Path=ActualWidth}"
- Y1="0"
- Y2="0" />
- <Line
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="1"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="2"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="3"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <Line
- Grid.Column="4"
- HorizontalAlignment="Right"
- Stroke="{StaticResource AuxiliaryBrush}"
- StrokeThickness="1"
- X1="0"
- X2="0"
- Y1="0"
- Y2="42" />
- <CheckBox
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- IsChecked="{Binding IsVisible}" />
- <TextBlock
- Grid.Column="1"
- Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border, AncestorLevel=1}, Path=Width}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- IsEnabled="{Binding IsVisible}"
- Text="{Binding Name, Mode=OneWay}">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Foreground" Value="{StaticResource TextInfoBrush}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- <ComboBox
- Grid.Column="2"
- Width="126"
- Height="42"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- DisplayMemberPath="Description"
- IsEnabled="{Binding IsVisible}"
- ItemsSource="{Binding MarkerType, Converter={StaticResource EnumToCollectionConverter}, ConverterParameter='0,1,2,3,4,5,6,7', Mode=OneTime}"
- SelectedValue="{Binding MarkerType}"
- SelectedValuePath="Value"
- Style="{StaticResource ComboBoxStyle1}" />
- <ComboBox
- Grid.Column="3"
- Width="126"
- Height="42"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- DisplayMemberPath="Description"
- IsEnabled="{Binding IsVisible}"
- ItemsSource="{Binding LineStyle, Converter={StaticResource EnumToCollectionConverter}, Mode=OneTime}"
- SelectedValue="{Binding LineStyle}"
- SelectedValuePath="Value"
- Style="{StaticResource ComboBoxStyle1}" />
- <hc:NumericUpDown
- Grid.Column="4"
- Width="80"
- Height="42"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- Background="Transparent"
- CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
- FontSize="14"
- Increment="1"
- IsEnabled="{Binding IsVisible}"
- Maximum="20"
- Minimum="1"
- Value="{Binding StrokeThickness}" />
- <Border
- x:Name="color"
- Grid.Column="5"
- Background="{Binding StrokeColor, Converter={StaticResource OxyPlotColorToSolidBrushConverter}}"
- Cursor="Hand"
- IsEnabled="{Binding IsVisible}">
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="MouseUp">
- <hc:SetPropertyAction
- PropertyName="PlotConfig"
- PropertyValue="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border}, Path=DataContext}"
- TargetObject="{StaticResource ColorPicker}" />
- <hc:SetPropertyAction
- PropertyName="IsOpen"
- PropertyValue="True"
- TargetObject="{StaticResource ColorPicker}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Border>
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Height" Value="42" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <ContentPresenter />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- </Grid>
- </Border>
- </UserControl>
|