Page 1 of 1

How should we declare collections in XAML?

Posted: 12 Jan 2021, 21:26
by asusralis
It seems x:Array isn't implemented (Unknown type 'Array'). Is there another preferred way to create collections in XAML?

Re: How should we declare collections in XAML?

Posted: 15 Jan 2021, 10:52
by sfernandez
What kind of items will the collection contain?

You can define your own collection class inheriting from any of the existing ones (List<T>, Noesis.UICollection<T>, Noesis.FreezableCollection<T>,...) and then use your type in xaml.
public class PersonCollection : List<Person> { };
<local:PersonCollection>
  <local:Person Name="John"/>
</local:PersonCollection>
We use this to define our StyleInteraction collections for Behaviors and Triggers: https://www.noesisengine.com/docs/App.I ... tml#styles