예제 #1
0
        internal string CreateNewProject(NavigationService navigationService)
        {
            var dlg = new SaveFileDialog
            {
                AddExtension = true,
                DefaultExt   = Persistor.ProjectFileExtension,
                Filter       = $"Project files (*.{Persistor.ProjectFileExtension})|*.{Persistor.ProjectFileExtension}"
            };

            if (dlg.ShowDialog() == true)
            {
                var name    = Path.GetFileNameWithoutExtension(dlg.FileName);
                var project = new Project
                {
                    Name = name,
                    Path = dlg.FileName
                };
                persistor.SaveProject(project);
                navigationService.Navigate(new ProjectPage(project));
                return(project.Path);
            }

            return(null);
        }
예제 #2
0
 private void Save()
 {
     persistor.SaveProject(Project);
 }