There is a class

enum MyEnum{ public class MyClass { public static Elem1 = new A(); public static Elem2 = new A(); public static Elem3 = new A(); public static Elem4 = new A(); public static Elem5 = new A(); } } 

There is a XAML, but the question is how to put static elements there? this code does not work

 <ListView> <ListView.Items> <x:Array xmlns:MyEnum="clr-namespace:MyEnum" Type="MyEnum:MyClass"> <MyEnum:MyClass.Elem1/> <MyEnum:MyClass.Elem2/> <MyEnum:MyClass.Elem5/> </x:Array> </ListView.Items> </listView> 
  • <object property="{x:Static prefix:typeName.staticMemberName}" .../> did not try? - Senior Pomidor
  • Thank. <x:Static Member="MyEnum:MyClass.Elem1"/> as an answer. - Dmitry Chistik

1 answer 1

<object property="{x:Static prefix:typeName.staticMemberName}" .../>

see comment