diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-23 17:58:59 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-23 17:58:59 +0200 |
| commit | 8ae0f3da19c537eff30e19a1fe99cce51b3116f1 (patch) | |
| tree | 999f8c0ab670b775b4bcde5a4a0d26fb4f287fd5 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs | |
| parent | 891b5703fc8722ecc70c7883213b994f8902bb7b (diff) | |
| download | Tango-8ae0f3da19c537eff30e19a1fe99cce51b3116f1.tar.gz Tango-8ae0f3da19c537eff30e19a1fe99cce51b3116f1.zip | |
A lot of work on Developer Module and Jobs related DB tables.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs index 448625f27..31fb4b1e0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -106,7 +106,7 @@ namespace Tango.MachineStudio.UI.Notifications dialog.DataContext = context; Action onAcceptAction = null; - onAcceptAction = new Action(() => + onAcceptAction = new Action(() => { dialog.Close(); onAccept(context); @@ -114,7 +114,7 @@ namespace Tango.MachineStudio.UI.Notifications }); Action onCancelAction = null; - onCancelAction = new Action(() => + onCancelAction = new Action(() => { dialog.Close(); @@ -198,7 +198,7 @@ namespace Tango.MachineStudio.UI.Notifications context.OnShow(); }; - + dialog.ShowDialog(); MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; } @@ -288,5 +288,32 @@ namespace Tango.MachineStudio.UI.Notifications RaisePropertyChanged(nameof(HasTaskItems)); } + + /// <summary> + /// Shows a dialog with a text input field and returns the response. + /// </summary> + /// <param name="message">The message.</param> + /// <param name="hint">Text field hint.</param> + /// <param name="defaultResponse">Optional default response.</param> + /// <returns></returns> + public string ShowTextInput(string message, string hint, string defaultResponse = null) + { + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + + TextInputBoxWindow dlg = new TextInputBoxWindow() + { + Owner = Application.Current.MainWindow, + Message = message, + IconKind = PackIconKind.Pencil, + IconColor = Brushes.DimGray, + Hint = hint, + Response = defaultResponse + }; + + var result = dlg.ShowDialog(); + + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + return (result.Value ? dlg.Response : null); + } } } |
