9
我希望我的橢圓現在變成紅色。試圖綁定到DataTrigger內部的枚舉,爲什麼它不工作?
<UserControl x:Class="BenchmarkPlus.PMT.UI.Views.NotificationIndicator"
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:Models="clr-namespace:BenchmarkPlus.PMT.UI.Models"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300"
x:Name="root"
DataContext="{x:Static Models:NotificationType.Error}">
<Grid>
<Ellipse>
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Fill"
Value="Blue" />
<Style.Triggers>
<DataTrigger Binding="{Binding}"
Value="{x:Static Models:NotificationType.Info}">
<Setter Property="Fill"
Value="Green" />
</DataTrigger>
<DataTrigger Binding="{Binding}"
Value="{x:Static Models:NotificationType.Error}">
<Setter Property="Fill"
Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</Grid>
</UserControl>
這在運行時也是如此?我不會相信任何GUI上的GUI設計師。 – 2012-04-20 17:45:36
omg,你是對的...愚蠢的設計師 – 2012-04-20 17:54:07
點的點.... – 2012-04-20 17:57:19