Exemple #1
0
 public EditVm(BaseModel model, UserModel user, bool isNewObject = false)
     : base(user)
 {
     _model = model;
     Properties = new ObservableCollection<PropertyEssentials>(GetModelProperties());
     _isNewObject = isNewObject;
 }
 private void InitEditorControl(BaseModel model, UserModel user)
 {
     var editorControl = new EditorControl(model, user, _isNewCharacter);
     Grid.SetRow(editorControl, 0);
     Grid.SetColumn(editorControl, 0);
     Grid.SetColumnSpan(editorControl, 1);
     CharacterPropertiesGrid.Children.Add(editorControl);
 }
        public EditorControl(BaseModel model, UserModel user, bool isNewObject)
        {
            Guard.VerifyObjectNotNull(model, nameof(model));
            Guard.VerifyObjectNotNull(user, nameof(user));


            InitializeComponent();
            _editVm = new EditVm(model, user, isNewObject);

            DataContext = _editVm;

            AssembleFields();
        }
        public EditWindow(BaseModel model, UserModel user, bool isNewObject = false)
        {
            Guard.VerifyObjectNotNull(model, nameof(model));
            Guard.VerifyObjectNotNull(user, nameof(user));

            InitializeComponent();

            _user = user;
            _isNewObject = isNewObject;
            _model = model;
            DataContext = new EditVm(model, _user, _isNewObject);
            InitEditorControl();
        }