예제 #1
0
        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));
        }
예제 #2
0
 public IntView(IntVM vm)
 {
     InitializeComponent();
     DataContext = vm;
 }