<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:apexControls="clr-namespace:Apex.Controls" xmlns:apexCommands="clr-namespace:Apex.Commands" xmlns:apexDesign="clr-namespace:Apex.Design"> <Style TargetType="{x:Type apexControls:CrossButton}"> <Style.Resources> <SolidColorBrush x:Key="TabItemCloseButtonNormalBackgroundBrush" Color="#00000000" /> <SolidColorBrush x:Key="TabItemCloseButtonNormalBorderBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="TabItemCloseButtonNormalForegroundBrush" Color="#FF8f949b" /> <SolidColorBrush x:Key="TabItemCloseButtonHoverBackgroundBrush" Color="#FFc13535" /> <SolidColorBrush x:Key="TabItemCloseButtonHoverForegroundBrush" Color="#FFf9ebeb" /> <SolidColorBrush x:Key="TabItemCloseButtonPressedBackgroundBrush" Color="#FF431e20" /> <SolidColorBrush x:Key="TabItemCloseButtonPressedBorderBrush" Color="#FF110033" /> <SolidColorBrush x:Key="TabItemCloseButtonPressedForegroundBrush" Color="#FFf9ebeb" /> </Style.Resources> <Setter Property="SnapsToDevicePixels" Value="false" /> <!-- <Setter Property="Height" Value="16" /> <Setter Property="Width" Value="16" /> --> <Setter Property="Cursor" Value="Hand" /> <Setter Property="Focusable" Value="False" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid Background="Transparent"> <Ellipse x:Name="backgroundEllipse" /> <!-- The Path below will render the button's X. --> <Path x:Name="ButtonPath" Margin="3" Stroke="{StaticResource TabItemCloseButtonNormalForegroundBrush}" StrokeThickness="1.5" StrokeStartLineCap="Square" StrokeEndLineCap="Square" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Center"> <Path.Data> <PathGeometry> <PathGeometry.Figures> <PathFigure StartPoint="0,0"> <LineSegment Point="25,25"/> </PathFigure> <PathFigure StartPoint="0,25"> <LineSegment Point="25,0"/> </PathFigure> </PathGeometry.Figures> </PathGeometry> </Path.Data> </Path> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="backgroundEllipse" Property="Fill" Value="{StaticResource TabItemCloseButtonHoverBackgroundBrush}" /> <Setter TargetName="ButtonPath" Property="Stroke" Value="{StaticResource TabItemCloseButtonHoverForegroundBrush}"/> </Trigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Visibility" Value="Collapsed"/> </Trigger> <Trigger Property="IsPressed" Value="true"> <Setter TargetName="backgroundEllipse" Property="Fill" Value="{StaticResource TabItemCloseButtonPressedBackgroundBrush}" /> <Setter TargetName="backgroundEllipse" Property="Stroke" Value="{StaticResource TabItemCloseButtonPressedBorderBrush}" /> <Setter TargetName="ButtonPath" Property="Stroke" Value="{StaticResource TabItemCloseButtonPressedForegroundBrush}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)