private void MachineProfiles_ProfileRemoved(object sender, MachineProfiles.IProfile profile) { MachineProfileViewModel vm = profileToViewModels[profile]; profileViewModels.Remove(vm); profileToViewModels.Remove(profile); }
private void addProfile(MachineProfiles.IProfile profile) { MachineProfileViewModel vm = new MachineProfileViewModel(profile); profileViewModels.Add(vm); profileToViewModels.Add(profile, vm); }
private void _activateCommand_Execute(object parameter) { MachineProfileViewModel vm = parameter as MachineProfileViewModel; if (vm == null) { return; } Active = vm; }
private void _deleteCommand_Execute(object parameter) { MachineProfileViewModel vm = parameter as MachineProfileViewModel; if (vm == null || vm.Model == AppCore.MachineProfiles.Active) { return; } AppCore.MachineProfiles.RemoveProfile(vm.Model); }
private void _duplicateCommand_Execute(object parameter) { MachineProfileViewModel vm = parameter as MachineProfileViewModel; if (vm == null) { return; } AppCore.MachineProfiles.CreateProfile( vm.Model.FriendlyName + " (Duplicate)", vm.Model.TableSize, vm.Model.Origin, vm.Model.MaxFeedRate); }