|
@@ -25,6 +25,12 @@
|
|
|
<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>
|
|
@@ -57,32 +63,70 @@
|
|
|
HorizontalContentAlignment="Center"
|
|
|
FontSize="12"
|
|
|
IsSelected="True">
|
|
|
- <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="48"/>
|
|
|
- </Grid>
|
|
|
- </DataTemplate>
|
|
|
- </ListBox.ItemTemplate>
|
|
|
- <ListBox.ItemContainerStyle>
|
|
|
- <Style TargetType="ListBoxItem">
|
|
|
- <Setter Property="Height" Value="64"/>
|
|
|
- <!--<Setter Property="Padding" Value="12 5 12 5"/>-->
|
|
|
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
|
- <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
|
|
|
- </Style>
|
|
|
- </ListBox.ItemContainerStyle>
|
|
|
- </ListBox>
|
|
|
-
|
|
|
+ <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"
|
|
@@ -100,9 +144,46 @@
|
|
|
</ListBox.ItemTemplate>
|
|
|
<ListBox.ItemContainerStyle>
|
|
|
<Style TargetType="ListBoxItem">
|
|
|
- <Setter Property="Height" Value="64"/>
|
|
|
- <Setter Property="Padding" Value="12 5 12 5"/>
|
|
|
+ <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>
|
|
@@ -149,7 +230,7 @@
|
|
|
</Grid.ContextMenu>
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
<Image Source="{Binding SourcePath}"/>
|
|
|
- <Button x:Name="DeleteIcon" Width="20" Height="20" Click="Delete_Click" Visibility="Collapsed"/>
|
|
|
+ <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Click="Delete_Click" Visibility="Hidden"/>
|
|
|
</StackPanel>
|
|
|
</Grid>
|
|
|
<HierarchicalDataTemplate.Triggers>
|
|
@@ -163,8 +244,45 @@
|
|
|
|
|
|
<ListBox.ItemContainerStyle>
|
|
|
<Style TargetType="ListBoxItem">
|
|
|
- <Setter Property="Height" Value="64"/>
|
|
|
- <!--<Setter Property="Padding" Value="12 5 12 5"/>-->
|
|
|
+ <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>
|