From b7b277736c7e3ec9258915cdd5a54e7b33ba1123 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 14 Feb 2018 19:14:06 +0200 Subject: Working on Data Capture Module. --- .../Notifications/DefaultNotificationProvider.cs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs') 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 31fb4b1e0..1ea22c587 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/DefaultNotificationProvider.cs @@ -30,6 +30,11 @@ namespace Tango.MachineStudio.UI.Notifications /// public ObservableCollection TaskItems { get; private set; } + /// + /// Gets the collection of active bar items. + /// + public ObservableCollection BarItems { get; private set; } + /// /// Gets a value indicating whether there are any queued task items. /// @@ -58,6 +63,7 @@ namespace Tango.MachineStudio.UI.Notifications public DefaultNotificationProvider() { TaskItems = new ObservableCollection(); + BarItems = new ObservableCollection(); } /// @@ -289,6 +295,39 @@ namespace Tango.MachineStudio.UI.Notifications RaisePropertyChanged(nameof(HasTaskItems)); } + /// + /// Pushes the specified bar item. + /// + /// The bar item. + /// + public BarItem PushBarItem(BarItem barItem) + { + BarItems.Add(barItem); + return barItem; + } + + /// + /// Creates and push a new bar item from the specified framework element. + /// + /// The element. + /// + public BarItem PushBarItem(FrameworkElement element) + { + BarItem item = new BarItem(this); + item.Element = element; + PushBarItem(item); + return item; + } + + /// + /// Removed the specified bar item. + /// + /// The bar item. + public void PopBarItem(BarItem barItem) + { + BarItems.Remove(barItem); + } + /// /// Shows a dialog with a text input field and returns the response. /// -- cgit v1.3.1