I defined an enum in C #
public enum PointerStyle
{
Pointer,
Block,
Slider
} ;
I use it as a dependency property in a WPF user control
public static DependencyProperty DisplayStyleProperty =
DependencyProperty.Register("DisplayStyle", typeof(PointerStyle), typeof(Pointer), new PropertyMetadata(PointerStyle.Pointer));
public PointerStyle DisplayStyle
{
get { return (PointerStyle)GetValue(DisplayStyleProperty); }
set { SetValue(DisplayStyleProperty, value); }
}
and using it in a ControlTemplate
<Trigger Property="DisplayStyle" Value="{x:Static local:PointerStyle.Block}">
Very often, but not always, the editor underlines most of the code and shows the error "Block" is not a valid value for the DisplayStype property. as shown in the following screenshot

This is in Visual Studio 2015.
At runtime, the code works fine.
In the design window of my test program, the control is not displayed correctly.
What am I doing wrong?
What is the best way to refer to an enum value in XAML?
( TypeConverter , , .)