private static Control GetControl(object targetType, object value, Action <object> update, bool isReadOnly = false) { switch (targetType) { case bool _: return(BoolVM.Create(value, update, isReadOnly: isReadOnly)); case int _: return(IntVM.Create(value, update, isReadOnly: isReadOnly)); case double _: return(DoubleVM.Create(value, update, isReadOnly: isReadOnly)); } return(StringVM.Create(value, update, isReadOnly: isReadOnly)); }
public IntView(IntVM vm) { InitializeComponent(); DataContext = vm; }