示例#1
0
        /// <summary>
        /// Creates a NewProjectView and attaches an instance of NewProjectViewModel to it.
        /// </summary>
        /// <returns>The ViewModel of the Window.</returns>
        public static NewProjectViewModel SpawnNewProjectView()
        {
            var viewModel = new NewProjectViewModel();
            var view = new NewProjectView(viewModel);
            viewModel.DialogResult = view.ShowDialog();

            return viewModel;
        }
        public NewProjectView(NewProjectViewModel dataContext)
        {
            InitializeComponent();
            DataContext = dataContext;
            _viewModel = dataContext;

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

            //Set state for CopyVideo
            CopyVideo_OnChecked(this, null);
        }