asusralis
Topic Author
Posts: 111
Joined: 30 Jul 2018, 05:03

How should we declare collections in XAML?

12 Jan 2021, 21:26

It seems x:Array isn't implemented (Unknown type 'Array'). Is there another preferred way to create collections in XAML?
 
User avatar
sfernandez
Site Admin
Posts: 2062
Joined: 22 Dec 2011, 19:20

Re: How should we declare collections in XAML?

15 Jan 2021, 10:52

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

Who is online

Users browsing this forum: No registered users and 1 guest