123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- <UserControl
- x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SharpsAnnotProperty"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
- xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
- xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
- xmlns:cus="clr-namespace:PDF_Office.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- d:DesignHeight="450"
- d:DesignWidth="260"
- Background="{StaticResource color.sys.layout.mg}"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
- <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert" />
- <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
- <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
- <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
- <Style x:Key="line1Style" TargetType="{x:Type Line}">
- <Setter Property="Visibility">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
- <Binding ElementName="SharpRectBtn" Path="IsChecked" />
- <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="line2Style" TargetType="{x:Type Line}">
- <Setter Property="Visibility">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
- <Binding ElementName="SharpCircleBtn" Path="IsChecked" />
- <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="line3Style" TargetType="{x:Type Line}">
- <Setter Property="Visibility">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
- <Binding ElementName="SharpArrowBtn" Path="IsChecked" />
- <Binding ElementName="SharpLineBtn" Path="IsChecked" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid Margin="16,0,16,0">
- <StackPanel>
- <TextBlock
- Name="AnnotTypeTitle"
- Margin="10,8,0,0"
- HorizontalAlignment="Left"
- FontFamily="SegoeUI"
- FontSize="18"
- FontWeight="Bold"
- LineHeight="24"
- Text="{Binding BasicVm.AnnotTypeTitle}" />
- <Border
- Width="228"
- Height="100"
- Margin="0,8,0,0"
- Background="White"
- BorderBrush="#DDDDDD"
- BorderThickness="1"
- CornerRadius="2"
- Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
- <Grid>
- <Path
- Name="SharpPath"
- Width="36"
- Height="36"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="{Binding DataPath}"
- Fill="{Binding BasicVm.FillColor}"
- Opacity="{Binding BasicVm.FillOpacity}"
- Stroke="{Binding BasicVm.BorderColor}"
- StrokeDashArray="{Binding Dash, Converter={StaticResource DashStyleConverter}}"
- StrokeStartLineCap="Flat"
- StrokeThickness="{Binding BasicVm.AnnotThickness}">
- <!-- ,Converter={StaticResource ColorToBrushConvert} -->
- </Path>
- </Grid>
- </Border>
- <Border
- Width="162"
- Height="32"
- Margin="0,12,0,0"
- BorderBrush="#FFE2E3E6"
- BorderThickness="0" HorizontalAlignment="Left"
- Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
- <Grid Name="ToolGrid">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40.5" />
- <ColumnDefinition Width="40.5" />
- <ColumnDefinition Width="40.5" />
- <ColumnDefinition Width="40.5" />
- </Grid.ColumnDefinitions>
- <RadioButton x:Name="SharpRectBtn" Tag="Rect" GroupName="Shape"
- Width="32" Height="32" Margin="0,0" ToolTip="矩形" Padding="7,0,0,0"
- VerticalContentAlignment="Center" Background="Transparent"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Rectangle
- Width="16"
- Height="16"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Stroke="#273C62" />
- </RadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpRectBtn, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton x:Name="SharpCircleBtn" Tag="Circle" GroupName="Shape" Grid.Column="1"
- Width="32" Height="32" Margin="0,0" ToolTip="圆" Padding="7,0,0,0"
- VerticalContentAlignment="Center" Background="Transparent"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Ellipse
- Width="16"
- Height="16"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Stroke="#273C62" />
- </RadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpCircleBtn, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton x:Name="SharpArrowBtn" Tag="Arrow" GroupName="Shape" Grid.Column="2"
- Width="32" Height="32" Margin="0,0" ToolTip="箭头" Padding="7,0,0,0"
- VerticalContentAlignment="Center" Background="Transparent"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Path
- Width="16"
- Height="16"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Fill="#273C62">
- <Path.Data>
- M13.4,2.6 L13.4,8 L12.2,8 L12.1997359,4.648 L2.02426407,14.8242641 L1.17573593,13.9757359 L11.3517359,3.799 L8,3.8 L8,2.6 L13.4,2.6 Z
- </Path.Data>
- </Path>
- </RadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpArrowBtn, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton x:Name="SharpLineBtn" Tag="Line" GroupName="Shape" Grid.Column="3"
- Width="32" Height="32" Margin="0,0" ToolTip="线条" Padding="7,0,0,0"
- VerticalContentAlignment="Center" Background="Transparent"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Polygon
- Width="16"
- Height="16"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Fill="#273C62">
- <Polygon.Points>
- 13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
- </Polygon.Points>
- </Polygon>
- </RadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpLineBtn, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- </Grid>
- </Border>
- <Grid x:Name="GridFill" Margin="0,18,0,0" Visibility="{Binding IsLineAnnot,Converter={StaticResource InvertBoolToVisibleConvert}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock Text="Fill" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" />
- <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right"
- InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
- Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedValueChanged">
- <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerFill,Path=Value}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:SlidContent>
- <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" Margin="0,8,0,0"
- ItemSource="{Binding BasicVm.FillColorItems}"
- ColorType="Fill"
- UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedColorInvoke">
- <i:InvokeCommandAction Command="{Binding SelectedFillColorCommand}" CommandParameter="{Binding ElementName=cusFillColor,Path=SelectedColor}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:ColorContent>
- </Grid>
- <Grid Margin="0,18,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock Text="Border" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" />
- <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
- InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
- Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedValueChanged">
- <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:SlidContent>
- <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" Margin="0,8,0,0"
- ItemSource="{Binding BasicVm.ColorItems}"
- ColorType="Border"
- UIColor="{Binding BasicVm.CurrentBorderColor,Mode=OneWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedColorInvoke">
- <i:InvokeCommandAction Command="{Binding SelectedBorderColorCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:ColorContent>
- </Grid>
- <CompositeControl:SlidComboControl x:Name="thickness" Margin="0,0,0,0" ItemsSource="{Binding ThicknessItems}" Value="{Binding BasicVm.AnnotThickness,Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="ValueChanged">
- <i:InvokeCommandAction Command="{Binding SelectedThickCommand}" CommandParameter="{Binding ElementName=thickness,Path=Value}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:SlidComboControl>
- <StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
- <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
- Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
- VerticalContentAlignment="Center" Background="Transparent"
- Command="{Binding LineStyleCommand}"
- CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}"
- IsChecked="{Binding BasicVm.IsSolidLine}"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
- </RadioButton.Content>
- </RadioButton>
- <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
- Width="105" Height="32" Margin="0,0" Foreground="#616469"
- VerticalContentAlignment="Center" Background="Transparent"
- Command="{Binding LineStyleCommand}"
- CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}"
- IsChecked="{Binding BasicVm.IsDashLine}"
- Style="{DynamicResource GreyBgRadioBtnStyle}">
- <RadioButton.Content>
- <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2" />
- </RadioButton.Content>
- </RadioButton>
- </StackPanel>
- </StackPanel>
- </Grid>
- </UserControl>
|