private async void LoadForm(string transaction, TaxonClass tclass = null) { ClassForm form = new ClassForm() { TransactionForm = transaction, ClassData = (tclass == null) ? new TaxonClass() : tclass, PrimaryButtonText = (transaction == "Add Class") ? "Save" : "Update" }; var result = await form.ShowAsync(); if (result == ContentDialogResult.Primary) { string message = ""; switch (form.TransactionResult) { case 0: message = (form.TransactionForm == "Add Class") ? "Class Inserted to the Database" : "Class Updated in the Database"; break; case 1: message = "The System had run to an Error"; break; case 2: message = "Information is Already Exists in the Database"; break; } MessageDialog dialog = new MessageDialog(message); await dialog.ShowAsync(); this.InitializePage(); } }
private IClassForm createAndShowForm <T>(T dataContext) { var f = new ClassForm <T>(); f.DataContext = dataContext; f.Show(); return(f); }
public void TestSimpleFormRead() { var form = new ClassForm <TestClass>(); var t = new TestClass(); t.Text = "The Text"; t.Number = 42; form.DataContext = t; form.Show(); var app = new Application(); app.Run(); }
public void TestEditSphereMesh() { ClassForm <SphereMesh> form = null; var game = new XNAGame(); var mesh = new SphereMesh(); game.AddXNAObject(mesh); var ev = new AutoResetEvent(false); Application app = null; var t = new Thread(delegate() { app = new Application(); form = new ClassForm <SphereMesh>(); form.DataContext = mesh; form.Show(); ev.Set(); app.Run(); }); t.SetApartmentState(ApartmentState.STA); t.Start(); ev.WaitOne(); game.UpdateEvent += delegate { form.WriteDataContext(); form.ReadDataContext(); }; game.Run(); }
public override void Run() { ClassForm form = new ClassForm(clas); WorkbenchSingleton.AddChild(form, "Edit Class"); }
public override void Run() { ClassForm form = new ClassForm(); WorkbenchSingleton.AddChild(form); }