|
- <UserControl
- x:Class="HBLConsole.PryUserControl.BeveledButton"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:HBLConsole.PryUserControl"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="30"
- d:DesignWidth="100"
- mc:Ignorable="d">
-
- <UserControl.Resources>
- <Style x:Key="BeveledButtonStyle" TargetType="Button">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="Width" Value="100" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="Aqua" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid x:Name="gr">
- <ContentControl
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- Foreground="{TemplateBinding Foreground}" />
- <Polygon
- x:Name="poly"
- Points="0 0,80 0,100 30,20 30"
- Stroke="#FF34F7F7"
- StrokeThickness="2" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="poly" Property="Fill" Value="#2234F7F7" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
-
- </Style>
- </UserControl.Resources>
-
- <Grid>
- <!--<TextBlock
- Name="tb"
- HorizontalAlignment="Center"
- VerticalAlignment="Center" />-->
- <Canvas
- Name="canvas"
- Width="auto"
- Height="auto"
- SizeChanged="Canvas_SizeChanged">
- <!--<Button x:Name="but">
- <Button.Style>
- <Style TargetType="Button">
- <Setter Property="Background" Value="Red" />
- <Setter Property="Foreground" Value="White" />
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Grid x:Name="gr">
- <ContentControl
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding Content}"
- Foreground="{TemplateBinding Foreground}" />
- <Polygon
- x:Name="poly"
- Points="0 0,85 0,100 30,0 30"
- Stroke="#FF34F7F7"
- StrokeThickness="2" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="poly" Property="Fill" Value="#2234F7F7" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Button.Style>
- </Button>-->
- <Polygon x:Name="poly" />
- </Canvas>
- </Grid>
- </UserControl>
|