public AddDrugViewModel(AdminShellViewModel containingVm) { addDrugM = new AddDrugModel(); this.containingVm = containingVm; UpdateDbCommand = new AddToDbCommand(this); IsNewDrug = true; BackCommand = new BackCommand(this); IngredientToAdd = new ActiveIngredient(); Ingredients = new ObservableCollection <ActiveIngredient>(); AddIngredientCommand = new AddIngredientToDrugCommand(this); DeleteIngredientCommand = new DeleteItemCommand(this); FileDialogCommand = new OpenFileDialogCommand(this); }
public ViewModelBase() { SelectedTorrentFilesViewModel = new SelectedTorrentFilesViewModel(); SelectedTorrentInfoViewModel = new SelectedTorrentInfoViewModel(); SelectedTorrentPeersViewModel = new SelectedTorrentPeersViewModel(); SelectedTorrentTrackersViewModel = new SelectedTorrentTrackersViewModel(); TorrentViewModel = new TorrentViewModel(); OpenFileDialogCommand = new OpenFileDialogCommand(this, new OpenFileDialogViewModel()); SelectionChangedCommand = new SelectionChangedCommand(this); StartDownloadCommand = new StartDownloadCommand(this, SelectedTorrentInfoViewModel); PauseDownloadCommand = new PauseDownloadCommand(this, SelectedTorrentInfoViewModel); }
public UpdateDrugViewModel(AdminShellViewModel containingVm, Drug drugToUpdate) { updateDrugM = new UpdateDrugModel(drugToUpdate); this.containingVm = containingVm; UpdateDbCommand = new UpdateInDbCommand(this); IsNewDrug = false; BackCommand = new BackCommand(this); IngredientToAdd = new ActiveIngredient(); Ingredients = new ObservableCollection <ActiveIngredient>(updateDrugM.Ingredients); AddIngredientCommand = new AddIngredientToDrugCommand(this); DeleteIngredientCommand = new DeleteItemCommand(this); FileDialogCommand = new OpenFileDialogCommand(this); ImageUrl = Drug.ImageUrl; }
public FileSetupPageViewModel( DirectoryListViewModel dirList, NotificationCenterViewModel notificationCenter, OpenFileDialogCommand openFile, SaveFileDialogCommand saveFile, ISaveService saveService ) : base("File Setup", PackIconKind.File) { this.DirList = dirList; this.NotificationCenter = notificationCenter; OpenFile = openFile; SaveFile = saveFile; this.saveService = saveService; this.SaveFileAction = (path) => saveService.Save(path); }
public StartupViewModel( ISettingsService settingsService, ISaveService saveService, OpenFileDialogCommand openExistingLibraryCommand, LibraryInfoService libraryInfoService, LibraryViewModel libraryViewModel, SaveFileLoadingViewModel loadingScreen, IInjectionProviderService injectionProvider, AppWindow window) { this.MostRecentLibraries = settingsService.MostRecentLibraries; this.OpenNewLibraryCommand = new RelayCommand(_ => openNewLibrary()); this.OpenListedLibraryCommand = new RelayCommand(path => openExistingLibrary(path as string)); this.settingsService = settingsService; this.saveService = saveService; this.OpenExistingLibraryCommand = openExistingLibraryCommand; this.OpenExistingLibraryAction = openExistingLibrary; this.LibraryInfoService = libraryInfoService; this.libraryViewModel = libraryViewModel; this.loadingScreen = loadingScreen; this.injectionProvider = injectionProvider; this.window = window; }
public ImageProcessing() { OpenFileDialogCommand = new OpenFileDialogCommand(this); SaveFileDialogCommand = new SaveFileDialogCommand(this); TransformToGrayScaleCommand = new TransformToGrayScaleCommand(this); }