当IsEnabled为false时,我希望图像的不透明度为.50.我一直在看多个例子,但我仍然无法掌握如何使它工作.
这是我的自定义控件的完整XAML.任何帮助将深表感谢.
<UserControl
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="test.StopButtonControl"
x:Name="UserControl"
d:DesignWidth="85" d:DesignHeight="85">
<Grid x:Name="LayoutRoot">
<Image x:Name="StopButtonUI" Source="Images/stop.png" Stretch="Fill" MouseUp="StopButtonClick"/>
</Grid>
</UserControl>
Run Code Online (Sandbox Code Playgroud)