/// <summary> /// Creates a ExportWindowView and attaches an instance of ExportWindowViewModel to it. /// </summary> /// <returns>The ViewModel of the Window.</returns> public static ExportWindowViewModel SpawnExportWindowView(Project project, string videoPath, double durationSeconds, List<Description> descriptionList, LoadingViewModel loadingViewModel) { var viewModel = new ExportWindowViewModel(project, videoPath, durationSeconds, descriptionList, loadingViewModel); var view = new ExportWindow(viewModel); viewModel.DialogResult = view.ShowDialog(); return viewModel; }
public ExportWindow(ExportWindowViewModel dataContext) { InitializeComponent(); DataContext = dataContext; _viewModel = dataContext; dataContext.ProjectExported += (sender, args) => { DialogResult = true; Close(); }; //Set state for CompressAudio CompressAudio_OnChecked(this, null); }