First of all, I would like to thank all of you for all the wonderful materials that you have provided. I have to admit that StackOverflow was the biggest tutor resource, and as such, it provided me with more knowledge than ... 4 years at college. Thanks!
I am working with a control that has a property that is a collection of objects.
public class UserParameter { string DisplayName { get; set; } string Property { get; set; } string Type { get; set; } } public class ParameterBuilder: UserControl { private ObservableCollection<UserParameter> parameters;
So, the meat of this question is figuring out how to create this collection in Xaml. For instance:
<custom:ParameterBuilder Name="Parameter"> <custom:ParameterBuilder.Parameters> <custom:UserParameter DisplayName="Test 0" Property="Size" Type="String"/> <custom:UserParameter DisplayName="Test 1" Property="Value" Type="Decimal"/> </custom:ParameterBuilder.Parameters> </custom:ParameterBuilder>
Is this possible, and if so, how can I do this?
source share