private void ExecuteShareViewTemplate(object parameter) { //to do: Make it singleton MachinesManager dataManager = new MachinesManager(); if (this.SelectedTaskViewModel == null) { return; } MachinesView view = new MachinesView(); MachinesViewModel machinesVM = new MachinesViewModel(dataManager.Machines, true); view.DataContext = machinesVM; if (!base.ShowDialog(Translator.Translate("UI_MACHINES"), view)) { return; } foreach (TaskInfo task in this.SelectedTaskViewModel.Tasks) { _viewsManager.ShareTaskAsync(machinesVM.SelectedMachine.Name, this.SelectedTaskViewModel.ViewTemplate, task, task.GetSharedPath()); } }
private void ExecuteShareTask(object parameter) { if (this.SelectedTask == null) { return; } MachinesManager dataManager = new MachinesManager(); MachinesView view = new MachinesView(); MachinesViewModel machinesVM = new MachinesViewModel(dataManager.Machines, true); view.DataContext = machinesVM; if (!base.ShowDialog(Translator.Translate("UI_MACHINES"), view)) { return; } base.ShareSelectedTasks(machinesVM.SelectedMachine.Name); }