123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- <UserControl
- x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.StampAnnotProperty"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
- xmlns:customcontrol="clr-namespace:PDF_Master.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
- xmlns:dd="clr-namespace:PDFSettings;assembly=PDFSettings"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:model="clr-namespace:PDF_Master.Model.AnnotPanel"
- Width="260"
- d:DataContext="{d:DesignInstance Type=annotpanel:StampAnnotPropertyViewModel}"
- Background="{StaticResource color.sys.layout.mg}"
- Loaded="UserControl_Loaded"
- mc:Ignorable="d">
- <UserControl.Resources>
- <PathGeometry x:Key="Ic_SettingButtonPath" Figures="M8.24998 1.87558L13.1782 4.72088C13.3329 4.8102 13.4282 4.97526 13.4282 5.15389V10.8445C13.4282 11.0231 13.3329 11.1882 13.1782 11.2775L8.24998 14.1228C8.09528 14.2121 7.90468 14.2121 7.74998 14.1228L2.82178 11.2775C2.66708 11.1882 2.57178 11.0231 2.57178 10.8445V5.15389C2.57178 4.97526 2.66708 4.8102 2.82178 4.72088L7.74998 1.87558C7.90468 1.78626 8.09528 1.78626 8.24998 1.87558ZM6.99998 0.576543C7.61878 0.219277 8.38118 0.219277 8.99998 0.576543L13.9282 3.42184C14.547 3.77911 14.9282 4.43936 14.9282 5.15389V10.8445C14.9282 11.559 14.547 12.2193 13.9282 12.5765L8.99998 15.4218C8.38118 15.7791 7.61878 15.7791 6.99998 15.4218L2.07178 12.5765C1.45298 12.2193 1.07178 11.559 1.07178 10.8445V5.15389C1.07178 4.43936 1.45298 3.77911 2.07178 3.42184L6.99998 0.576543ZM9.99998 7.99919C9.99998 9.10376 9.10455 9.99919 7.99998 9.99919C6.89541 9.99919 5.99998 9.10376 5.99998 7.99919C5.99998 6.89462 6.89541 5.99919 7.99998 5.99919C9.10455 5.99919 9.99998 6.89462 9.99998 7.99919ZM11.5 7.99919C11.5 9.93219 9.93298 11.4992 7.99998 11.4992C6.06698 11.4992 4.49998 9.93219 4.49998 7.99919C4.49998 6.0662 6.06698 4.49919 7.99998 4.49919C9.93298 4.49919 11.5 6.0662 11.5 7.99919Z" />
- <dataconvert:BoolToVisible x:Key="BoolToVisible" />
- <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
- <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
- <Style TargetType="{x:Type TabItem}">
- <Setter Property="Width" Value="74.67 " />
- <Setter Property="Height" Value="28" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Template" Value="{StaticResource Segmented}" />
- </Style>
- <SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA" />
- <SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da" />
- <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA" />
- <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA" />
- <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA" />
- <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA" />
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="16" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="16" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="AnnoteTypeTitle"
- Margin="0,14"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="14"
- FontWeight="SemiBold" />
- <customcontrol:PathButton
- Grid.Column="1"
- Width="24"
- Height="24"
- Command="{Binding ShowDialogCommand}"
- Icon="{StaticResource Ic_SettingButtonPath}"
- IconFill="#616469"
- IconHeight="16"
- IconMouseOver="{StaticResource Ic_SettingButtonPath}"
- IconMouseOverFill="#C04CF8"
- IconPress="{StaticResource Ic_SettingButtonPath}"
- IconPressFill="#C04CF8"
- IconWidth="16"
- Visibility="{Binding UnStandard, Converter={StaticResource BoolToVisible}}" />
- </Grid>
- <Grid Grid.Row="1" Grid.Column="1">
- <ListBox
- Height="auto"
- VerticalAlignment="Top"
- Background="Transparent"
- BorderThickness="0"
- ItemsSource="{Binding StandardStampList}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- SelectionMode="Single">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ContextMenu>
- <ContextMenu>
- <MenuItem Header="{Binding T_MenuRightMenuStampAnnot_Export}">
- <MenuItem
- x:Name="SavePNG"
- Click="Save_Click"
- Header="{Binding T_MenuRightMenuStampAnnotExport_PNG}"
- Tag="PNG" />
- <MenuItem
- x:Name="SavePDF"
- Click="Save_Click"
- Header="{Binding T_MenuRightMenuStampAnnotExport_PDF}"
- Tag="PDF" />
- </MenuItem>
- </ContextMenu>
- </Grid.ContextMenu>
- <Image
- Height="40"
- Source="{Binding SourcePath}"
- Stretch="Uniform" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Height" Value="65" />
- <Setter Property="Padding" Value="8" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border
- x:Name="Bd"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="8"
- SnapsToDevicePixels="true">
- <ContentPresenter
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.hov.bg}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="False" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource Item.SelectedInactive.Background}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource Item.SelectedInactive.Border}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="True" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- <!--<TabControl Padding="0" Grid.Column="1" BorderThickness="0" Grid.Row="1" Name="StampTabControl" SelectedIndex="{Binding TabControlSelectedIndex,Mode=TwoWay}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Style="{StaticResource FormTabControl}">
- <TabItem x:Name="TabStandard"
- Header="Standard"
- FontFamily="Segoe UI"
- HorizontalContentAlignment="Center"
- FontSize="12"
- IsSelected="True">
- <Grid>
- <ListBox ItemsSource="{Binding StandardStampList}" SelectionMode="Single" Height="auto" VerticalAlignment="Top" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ContextMenu>
- <ContextMenu>
- <MenuItem Header="导出图章">
- <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click" />
- <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click" />
- </MenuItem>
- </ContextMenu>
- </Grid.ContextMenu>
- <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="40" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Height" Value="65" />
- <Setter Property="Padding" Value="8" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="False" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="True" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}" />
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- </TabItem>
- <TabItem x:Name="TabDydamic"
- Header="Dynamic"
- FontFamily="Segoe UI" Foreground="#FF666666"
- HorizontalContentAlignment="Center"
- FontSize="12">
- <ListBox Tag="Dynamic" DataContext="{Binding}" ItemsSource="{Binding DynamicStampList}" Loaded="DydamicListBox_Loaded" SelectionMode="Single" Height="auto" VerticalAlignment="Top" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Image Source="{Binding ImageSource}" Stretch="Uniform" Height="48" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Height" Value="65" />
- <Setter Property="Padding" Value="8" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="False" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="True" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}" />
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </TabItem>
- <TabItem x:Name="TabCustom"
- Header="Custom"
- FontFamily="Segoe UI" Foreground="#FF666666"
- FontSize="12"
- HorizontalContentAlignment="Center">
- <Grid>
- <StackPanel VerticalAlignment="Center" x:Name="NoStampStackPanel" Visibility="{Binding CustomStampList.Count, Converter={StaticResource ListCountToVisible}}">
- <Image Source="pack://application:,,,/PDF Master;component/Resources/PropertyPanel/nostamp.png" />
- <TextBlock Text="No custom stamp created" FontSize="14" FontFamily="Segoe UI" Height="22" HorizontalAlignment="Center" />
- <TextBlock Width="168" FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C" HorizontalAlignment="Center">
- <Run Text="Click the" />
- <Run Text="Add button" FontWeight="Bold" />
- <Run Text="in the upper right corner to create a new stamp." />
- </TextBlock>
- </StackPanel>
- <ListBox Name="CusListbox" Margin="0 0 0 56" Visibility="{Binding ElementName=NoStampStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
- VerticalAlignment="Top"
- Height="auto"
- BorderThickness="0"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ItemsSource="{Binding CustomStampList}"
- SelectedIndex="{Binding CusListboxIndex,Mode=TwoWay}">
- <ListBox.ItemTemplate>
- <HierarchicalDataTemplate DataType="{x:Type model:Stamp}">
- <Grid>
- <Grid.ContextMenu>
- <ContextMenu>
- <MenuItem x:Name="Delete" Header="删除图章" Click="Delete_Click" />
- <MenuItem x:Name="DeleteAll" Header="删除全部图章" Click="DeleteAll_Click" />
- <MenuItem Header="导出图章">
- <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click" />
- <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click" />
- </MenuItem>
- <MenuItem Header="编辑文字图章" Click="Editor_Click" Visibility="Collapsed" />
- </ContextMenu>
- </Grid.ContextMenu>
- <StackPanel Orientation="Horizontal">
- <Image Source="{Binding SourcePath}" />
- <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Click="Delete_Click" Visibility="Hidden" />
- </StackPanel>
- </Grid>
- <HierarchicalDataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="DeleteIcon" Property="Visibility" Value="Visible" />
- </Trigger>
- </HierarchicalDataTemplate.Triggers>
- </HierarchicalDataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Height" Value="65" />
- <Setter Property="Padding" Value="8" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="False" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="True" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}" />
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- </TabItem>
- </TabControl>-->
- </Grid>
- </UserControl>
|