コード例 #1
0
 private void SetControlViewWithValue(string name, TypeValue type, object defaultValue = null)
 {
     if (_currentConsantInputControl != null)
     {
         _currentConsantInputControl.ValueChanged -= ConstantControlView_ValueChanged;
     }
     ConstantInputGrid.Children.Clear();
     if ((int)type == 0)
     {
         ConstantInputGrid.Children.Add(new TextBlock()
         {
             Text = "Type doesn't allow constant input"
         });
     }
     else
     {
         var formModel = new GenericFormInputModel()
         {
             Description = string.Empty,
             Type        = type,
             Key         = name,
             DisplayName = string.Empty,
         };
         if (defaultValue != null)
         {
             formModel.DefaultValue = defaultValue;
         }
         _currentConsantInputControl = new GenericInputControlView()
         {
             InputModel = formModel,
         };
         _currentConsantInputControl.ValueChanged += ConstantControlView_ValueChanged;
         ConstantInputGrid.Children.Add(_currentConsantInputControl);
     }
 }
コード例 #2
0
 public void Initialize(GenericInputControlView v)
 {
     _view = v;
 }