How should we declare collections in XAML?
It seems x:Array isn't implemented (Unknown type 'Array'). Is there another preferred way to create collections in XAML?
-
-
sfernandez
Site Admin
- Posts: 2097
- Joined:
Re: How should we declare collections in XAML?
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.
We use this to define our StyleInteraction collections for Behaviors and Triggers: https://www.noesisengine.com/docs/App.I ... tml#styles
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.
Code: Select all
public class PersonCollection : List<Person> { };
Code: Select all
<local:PersonCollection>
<local:Person Name="John"/>
</local:PersonCollection>
Who is online
Users browsing this forum: No registered users and 1 guest