protected override void OnExecuted(EventArgs e) { base.OnExecuted(e); try { ToolboxApp.Log.Info("Sending save request to designer."); ToolboxApp.Designer.SaveXaml(); WorkingDialog.Show(); } catch (Exception ex) { ToolboxApp.Log.Error(ex, "Exception occurred while saving XAML."); } finally { ToolboxApp.Log.Info("Save dialog closed."); } }
private void OnSaveXamlMessageReceived(SaveXamlReceived e) { string xaml = null; try { xaml = GetOutput(e.Xaml); } catch (Exception ex) { ToolboxApp.Log.Error(ex, "Error processing XAML."); MessageBox.Show(Application.Instance.MainForm, "Error processing XAML before saving. Please see error log for more details.", "XenForms", MessageBoxType.Error); } finally { WorkingDialog.Close(); } if (!string.IsNullOrWhiteSpace(xaml)) { XenFormsExtensionAcceptance(); var succeeded = ShowSaveDialog(xaml); if (!succeeded) { MessageBox.Show(Application.Instance.MainForm, "The save operation failed. Please review the log for more information.", "XenForms", MessageBoxType.Error); } } }
private void button6_Click(object sender, EventArgs e) { if (WorkingDialog.ShowDialog("Work...", (s, arg) => { arg.HideKBS(); arg.Maximum = 100; arg.Info = "Do something..."; for (int i = 0; i < 100; i++) { arg.Value = i + 1; arg.ShowTime(100, i + 1); Thread.Sleep(25); } })) { MessageBox.Show("OK"); } else { MessageBox.Show("Cancel"); } }