Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
 private void OnNewForm(object sender, FormViewModel e)
 {
     FormDesignerViewModel.Load(new Form("New Form", "Form Title", new FormGroup[0]));
 }