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 MainWindow(UserModel user) { Guard.VerifyObjectNotNull(user, nameof(user)); InitializeComponent(); _user = user; _mainVm = new MainVm(user); DataContext = _mainVm; }
public CharacterVm(Character character, UserModel user, bool isNewCharacter = false) : base(user) { Guard.VerifyObjectNotNull(character, nameof(character)); _isNewCharacter = isNewCharacter; if (_isNewCharacter) { character.Name = NewCharacterName; } _character = character; }
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 CharacterWindow(Character character, UserModel user, bool isNewCharacter = false) { Guard.VerifyObjectNotNull(character, nameof(character)); Guard.VerifyObjectNotNull(user, nameof(user)); InitializeComponent(); _isNewCharacter = isNewCharacter; _user = user; _characterVm = new CharacterVm(character, user, isNewCharacter); DataContext = _characterVm; //InitEditorControl(character, user); }
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(); }
public MainVm(UserModel user) : base(user) { }