diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-04 15:28:15 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-03-04 15:28:15 +0200 |
| commit | 2b8e41b5279c2d3ab370595f6593b64ea734ef87 (patch) | |
| tree | 084ceaae9e1b65454e9e2264ce6fdb0511ca4cf9 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI | |
| parent | d734bb5cf08ba2433b74fc86a8858d2437d1a237 (diff) | |
| download | Tango-2b8e41b5279c2d3ab370595f6593b64ea734ef87.tar.gz Tango-2b8e41b5279c2d3ab370595f6593b64ea734ef87.zip | |
Implemented job embroidery image capture, display export,
Implemented running job text to speech.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI')
2 files changed, 51 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs index b3c4f5cb3..bc57aee20 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Authentication/DefaultAuthenticationProvider.cs @@ -8,6 +8,7 @@ using Tango.Core; using Tango.BL.Entities; using Tango.MachineStudio.Common.Authentication; using Tango.BL; +using Tango.BL.Enumerations; namespace Tango.MachineStudio.UI.Authentication { 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 a07c0ef13..1c9b8732f 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -193,6 +193,56 @@ namespace Tango.MachineStudio.UI.Notifications } /// <summary> + /// Shows the specified view with the specified view model as it's data context. + /// </summary> + /// <typeparam name="VM">The type of the mm.</typeparam> + /// <typeparam name="View">The type of the view.</typeparam> + /// <param name="vm">The view model.</param> + /// <param name="view">The view.</param> + /// <param name="onAccept">The accept action.</param> + /// <param name="onCancel">The cancel action.</param> + public void ShowModalDialog<VM, View>(VM vm, View view, Action<VM> onAccept, Action onCancel) where View : FrameworkElement where VM : DialogViewVM + { + DialogWindow dialog = new DialogWindow(); + dialog.Owner = Application.Current.MainWindow; + dialog.InnerContent = view; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + view.Loaded += (x, y) => + { + VM context = vm; + dialog.DataContext = context; + + Action onAcceptAction = null; + onAcceptAction = new Action(() => + { + dialog.Close(); + onAccept(context); + context.Accepted -= onAcceptAction; + }); + + Action onCancelAction = null; + onCancelAction = new Action(() => + { + dialog.Close(); + + if (onCancel != null) + { + onCancel(); + } + + context.Canceled -= onCancelAction; + }); + + context.Accepted += onAcceptAction; + context.Canceled += onCancelAction; + + context.OnShow(); + }; + dialog.ShowDialog(); + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + } + + /// <summary> /// Creates a new view by a naming convention of the specified view model type. /// </summary> /// <typeparam name="VM">The type of the view model.</typeparam> |
