Esempio n. 1
0
        public GroupMoveViewModel(BaseViewModel parentViewModel, GroupMoveModel dataModel, IDialogService dialogService)
            : base(parentViewModel)
        {
            Contract.Requires(dialogService != null);
            _dialogService = dialogService;
            _dataModel = dataModel;

            // Will bubble property change events from the Model to the ViewModel.
            _dataModel.PropertyChanged += (sender, e) => OnPropertyChanged(e.PropertyName);
        }
Esempio n. 2
0
        public void GroupMoveExecuted()
        {
            var model = new GroupMoveModel();
            var position = ThePlayerCharacter != null ? (Vector3D)ThePlayerCharacter.PositionAndOrientation.Value.Position : Vector3D.Zero;
            model.Load(Selections, position);
            var loadVm = new GroupMoveViewModel(this, model);

            var result = _dialogService.ShowDialog<WindowGroupMove>(this, loadVm);
            if (result == true)
            {
                model.ApplyNewPositions();
                _dataModel.CalcDistances();
                IsModified = true;
            }
        }
Esempio n. 3
0
 public GroupMoveViewModel(BaseViewModel parentViewModel, GroupMoveModel dataModel)
     : this(parentViewModel, dataModel, ServiceLocator.Resolve<IDialogService>())
 {
 }