Пример #1
0
        /// <summary>
        /// Creates a ExportWindowView and attaches an instance of ExportViewModel to it.
        /// </summary>
        /// <returns>The ViewModel of the Window.</returns>
        public static ExportViewModel SpawnExportWindowView(Project project, string videoPath, double durationSeconds, List<Description> descriptionList, LoadingViewModel loadingViewModel)
        {
            var viewModel = new ExportViewModel(project, videoPath, durationSeconds, descriptionList, loadingViewModel);
            var view = new ExportWindow(viewModel);
            viewModel.DialogResult = view.ShowDialog();

            return viewModel;
        }
        public ExportWindow(ExportViewModel dataContext)
        {
            InitializeComponent();
            DataContext = dataContext;
            _viewModel = dataContext;

            dataContext.ProjectExported += (sender, args) =>
            {
                DialogResult = true;
                Close();
            };

            //Set state for CompressAudio
            CompressAudio_OnChecked(this, null);
        }