is there a way to declare an array of types in xaml?
maybe something like this?
<x:Array Type="x:Type">
<x:Type se:MyType1/>
<x:Type se:MyType2/>
<x:Type se:MyType3/>
</x:Array>
You need to use a different namespace prefix. x:Type is a markup extension that creates System.Type objects, and you want to create an array of type objects, not an array of markup extensions (I assume).
You cannot call constructors from when using element syntax, so you'll need to pass the type in using the Type property of TypeExtension.
Something like this should work:
<x:Array xmlns:sys="clr-namespace:System;assembly=mscorlib" Type="sys:Type">
<x:Type Type="se:MyType1"/>
<x:Type Type="se:MyType2"/>
<x:Type Type="se:MyType3"/>
</x:Array>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With