I’m not sure if it is possible in a easy way (with little code that is).
I have a model:
public static Class TestClass
{
public static bool Test1 { get; set; }
public static bool Test2 { get; set; }
public static bool Test3 { get; set; }
public static bool Test4 { get; set; }
public static bool Test5 { get; set; }
public static bool Test6 { get; set; }
}
Is it possible for a simple Foreach or other command to create 6 checkboxes, each named as the property name and checked bound to the actual property?
So basicly what I want to create this for each property:
var check = new CheckBox { Name = Test1 };
check.CheckedChanged += (s,ea) => { TestClass.Test1 = check.IsChecked; };
but for each property and perhaps even with less code?
It’s possible but I dont know if you can do it with static properties.
example: