예제 #1
0
 public EditVm(BaseModel model, UserModel user, bool isNewObject = false)
     : base(user)
 {
     _model = model;
     Properties = new ObservableCollection<PropertyEssentials>(GetModelProperties());
     _isNewObject = isNewObject;
 }
예제 #2
0
 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);
 }
예제 #3
0
        public MainWindow(UserModel user)
        {
            Guard.VerifyObjectNotNull(user, nameof(user));

            InitializeComponent();

            _user = user;
            _mainVm = new MainVm(user);

            DataContext = _mainVm;
        }
예제 #4
0
        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;
        }
예제 #5
0
        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();
        }
예제 #6
0
        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);
        }
예제 #7
0
        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();
        }
예제 #8
0
 public MainVm(UserModel user)
     : base(user)
 { }