终端一体化运控平台
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.
 
 
 

105 regels
5.0 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.UserControls.IcoButton"
  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:BPASmartClient.CustomResource.UserControls"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="30"
  9. d:DesignWidth="130"
  10. mc:Ignorable="d">
  11. <!--<UserControl.Resources>
  12. <Style x:Key="IcoButtonStyle" TargetType="Button">
  13. <Setter Property="FontFamily" Value="../Fonts/#iconfont" />
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="Button">
  17. <Border
  18. x:Name="br"
  19. Background="Transparent"
  20. BorderBrush="#FF19B7EC"
  21. BorderThickness="2">
  22. <StackPanel
  23. HorizontalAlignment="Center"
  24. VerticalAlignment="Center"
  25. Orientation="Horizontal">
  26. <TextBlock
  27. HorizontalAlignment="Center"
  28. VerticalAlignment="Center"
  29. FontFamily="{Binding}"
  30. Text="{Binding ElementName=br}" />
  31. <ContentControl
  32. Margin="10,0,5,0"
  33. HorizontalAlignment="Center"
  34. VerticalAlignment="Center"
  35. Content="{TemplateBinding Content}"
  36. Foreground="{TemplateBinding Foreground}" />
  37. </StackPanel>
  38. </Border>
  39. <ControlTemplate.Triggers>
  40. <Trigger Property="IsMouseOver" Value="True">
  41. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  42. </Trigger>
  43. <Trigger Property="IsPressed" Value="true">
  44. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  45. </Trigger>
  46. </ControlTemplate.Triggers>
  47. </ControlTemplate>
  48. </Setter.Value>
  49. </Setter>
  50. </Style>
  51. </UserControl.Resources>-->
  52. <Grid>
  53. <!--<Canvas Width="auto" Height="auto">-->
  54. <Button Name="a">
  55. <Button.Style>
  56. <Style TargetType="Button">
  57. <Setter Property="FontFamily" Value="../Fonts/#iconfont" />
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate TargetType="Button">
  61. <Border
  62. x:Name="br"
  63. Background="Transparent"
  64. BorderBrush="#FF19B7EC"
  65. BorderThickness="2">
  66. <StackPanel
  67. HorizontalAlignment="Center"
  68. VerticalAlignment="Center"
  69. Orientation="Horizontal">
  70. <TextBlock
  71. Margin="0,0,5,0"
  72. FontFamily="../Fonts/#iconfont"
  73. Text="我是图标" />
  74. <ContentControl
  75. Margin="10,0,5,0"
  76. VerticalAlignment="Center"
  77. Content="{TemplateBinding Content}"
  78. Foreground="{TemplateBinding Foreground}" />
  79. </StackPanel>
  80. </Border>
  81. <ControlTemplate.Triggers>
  82. <Trigger Property="IsMouseOver" Value="True">
  83. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  84. </Trigger>
  85. <Trigger Property="IsPressed" Value="true">
  86. <Setter TargetName="br" Property="Background" Value="#2219B7EC" />
  87. </Trigger>
  88. </ControlTemplate.Triggers>
  89. </ControlTemplate>
  90. </Setter.Value>
  91. </Setter>
  92. </Style>
  93. </Button.Style>
  94. </Button>
  95. <!--</Canvas>-->
  96. </Grid>
  97. </UserControl>