diff options
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 | 32 |
1 files changed, 32 insertions, 0 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 new file mode 100644 index 000000000..8e0fd2220 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using MaterialDesignThemes.Wpf; +using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.UI.Windows; + +namespace Tango.MachineStudio.UI.Notifications +{ + public class DefaultNotificationProvider : INotificationProvider + { + public bool ShowDialog<T>(PackIconKind icon, string title, object context) where T : FrameworkElement + { + return ShowDialog(icon, title, Activator.CreateInstance<T>(), context); + } + + public bool ShowDialog(PackIconKind icon, string title, FrameworkElement content, object context) + { + DialogWindow dialog = new DialogWindow(content); + dialog.DataContext = context; + dialog.InnerTitle = title; + dialog.Owner = Application.Current.MainWindow; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Visible; + bool result = dialog.ShowDialog().Value; + MainWindow.Instance.shadowGrid.Visibility = Visibility.Hidden; + return result; + } + } +} |
