0
<UserControl x:Class="rd_terminal.terminal_pages.button_controls.red_button.exiPadButton"
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"
mc:Ignorable="d"
d:DesignHeight="79" d:DesignWidth="256"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Button Name="button" Width="256" Height="79" Click="button_Click_1" FontSize="20" FontWeight="Bold">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<Border Name="buttonBorder">
<Border.Effect>
<DropShadowEffect Opacity="0.0" />
</Border.Effect>
<Border.Child>
<Image Name="img" Source="{Binding NormalImage}"/>
</Border.Child>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="buttonBorder" Property="Effect">
<Setter.Value>
<DropShadowEffect Opacity="0.0" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsMouseCaptured" Value="true">
<Setter TargetName="buttonBorder" Property="Effect">
<Setter.Value>
<DropShadowEffect Opacity="0" Direction="135"
ShadowDepth="0" BlurRadius="0" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="img" Property="Source" Value="{Binding DisabledImage}"/>
<Setter TargetName="buttonBorder" Property="Effect">
<Setter.Value>
<DropShadowEffect Opacity="0.0"/>
</Setter.Value>
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
我有这个按钮的用户控制。它工作正常,直到我添加内容,然后它不再工作。它甚至不能被点击,并且图像在内容词进入时不会改变。有谁知道如何解决这个问题?
无法让它工作?它说属性视觉设置不止一次 –
nope,它仍然不起作用,它没有禁用图像点击鼠标和按钮不能被点击。 –
资源NormalImage无法解决 –