public void SetMachine(PnPMachine machine)
        {
            _pnpMachine = machine;
            SaveMachineCommand.RaiseCanExecuteChanged();
            AddPartPackCommand.RaiseCanExecuteChanged();

            RaisePropertyChanged(nameof(PartPacks));
            RaisePropertyChanged(nameof(Slots));
        }
Exemplo n.º 2
0
        public void SavePackage()
        {
            if (!_isEditing)
            {
                Packages.Add(CurrentPackage);
            }

            _isDirty = true;

            CurrentPackage = null;
            AddPackageCommand.RaiseCanExecuteChanged();
            SaveMachineCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 3
0
        public async void NewMachine()
        {
            if (CurrentPackage != null || _isDirty)
            {
                if (!await Popups.ConfirmAsync("Lose Changes?", "You have unsaved work, opening a new file will cause you to lose changes.\r\n\r\nContinue?"))
                {
                    return;
                }
            }

            _isDirty    = true;
            _isEditing  = false;
            _pnpMachine = new PnPMachine();

            RaisePropertyChanged(nameof(Packages));
            SaveMachineCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 4
0
        public async void SaveMachine()
        {
            if (String.IsNullOrEmpty(_fileName))
            {
                _fileName = await Popups.ShowSaveFileAsync("PnP Machine (*.pnp)|*.pnp");

                if (String.IsNullOrEmpty(_fileName))
                {
                    return;
                }
            }

            await PnPMachineManager.SavePackagesAsync(_pnpMachine, _fileName);

            _isDirty = false;
            SaveMachineCommand.RaiseCanExecuteChanged();
        }
        public async void NewMachine()
        {
            if (_isDirty)
            {
                if (!await Popups.ConfirmAsync("Lose Changes?", "You have unsaved work, opening a new file will cause you to lose changes.\r\n\r\nContinue?"))
                {
                    return;
                }
            }

            _fileName   = null;
            _pnpMachine = new PnPMachine();

            SaveMachineCommand.RaiseCanExecuteChanged();
            AddPartPackCommand.RaiseCanExecuteChanged();

            RaisePropertyChanged(nameof(PartPacks));
            RaisePropertyChanged(nameof(Slots));
        }