I'm trying to add a data trigger for a property called 'Status' in my own class of type ServiceControllerStatus (an enum found in System.ServiceProcess).
I added this to the XAML:
xmlns:System="clr-namespace:System.ServiceProcess;assembly=System.ServiceProcess.dll"
And am trying to use data triggers based on the value of 'Status' by doing this:
<DataTrigger Binding="{Binding Path=Status}" >
<DataTrigger.Value>
<System:ServiceControllerStatus>Running</System:ServiceControllerStatus>
</DataTrigger.Value>
<Setter TargetName="border" Property="BorderBrush" Value="Green"/>
</DataTrigger>
But am receiving an error "The tag 'ServiceControllerStatus' does not exist in XML namespace 'clr-namespace:System.ServiceProcess;assembly=System.ServiceProcess.dll"
Is it possible to use enums defined in system namespaces, or must you only reference enums defined in your own classes?
Thank you!
shreesh chandra shukla
17-Aug-2013You can use enum with the {x:Static} form.
thanks