123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
- <Style TargetType="{x:Type customControl:PathButton}">
- <Setter Property="IconOpacity" Value="1" />
- <Setter Property="IconMouseOverOpacity" Value="1" />
- <Setter Property="IconPressOpacity" Value="1" />
- <Setter Property="IconCheckedOpacity" Value="1" />
- <Setter Property="IsChecked" Value="false" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type customControl:PathButton}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <Grid x:Name="grid" Background="{TemplateBinding Background}">
- <Border
- x:Name="PART_Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}" />
- <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
- <StackPanel
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="{TemplateBinding IconContentOrientation}">
- <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
- <Path
- x:Name="PART_Icon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Data="{TemplateBinding Icon}"
- Fill="{TemplateBinding IconFill}"
- Opacity="{TemplateBinding IconOpacity}" />
- <Path
- x:Name="PART_MouseOverIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Data="{TemplateBinding IconMouseOver}"
- Fill="{TemplateBinding IconMouseOverFill}"
- Opacity="{TemplateBinding IconMouseOverOpacity}"
- Visibility="Collapsed" />
- <Path
- x:Name="PART_PressIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Data="{TemplateBinding IconPress}"
- Fill="{TemplateBinding IconPressFill}"
- Opacity="{TemplateBinding IconPressOpacity}"
- Visibility="Collapsed" />
- <Path
- x:Name="PART_CheckedIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Data="{TemplateBinding IconChecked}"
- Fill="{TemplateBinding IconCheckedFill}"
- Opacity="{TemplateBinding IconCheckedOpacity}"
- Visibility="Collapsed" />
- </Grid>
- <TextBlock
- x:Name="PART_Content"
- Margin="{TemplateBinding IconContentMargin}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Foreground="{TemplateBinding Foreground}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- Text="{TemplateBinding Content}"
- TextTrimming="CharacterEllipsis" />
- </StackPanel>
- </Grid>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value="0.5" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger SourceName="PART_Content" Property="Text" Value="">
- <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
- <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|