Код: Выделить всё
public class MyObject
{
public string Name { get; set; }
public int ComboOptionId { get; set; }
public ComboEnum ComboOption
{
get => (ComboEnum)ComboOptionId;
set => ComboOptionId = (int)value;
}
public ComboObject ComboObject { get; set; }
}
Код: Выделить всё
public class ComboObject
{
public string Name { get; set; }
public int Value { get; set; }
}
Код: Выделить всё
public enum ComboEnum
{
Option1 = -1,
Option2 = 0,
Option3 = 1
}
Код: Выделить всё
public class ViewModel
{
public ObservableCollection ComboEnumOptions { get; }
public ObservableCollection ComboObjectOptions { get; }
public ObersvableCollection ObjectSource { get; }
// Rest of class has methods to fill these and other operations etc...
}
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/792 ... -from-data