private void openOutputClick(object sender, RoutedEventArgs e)
        {
            var vm  = DataContext as MainVM;
            var dlg = new SaveProjectWin(new SaveWinVM(vm.project, vm.libManager, vm.setup));

            dlg.ShowDialog();
        }
Exemple #2
0
        private void openOutputClick(object sender, RoutedEventArgs e)
        {
            var vm   = DataContext as MainVM;
            var svvm = new SaveWinVM(vm.project, vm.libManager, vm.setup);

            svvm.PropertyChanged += Svvm_PropertyChanged;

            saveProjectWin = new SaveProjectWin(svvm);


            saveProjectWin.ShowDialog();
        }
        private void save(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as MainVM;

            if (vm.project.isNew)
            {
                saveAs(sender, e);
                vm.project.isNew = false;
            }
            else
            {
                var svvm = new SaveWinVM(vm.project, vm.libManager, vm.setup);
                saveProjectWin = new SaveProjectWin(svvm);
                saveProjectWin.ShowDialog();
            }
        }
        private void saveAs(object sender, RoutedEventArgs e)
        {
            var vm = DataContext as MainVM;

            using (var dialog = new CommonSaveFileDialog())
            {
                try
                {
                    dialog.InitialDirectory = System.IO.Path.GetDirectoryName(vm.project.path);
                    dialog.DefaultFileName  = System.IO.Path.GetFileName(vm.project.path);
                }
                catch { }

                if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    Directory.CreateDirectory(dialog.FileName);
                    vm.projectPath = dialog.FileName;
                    var dlg = new SaveProjectWin(new SaveWinVM(vm.project, vm.libManager, vm.setup));
                    dlg.ShowDialog();
                }
            }
        }