20211124_ZNZT_upperpc/MonitoringTechnology/Views/ViewControlButton.xaml

28 lines
1.9 KiB
Plaintext
Raw Normal View History

2023-02-03 00:31:48 +00:00
<Button x:Class="MonitoringTechnology.Views.ViewControlButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MonitoringTechnology.Views"
mc:Ignorable="d"
Height="39" Width="36">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<Grid x:Name="border" Background="Transparent" SnapsToDevicePixels="True" >
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="True"/>
<!--<TextBlock x:Name="text" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" Foreground="White" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:MainButton}},Path=Text}"></TextBlock>-->
</Grid>
<ControlTemplate.Triggers >
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" TargetName="border" Value="#09000000"/>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter Property="Background" TargetName="border" Value="#16000000"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>