public void SetMachine(PnPMachine machine) { _pnpMachine = machine; SaveMachineCommand.RaiseCanExecuteChanged(); AddPartPackCommand.RaiseCanExecuteChanged(); RaisePropertyChanged(nameof(PartPacks)); RaisePropertyChanged(nameof(Slots)); }
public void SavePackage() { if (!_isEditing) { Packages.Add(CurrentPackage); } _isDirty = true; CurrentPackage = null; AddPackageCommand.RaiseCanExecuteChanged(); SaveMachineCommand.RaiseCanExecuteChanged(); }
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(); }
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)); }