public MainViewModel() { ExitApplicationCmd = new RelayCommand(ExitApplicationExe); SaveDocumentCmd = new RelayCommand(SaveDocumentExe); CreateNewDocumentCmd = new RelayCommand(CreateNewDocumentExe); OpenDocumentCmd = new RelayCommand(OpenDocumentExe); RestoreDefaultComponentsCmd = new RelayCommand(RestoreDefaultComponentsExe); SelectedPage = new DefaultEditPage(); }
private void OpenDocumentExe(object obj) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Linaq files |*.linaq"; openFileDialog.InitialDirectory = @"C:\"; openFileDialog.Title = "Please select file"; openFileDialog.FileName = "NewProject.Linaq"; openFileDialog.Multiselect = false; if (openFileDialog.ShowDialog() == true) { var dc = JsonService.GetObjectFromFile <Document>(openFileDialog.FileName); CurrentSaveLocation = openFileDialog.FileName; SelectedPage = new DefaultEditPage(dc); } }
private void CreateNewDocumentExe(object obj) { SelectedPage = new DefaultEditPage(); }