I\'m learning WPF and I encountered the following problem:
I have an enum type in another namespace than my XAML:
public enum NodeType
{
Type_SYS
You just need to make sure that your namespace is accounted-for in your XAML header then you can reference both custom DPs and enum values directly in your markup.
For example I use this code to do just that:
Note that you can't access DataTriggers in a Style, you need to instead make a DataTemplate or ControlTemplate for that (however, .NET 4 adds the ability to set triggers in styles). You can override the ControlTemplate from a Style like so:
For DataTemplates you want to have bindings to an object, you can simply use a ContentPresenter and set its content to the object you want to display along with a DataTemplate definition to use for display of the object. There's always a way to use DataTriggers it's just not always direct or as simple as using a Style.