You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

92 lines
4.2 KiB

  1. <UserControl
  2. x:Class="HBLConsole.PryUserControl.BeveledButton"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:HBLConsole.PryUserControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="30"
  9. d:DesignWidth="100"
  10. mc:Ignorable="d">
  11. <UserControl.Resources>
  12. <Style x:Key="BeveledButtonStyle" TargetType="Button">
  13. <Setter Property="FontFamily" Value="楷体" />
  14. <Setter Property="Width" Value="100" />
  15. <Setter Property="FontSize" Value="18" />
  16. <Setter Property="Foreground" Value="Aqua" />
  17. <Setter Property="Template">
  18. <Setter.Value>
  19. <ControlTemplate TargetType="Button">
  20. <Grid x:Name="gr">
  21. <ContentControl
  22. HorizontalAlignment="Center"
  23. VerticalAlignment="Center"
  24. Content="{TemplateBinding Content}"
  25. Foreground="{TemplateBinding Foreground}" />
  26. <Polygon
  27. x:Name="poly"
  28. Points="0 0,80 0,100 30,20 30"
  29. Stroke="#FF34F7F7"
  30. StrokeThickness="2" />
  31. </Grid>
  32. <ControlTemplate.Triggers>
  33. <Trigger Property="IsMouseOver" Value="True">
  34. <Setter TargetName="poly" Property="Fill" Value="#2234F7F7" />
  35. </Trigger>
  36. </ControlTemplate.Triggers>
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. </UserControl.Resources>
  42. <Grid>
  43. <!--<TextBlock
  44. Name="tb"
  45. HorizontalAlignment="Center"
  46. VerticalAlignment="Center" />-->
  47. <Canvas
  48. Name="canvas"
  49. Width="auto"
  50. Height="auto"
  51. SizeChanged="Canvas_SizeChanged">
  52. <!--<Button x:Name="but">
  53. <Button.Style>
  54. <Style TargetType="Button">
  55. <Setter Property="Background" Value="Red" />
  56. <Setter Property="Foreground" Value="White" />
  57. <Setter Property="FontFamily" Value="楷体" />
  58. <Setter Property="FontSize" Value="16" />
  59. <Setter Property="Template">
  60. <Setter.Value>
  61. <ControlTemplate TargetType="Button">
  62. <Grid x:Name="gr">
  63. <ContentControl
  64. HorizontalAlignment="Center"
  65. VerticalAlignment="Center"
  66. Content="{TemplateBinding Content}"
  67. Foreground="{TemplateBinding Foreground}" />
  68. <Polygon
  69. x:Name="poly"
  70. Points="0 0,85 0,100 30,0 30"
  71. Stroke="#FF34F7F7"
  72. StrokeThickness="2" />
  73. </Grid>
  74. <ControlTemplate.Triggers>
  75. <Trigger Property="IsMouseOver" Value="True">
  76. <Setter TargetName="poly" Property="Fill" Value="#2234F7F7" />
  77. </Trigger>
  78. </ControlTemplate.Triggers>
  79. </ControlTemplate>
  80. </Setter.Value>
  81. </Setter>
  82. </Style>
  83. </Button.Style>
  84. </Button>-->
  85. <Polygon x:Name="poly" />
  86. </Canvas>
  87. </Grid>
  88. </UserControl>