1
我想在我自己的类ServiceControllerStatus(在System.ServiceProcess中找到的枚举)的类中添加名为'状态'的属性的数据触发器。访问WPF数据类型中的系统枚举
我已将此添加到XAML:
xmlns:System="clr-namespace:System.ServiceProcess;assembly=System.ServiceProcess.dll"
,我试图用数据触发基础上的“状态”的价值做这个:
<DataTrigger Binding="{Binding Path=Status}" >
<DataTrigger.Value>
<System:ServiceControllerStatus>Running</System:ServiceControllerStatus>
</DataTrigger.Value>
<Setter TargetName="border" Property="BorderBrush" Value="Green"/>
</DataTrigger>
,但我收到错误“ XML名称空间'clr-namespace:System.ServiceProcess;程序集= System.ServiceProcess.dll'中不存在标记'ServiceControllerStatus'
是否可以使用系统名称中定义的枚举p ace,还是只能引用你自己的类中定义的枚举?
谢谢!
感谢您的回应,尽管使用您的代码,我仍然得到相同的错误... – Shaun
@Shaun删除'.dll'。那么你可以编译。 – ohyecloudy