private void OnOpenForm(object sender, FormViewModel e) { var openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Json files (*.json)|*.json|All files (*.*)|*.*"; if (openFileDialog.ShowDialog() == true) { var jsonString = File.ReadAllText(openFileDialog.FileName); FormDesignerViewModel.Load(Form.FromJson(jsonString)); } else { FormDesignerViewModel.Clear(); } }
private void OnNewForm(object sender, FormViewModel e) { FormDesignerViewModel.Load(new Form("New Form", "Form Title", new FormGroup[0])); }