123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <UserControl
- x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.FreehandAnnotProperty"
- 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:EraseThickConvert="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:DataContext="{d:DesignInstance Type=EraseThickConvert:FreehandAnnotPropertyViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="260"
- Background="{StaticResource color.sys.layout.mg}"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
- <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <Convert:InvertBoolConvert x:Key="InvertBoolConvert" />
- <Convert:BoolToVisible x:Key="BoolToVisible" />
- <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
- <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
- <EraseThickConvert:EraseThicknessConverter x:Key="EraseThicknessConverter" />
- <Style x:Key="lineStyle" TargetType="{x:Type Line}">
- <Setter Property="Visibility">
- <Setter.Value>
- <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
- <Binding ElementName="PenBtn" Path="IsChecked" />
- <Binding ElementName="EraseBtn" 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="224"
- Height="28"
- Margin="0,16,0,0"
- Padding="2"
- Background="{StaticResource color.sys.layout.fg.dark}"
- CornerRadius="4"
- Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
- <StackPanel Orientation="Horizontal">
- <RadioButton
- x:Name="PenBtn"
- Width="112"
- Height="28"
- Padding="0"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Command="{Binding PenCommand}"
- CommandParameter="{Binding ElementName=PenBtn}"
- GroupName="Mode"
- IsChecked="{Binding IsPen}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="GridMode"
- ToolTip="画笔">
- <Image Width="16" Height="16">
- <Image.Source>
- <DrawingImage>
- <DrawingImage.Drawing>
- <DrawingGroup ClipGeometry="M0,0 V16 H17 V0 H0 Z">
- <DrawingGroup.Transform>
- <TranslateTransform X="0" Y="2.3891999489933369E-13" />
- </DrawingGroup.Transform>
- <DrawingGroup Opacity="1">
- <DrawingGroup Opacity="1" Transform="1,0,0,1,-1759,-284">
- <DrawingGroup Opacity="1" Transform="1,0,0,1,1664,144">
- <DrawingGroup Opacity="1" Transform="1,0,0,1,79,132">
- <DrawingGroup Opacity="1" Transform="1,0,0,1,16.5,7">
- <DrawingGroup Opacity="1" Transform="1,0,0,1,0,0.601398">
- <DrawingGroup Transform="0.707106781186548,0.707106781186547,-0.707106781186547,0.707106781186548,7.88325217719452,-3.03185432179024">
- <GeometryDrawing Brush="{Binding ElementName=PenBtn, Path=Foreground}" Geometry="F0 M17,16z M0,0z M9.3513979,-2.38919995E-13C9.90368265,-2.38919995E-13,10.3513979,0.450295066,10.3513979,1.00576218L10.3513979,1.00576218 10.3513979,11.8051336 7.6013979,16 4.8513979,11.8051336 4.8513979,1.00576218C4.8513979,0.450295066,5.29911315,-2.38919995E-13,5.8513979,-2.38919995E-13L5.8513979,-2.38919995E-13z M7.60473447,11.7101997C7.11907276,11.7101997,6.63199763,11.78823,6.14217677,11.9453384L7.60173447,14.1723055 9.06200843,11.9436467C8.57396851,11.7876698,8.08864986,11.7101997,7.60473447,11.7101997z M9.3513979,3.161L5.8513979,3.161 5.85115502,10.9830388C6.43339754,10.7976506 7.01836385,10.7044375 7.60473447,10.7044375 8.18875558,10.7044375 8.77138361,10.7969051 9.35131488,10.9808148L9.3513979,3.161z M9.3513979,1.00576218L5.8513979,1.00576218 5.8513979,2.155 9.3513979,2.155 9.3513979,1.00576218z" />
- </DrawingGroup>
- <GeometryDrawing Brush="{Binding ElementName=PenBtn, Path=Foreground}" Geometry="F0 M17,16z M0,0z M1.29862352,15.7862914L1,14.829082 2.11583633,14.4674158 3.15406592,14.1429482 3.80363818,13.9473535 4.41951961,13.7683686 5.28087243,13.5311015 5.81392871,13.3937753 6.31441568,13.2731665 6.78265376,13.1693059 7.21896338,13.0822242 7.62366497,13.0119522C7.68849903,13.0016428,7.75202945,12.992035,7.81426289,12.9831295L8.17215324,12.9381299C8.28629773,12.9259427,8.39530772,12.91657,8.49923663,12.9100169L8.79583349,12.8988214C9.26493417,12.8942772 9.60834275,12.9603508 9.83273483,13.0976833 10.068274,13.2418381 10.2415014,13.4084688 10.3508877,13.6058206 10.5552187,13.9744691 10.5216162,14.2710014 10.3376925,14.6810881L10.2229683,14.9193983C10.2817235,14.9238084,10.3581498,14.9219184,10.4516286,14.9136535L10.6611397,14.8886018 10.9150249,14.8464174 11.2121845,14.7869671C11.2652562,14.7756125,11.3200852,14.7635329,11.3766486,14.7507256L11.7366584,14.6651269 12.137194,14.5619295 12.5771557,14.4410004 13.3086174,14.2260685 13.8423344,14.0602276 14.4116293,13.8761891 14.6967022,13.7815159 15,14.7371732 14.0940685,15.0341015 13.5390453,15.2080944 13.0222263,15.3628032 12.5428049,15.498128 12.0999746,15.6139689 11.692929,15.710226C11.6280253,15.7246313,11.5645791,15.7382165,11.5025734,15.7509794L11.1476927,15.8176735C10.3593478,15.9501927 9.84677889,15.9207377 9.56388238,15.7235969 9.07242318,15.3811161 9.08228965,15.0467022 9.33958239,14.4900411L9.46369549,14.2289552 9.49505041,14.1493245C9.5039287,14.1213806 9.50387062,14.1091441 9.50055695,14.1031657 9.48301036,14.0715086 9.43206472,14.022503 9.33190506,13.9612033 9.23927091,13.9045093 9.07240971,13.8771492 8.83379185,13.8793603L8.61174683,13.888503 8.3549014,13.9121628 8.06360129,13.9503729 7.73819222,14.0031665 7.37901988,14.0705767 6.98643,14.152637 6.5607683,14.2493803 6.10238048,14.36084 5.61161226,14.4870492 4.81550294,14.7040912 3.94848235,14.9545065 2.68416517,15.3405013 1.65622248,15.6692235 1.29862352,15.7862914z" />
- </DrawingGroup>
- </DrawingGroup>
- </DrawingGroup>
- </DrawingGroup>
- </DrawingGroup>
- </DrawingGroup>
- </DrawingGroup>
- </DrawingImage.Drawing>
- </DrawingImage>
- </Image.Source>
- </Image>
- </RadioButton>
- <RadioButton
- x:Name="EraseBtn"
- Width="112"
- Height="28"
- Padding="0"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Command="{Binding EraseCommand}"
- CommandParameter="{Binding ElementName=EraseBtn}"
- GroupName="Mode"
- IsChecked="{Binding IsPen, Converter={StaticResource InvertBoolConvert}}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="ListMode"
- ToolTip="橡皮擦">
- <Path
- Width="16"
- Height="16"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M11,1.796875 L16.703125,7.5 L9.2109375,15 L5.0390625,15 L2.3984375, 12.3515625 L2.30688477,12.2502441 C2.22143555,12.1452637 2.15429688,12.0292969 2.10546875,11.9023438 C2.04036458,11.7330729 2.0078125,11.5572917 2.0078125, 11.375 C2.0078125,11.1927083 2.04036458,11.0169271 2.10546875,10.8476562 C2.15429688,10.7207031 2.2199707, 10.6062012 2.30249023,10.5041504 L2.390625,10.40625 L11,1.796875 Z M17.5,14 L17.5,15 L10.5,15 L11.5181818, 14 L17.5,14 Z M2.56227106,14 L3.5,15 L1.5,15 L1.5,14 L2.56227106,14 Z M5,9.203125 L3.1015625,11.1015625 L3.05712891, 11.1567383 C3.01904297,11.2163086 3,11.2890625 3,11.375 C3,11.4609375 3.02050781,11.5351562 3.06152344,11.5976562 L3.109375, 11.65625 L5.453125,14 L8.7890625,14 L9.296875,13.5 L5,9.203125 Z M11,3.203125 L5.703125,8.5 L10,12.796875 L15.296875,7.5 L11,3.203125 Z"
- Fill="{Binding ElementName=EraseBtn, Path=Foreground}" />
- </RadioButton>
- </StackPanel>
- </Border>
- <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 HorizontalAlignment="Center" VerticalAlignment="Center">
- <Path
- Name="FreehandPath"
- Data="M1 25C5.12875 18.3502 10.3975 12.6666 16.9494 8.65676C22.3906 5.32666 29.6822 4.41812 35.8348 5.34323C50.1181 7.49086 60.8395 19.2854 74.6384 22.835C80.312 24.2945 86.1855 25.2489 91.8692 23.3366C96.737 21.6988 101.081 18.9771 104.932 15.4686C109.678 11.1449 114.025 6.91941 117 1"
- Stroke="{Binding BasicVm.FontColor}"
- StrokeDashArray="{Binding StrokeDashArray}"
- StrokeThickness="{Binding BasicVm.AnnotThickness}"
- Visibility="{Binding IsPen, Converter={StaticResource BoolToVisible}}" />
- <Ellipse
- Name="ErasePath"
- Width="{Binding EraseThicknessLine, Converter={StaticResource EraseThicknessConverter}}"
- Height="{Binding EraseThicknessLine, Converter={StaticResource EraseThicknessConverter}}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Fill="#1A000000"
- Visibility="{Binding IsPen, Converter={StaticResource InvertBoolToVisibleConvert}}" />
- </Grid>
- </Border>
- <StackPanel x:Name="PnlPen" Visibility="{Binding IsPen, Converter={StaticResource BoolToVisible}}">
- <Grid Margin="0,18,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- FontFamily="Segoe UI"
- FontSize="12"
- Foreground="{StaticResource color.sys.text.neutral.lv2}"
- Text="Color" />
- <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"
- ColorType="Border"
- ItemSource="{Binding BasicVm.ColorItems}"
- UIColor="{Binding BasicVm.CurrentFontColor, Mode=OneWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedColorInvoke">
- <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" 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 PenSizeItems}"
- Value="{Binding BasicVm.AnnotThickness, Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="ValueChanged">
- <i:InvokeCommandAction Command="{Binding SelectPenThickChangedCommand}" CommandParameter="{Binding ElementName=thickness, Path=Value}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:SlidComboControl>
- <StackPanel Margin="0,20,0,0" Orientation="Horizontal">
- <RadioButton
- x:Name="BtnSolid"
- Width="105"
- Height="32"
- Margin="0,0,10,0"
- VerticalContentAlignment="Center"
- Background="Transparent"
- Command="{Binding LineModeCheckedCommand}"
- CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}"
- Foreground="#616469"
- GroupName="LineMode"
- IsChecked="{Binding BasicVm.IsSolidLine}"
- Style="{DynamicResource GreyBgRadioBtnStyle}"
- Tag="Solid">
- <RadioButton.Content>
- <Line
- Stroke="Black"
- StrokeThickness="2"
- X1="10"
- X2="90"
- Y1="5"
- Y2="5" />
- </RadioButton.Content>
- </RadioButton>
- <RadioButton
- x:Name="BtnDashed"
- Width="105"
- Height="32"
- Margin="0,0"
- VerticalContentAlignment="Center"
- Background="Transparent"
- Command="{Binding LineModeCheckedCommand}"
- CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}"
- Foreground="#616469"
- GroupName="LineMode"
- IsChecked="{Binding BasicVm.IsDashLine}"
- Style="{DynamicResource GreyBgRadioBtnStyle}"
- Tag="Dashed">
- <RadioButton.Content>
- <Line
- Stroke="Black"
- StrokeDashArray="2"
- StrokeThickness="2"
- X1="10"
- X2="90"
- Y1="5"
- Y2="5" />
- </RadioButton.Content>
- </RadioButton>
- </StackPanel>
- </StackPanel>
- <StackPanel x:Name="PnlEraser" Visibility="{Binding IsPen, Converter={StaticResource InvertBoolToVisibleConvert}}">
- <CompositeControl:SlidComboControl
- x:Name="Eraserthickness"
- HorizontalAlignment="Stretch"
- ItemsSource="{Binding EraserSizeItems}"
- Value="{Binding EraseThicknessLine, Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="ValueChanged">
- <i:InvokeCommandAction Command="{Binding SetEraserThickCommand}" CommandParameter="{Binding ElementName=Eraserthickness, Path=Value}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </CompositeControl:SlidComboControl>
- </StackPanel>
- </StackPanel>
- </Grid>
- </UserControl>
|