diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-17 19:06:13 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-17 19:06:13 +0300 |
| commit | 7658a8546a9c33a76376dff3ab646f2aceaf0a01 (patch) | |
| tree | 10c2cee7f96268e9052e19901f49f3e0a1e75d41 /Software | |
| parent | 22853e394b878578084db1062664c38c40e88d07 (diff) | |
| download | Tango-7658a8546a9c33a76376dff3ab646f2aceaf0a01.tar.gz Tango-7658a8546a9c33a76376dff3ab646f2aceaf0a01.zip | |
Working on PPC !!!
Diffstat (limited to 'Software')
41 files changed, 740 insertions, 23 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex d9178687f..1c56edd7f 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex a9645f179..b81a310db 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Fonts/Flexo/Flexo-Black.otf b/Software/Fonts/Flexo/Flexo-Black.otf Binary files differnew file mode 100644 index 000000000..0341d05db --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Black.otf diff --git a/Software/Fonts/Flexo/Flexo-BlackIt.otf b/Software/Fonts/Flexo/Flexo-BlackIt.otf Binary files differnew file mode 100644 index 000000000..e0823abdf --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-BlackIt.otf diff --git a/Software/Fonts/Flexo/Flexo-Bold.otf b/Software/Fonts/Flexo/Flexo-Bold.otf Binary files differnew file mode 100644 index 000000000..2b9144e5c --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Bold.otf diff --git a/Software/Fonts/Flexo/Flexo-BoldIt.otf b/Software/Fonts/Flexo/Flexo-BoldIt.otf Binary files differnew file mode 100644 index 000000000..f21ed044d --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-BoldIt.otf diff --git a/Software/Fonts/Flexo/Flexo-Demi.otf b/Software/Fonts/Flexo/Flexo-Demi.otf Binary files differnew file mode 100644 index 000000000..ada716012 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Demi.otf diff --git a/Software/Fonts/Flexo/Flexo-DemiIt.otf b/Software/Fonts/Flexo/Flexo-DemiIt.otf Binary files differnew file mode 100644 index 000000000..ab9a133a5 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-DemiIt.otf diff --git a/Software/Fonts/Flexo/Flexo-Heavy.otf b/Software/Fonts/Flexo/Flexo-Heavy.otf Binary files differnew file mode 100644 index 000000000..b3630c982 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Heavy.otf diff --git a/Software/Fonts/Flexo/Flexo-HeavyIt.otf b/Software/Fonts/Flexo/Flexo-HeavyIt.otf Binary files differnew file mode 100644 index 000000000..e47f75546 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-HeavyIt.otf diff --git a/Software/Fonts/Flexo/Flexo-It.otf b/Software/Fonts/Flexo/Flexo-It.otf Binary files differnew file mode 100644 index 000000000..6f9b5fa49 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-It.otf diff --git a/Software/Fonts/Flexo/Flexo-Light.otf b/Software/Fonts/Flexo/Flexo-Light.otf Binary files differnew file mode 100644 index 000000000..27af39094 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Light.otf diff --git a/Software/Fonts/Flexo/Flexo-LightIt.otf b/Software/Fonts/Flexo/Flexo-LightIt.otf Binary files differnew file mode 100644 index 000000000..89085eeca --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-LightIt.otf diff --git a/Software/Fonts/Flexo/Flexo-Medium.otf b/Software/Fonts/Flexo/Flexo-Medium.otf Binary files differnew file mode 100644 index 000000000..04b2a8853 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Medium.otf diff --git a/Software/Fonts/Flexo/Flexo-MediumIt.otf b/Software/Fonts/Flexo/Flexo-MediumIt.otf Binary files differnew file mode 100644 index 000000000..91996979e --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-MediumIt.otf diff --git a/Software/Fonts/Flexo/Flexo-Regular.otf b/Software/Fonts/Flexo/Flexo-Regular.otf Binary files differnew file mode 100644 index 000000000..2703ba3f3 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Regular.otf diff --git a/Software/Fonts/Flexo/Flexo-Thin.otf b/Software/Fonts/Flexo/Flexo-Thin.otf Binary files differnew file mode 100644 index 000000000..666c69931 --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-Thin.otf diff --git a/Software/Fonts/Flexo/Flexo-ThinIt.otf b/Software/Fonts/Flexo/Flexo-ThinIt.otf Binary files differnew file mode 100644 index 000000000..b039daffe --- /dev/null +++ b/Software/Fonts/Flexo/Flexo-ThinIt.otf diff --git a/Software/Graphics/warning.png b/Software/Graphics/warning-test.png Binary files differindex a845b1226..a845b1226 100644 --- a/Software/Graphics/warning.png +++ b/Software/Graphics/warning-test.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index f03c7070a..dde587b84 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -203,12 +203,16 @@ namespace Tango.PPC.Jobs.ViewModels _jobsContext = ObservablesContext.CreateDefault(); - Jobs = _jobsContext.Jobs.Where(x => x.Machine.SerialNumber == Settings.MachineSerialNumber).ToObservableCollection(); - JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs); - JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); - FilterJobCategory(FilterCategory); + var jobs = _jobsContext.Jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection(); - IsLoadingJobs = false; + InvokeUI(() => + { + Jobs = _jobsContext.Jobs.Where(x => x.Machine.Guid == ApplicationManager.Machine.Guid).ToObservableCollection(); + JobsCollectionView = CollectionViewSource.GetDefaultView(Jobs); + JobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending)); + FilterJobCategory(FilterCategory); + IsLoadingJobs = false; + }); }); } @@ -227,7 +231,7 @@ namespace Tango.PPC.Jobs.ViewModels /// <param name="jobCategory">The job category.</param> public void FilterJobCategory(JobCategories jobCategory) { - JobsCollectionView.Filter = (job) => + JobsCollectionView.Filter = (job) => { return (job as Job).JobCategories.Contains(jobCategory); }; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs index 9fc42c155..303392a68 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media; +using Tango.Core.Commands; namespace Tango.PPC.Common.Notifications { @@ -15,6 +16,16 @@ namespace Tango.PPC.Common.Notifications public interface INotificationProvider { /// <summary> + /// Gets the collection of notification items. + /// </summary> + ObservableCollection<NotificationItem> NotificationItems { get; } + + /// <summary> + /// Gets a value indicating whether this instance has notification items. + /// </summary> + bool HasNotificationItems { get; } + + /// <summary> /// Gets the current message box. /// </summary> MessageBoxVM CurrentMessageBox { get; } @@ -47,5 +58,36 @@ namespace Tango.PPC.Common.Notifications /// </summary> /// <param name="message">The message.</param> Task<bool> ShowQuestion(String message); + + /// <summary> + /// Inserts the notification item to the bottom of the notifications collection. + /// </summary> + /// <param name="item">The item.</param> + NotificationItem PushNotification(NotificationItem item); + + /// <summary> + /// Inserts the notification item to the bottom of the notifications collection. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="condition">A condition which determines if this item is still relevant.</param> + /// <param name="autoCheck">Determines whether to perform automatic checking of the condition.</param> + /// <param name="checkInterval">Determines how frequently the condition function will be invoked. (Default 1 second)</param> + NotificationItem PushNotification(NotificationItem item, Func<bool> condition, bool autoCheck = true, TimeSpan? checkInterval = null); + + /// <summary> + /// Removed the specified notification item. + /// </summary> + /// <param name="item">The item.</param> + void PopNotification(NotificationItem item); + + /// <summary> + /// Invokes the notification items conditions. + /// </summary> + void InvokeNotificationItemsConditions(); + + /// <summary> + /// Gets the pop notification command. + /// </summary> + RelayCommand<NotificationItem> PopNotificationCommand { get; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs new file mode 100644 index 000000000..f5e319fa0 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Timers; +using System.Windows.Media; +using Tango.Core; + +namespace Tango.PPC.Common.Notifications +{ + /// <summary> + /// Represents a base notification item. + /// </summary> + /// <seealso cref="Tango.Core.ExtendedObject" /> + public abstract class NotificationItem : ExtendedObject, IDisposable + { + /// <summary> + /// Gets or sets the condition. + /// </summary> + internal Func<bool> Condition { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether [automatic check]. + /// </summary> + internal bool AutoCheck { get; set; } + + /// <summary> + /// Gets or sets the automatic check interval. + /// </summary> + internal TimeSpan AutoCheckInterval { get; set; } + + /// <summary> + /// Gets or sets the remove action. + /// </summary> + internal Action RemoveAction { get; set; } + + /// <summary> + /// Gets or sets the check timer. + /// </summary> + internal Timer Timer { get; set; } + + private String _message; + /// <summary> + /// Gets or sets the notification message. + /// </summary> + public String Message + { + get { return _message; } + set { _message = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Gets or sets the type of the view associated with this notification item. + /// </summary> + public abstract Type ViewType { get; } + + /// <summary> + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// </summary> + public void Dispose() + { + if (RemoveAction != null) + { + RemoveAction(); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs index 636916a53..47bb0427f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Properties/AssemblyInfo.cs @@ -17,3 +17,6 @@ using System.Windows; //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] + +//Friends With +[assembly: InternalsVisibleTo("Tango.PPC.UI")] diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index c64e56b44..9b530be9c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj @@ -95,6 +95,7 @@ <Compile Include="IPPCView.cs" /> <Compile Include="Modules\IPPCModuleLoader.cs" /> <Compile Include="Navigation\INavigationBlocker.cs" /> + <Compile Include="Notifications\NotificationItem.cs" /> <Compile Include="PPCModuleAttribute.cs" /> <Compile Include="PPCModuleBase.cs" /> <Page Include="Controls\MultiPieChart.xaml"> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs new file mode 100644 index 000000000..4e3291b97 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Converters/NotificationItemConverter.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Data; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.UI.Converters +{ + public class NotificationItemConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + NotificationItem item = value as NotificationItem; + + if (item != null) + { + var view = Activator.CreateInstance(item.ViewType) as FrameworkElement; + + if (view == null) + { + throw new InvalidOperationException("The type " + item.ViewType + " is not a framework element."); + } + + view.DataContext = item; + return view; + } + + return null; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning-test.png b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning-test.png Binary files differnew file mode 100644 index 000000000..a845b1226 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Images/warning-test.png diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs index 5e4bd7c30..cbdbab848 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -11,6 +11,8 @@ using Tango.Core; using System.Collections.Concurrent; using System.Windows.Media.Imaging; using Tango.SharedUI.Helpers; +using System.Timers; +using Tango.Core.Commands; namespace Tango.PPC.UI.Notifications { @@ -22,6 +24,11 @@ namespace Tango.PPC.UI.Notifications public class DefaultNotificationProvider : ExtendedObject, INotificationProvider { /// <summary> + /// Gets the collection of notification items. + /// </summary> + public ObservableCollection<NotificationItem> NotificationItems { get; private set; } + + /// <summary> /// Represents a pending message box. /// </summary> private class PendingMessageBox @@ -44,7 +51,10 @@ namespace Tango.PPC.UI.Notifications /// </summary> public DefaultNotificationProvider() { + NotificationItems = new ObservableCollection<NotificationItem>(); _pendingMessageBoxes = new ConcurrentQueue<PendingMessageBox>(); + + PopNotificationCommand = new RelayCommand<NotificationItem>((x) => PopNotification(x)); } private MessageBoxVM _currentMessageBox; @@ -182,5 +192,96 @@ namespace Tango.PPC.UI.Notifications } } } + + /// <summary> + /// Inserts the notification item to the bottom of the notifications collection. + /// </summary> + /// <param name="item">The item.</param> + /// <returns></returns> + public NotificationItem PushNotification(NotificationItem item) + { + return PushNotification(item, null, false, null); + } + + /// <summary> + /// Inserts the notification item to the bottom of the notifications collection. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="condition">A condition which determines if this item is still relevant.</param> + /// <param name="autoCheck">Determines whether to perform automatic checking of the condition.</param> + /// <param name="checkInterval">Determines how frequently the condition function will be invoked. (Default 1 second)</param> + /// <returns></returns> + public NotificationItem PushNotification(NotificationItem item, Func<bool> condition, bool autoCheck = true, TimeSpan? checkInterval = default(TimeSpan?)) + { + item.Condition = condition; + item.AutoCheck = autoCheck; + item.AutoCheckInterval = checkInterval != null ? checkInterval.Value : TimeSpan.FromSeconds(1); + item.RemoveAction = () => { PopNotification(item); }; + NotificationItems.Insert(0, item); + + if (autoCheck && condition != null) + { + Timer timer = new Timer(); + item.Timer = timer; + timer.Interval = item.AutoCheckInterval.TotalMilliseconds; + timer.Elapsed += (x, y) => + { + if (!item.Condition()) + { + PopNotification(item); + } + }; + timer.Start(); + } + + RaisePropertyChanged(nameof(HasNotificationItems)); + + return item; + } + + /// <summary> + /// Removed the specified notification item. + /// </summary> + /// <param name="item">The item.</param> + public void PopNotification(NotificationItem item) + { + if (item.Timer != null) + { + item.Timer.Stop(); + } + + NotificationItems.Remove(item); + + RaisePropertyChanged(nameof(HasNotificationItems)); + } + + /// <summary> + /// Invokes the notification items conditions. + /// </summary> + public void InvokeNotificationItemsConditions() + { + var list = NotificationItems.ToList(); + + foreach (var item in list.Where(x => x.Condition != null)) + { + if (!item.Condition()) + { + PopNotification(item); + } + } + } + + /// <summary> + /// Gets a value indicating whether this instance has notification items. + /// </summary> + public bool HasNotificationItems + { + get + { + return NotificationItems.Count > 0; + } + } + + public RelayCommand<NotificationItem> PopNotificationCommand { get; private set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotification.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotification.cs new file mode 100644 index 000000000..49a0c03eb --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotification.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.BL.Enumerations; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.UI.Notifications.NotificationItems +{ + public class EmptyCartridgesNotification : NotificationItem + { + public List<LiquidType> LiquidTypes { get; set; } + + public EmptyCartridgesNotification() + { + Message = "Cartridges are empty, please replace cartridges"; + } + + public EmptyCartridgesNotification(IEnumerable<LiquidType> liquidTypes) : this() + { + LiquidTypes = liquidTypes.ToList(); + } + + public override Type ViewType + { + get + { + return typeof(EmptyCartridgesNotificationView); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml new file mode 100644 index 000000000..7ce525337 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml @@ -0,0 +1,15 @@ +<UserControl x:Class="Tango.PPC.UI.Notifications.NotificationItems.EmptyCartridgesNotificationView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.PPC.UI.Notifications.NotificationItems" + mc:Ignorable="d" + d:DesignHeight="60" d:DesignWidth="400" MinHeight="50" Background="Transparent" Foreground="#FF7777" d:DataContext="{d:DesignInstance Type=local:EmptyCartridgesNotification, IsDesignTimeCreatable=True}"> + <Grid Margin="10"> + <DockPanel> + <Image Source="/Images/warning-test.png" Width="24" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" TextWrapping="Wrap" Text="{Binding Message}"></TextBlock> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml.cs new file mode 100644 index 000000000..5fab4ab44 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI.Notifications.NotificationItems +{ + /// <summary> + /// Interaction logic for EmptyCartridgesNotification.xaml + /// </summary> + public partial class EmptyCartridgesNotificationView : UserControl + { + public EmptyCartridgesNotificationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index fdeff4fc4..c74e76b50 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -93,12 +93,17 @@ <Link>PPCVersionInfo.cs</Link> </Compile> <Compile Include="Authentication\DefaultAuthenticationProvider.cs" /> + <Compile Include="Converters\NotificationItemConverter.cs" /> <Compile Include="Modules\DefaultStudioModuleLoader.cs" /> <Compile Include="Navigation\DefaultNavigationManager.cs" /> <Compile Include="Notifications\DefaultNotificationProvider.cs" /> <Compile Include="Notifications\MessageBox.xaml.cs"> <DependentUpon>MessageBox.xaml</DependentUpon> </Compile> + <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotification.cs" /> + <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotificationView.xaml.cs"> + <DependentUpon>EmptyCartridgesNotificationView.xaml</DependentUpon> + </Compile> <Compile Include="PPCApplication\DefaultPPCApplicationManager.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\LayoutViewVM.cs" /> @@ -130,6 +135,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Notifications\NotificationItems\EmptyCartridgesNotificationView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Resources\Colors.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -169,6 +178,7 @@ <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> + <Resource Include="Images\warning-test.png" /> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index 99841516e..d65dfc11c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -8,6 +8,7 @@ using Tango.Core.DI; using Tango.PPC.Common; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; +using Tango.PPC.UI.Notifications.NotificationItems; using Tango.PPC.UI.ViewsContracts; using Tango.SharedUI; @@ -35,6 +36,16 @@ namespace Tango.PPC.UI.ViewModels set { _isMenuOpened = value; RaisePropertyChangedAuto(); } } + private bool _isNotificationsOpened; + /// <summary> + /// Gets or sets a value indicating whether to display all notifications. + /// </summary> + public bool IsNotificationsOpened + { + get { return _isNotificationsOpened; } + set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Gets or sets the module navigation command. /// </summary> @@ -51,6 +62,11 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand HomeCommand { get; set; } /// <summary> + /// Gets or sets the notifications area pressed command. + /// </summary> + public RelayCommand NotificationsAreaPressedCommand { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> public LayoutViewVM() @@ -58,6 +74,7 @@ namespace Tango.PPC.UI.ViewModels ModuleNavigationCommand = new RelayCommand<string>(NavigateToModule); HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); + NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); } /// <summary> @@ -73,6 +90,8 @@ namespace Tango.PPC.UI.ViewModels { IsMenuOpened = true; } + + NotificationProvider.PushNotification(new EmptyCartridgesNotification()); } /// <summary> @@ -118,7 +137,22 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public override void OnViewAttached() { - + + } + + /// <summary> + /// Opens the first notification or display all. + /// </summary> + private void OpenFirstNotificationOrDisplayAll() + { + if (NotificationProvider.NotificationItems.Count == 1) + { + //Open first + } + else + { + IsNotificationsOpened = true; + } } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 2b4c68060..524550b94 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -8,14 +8,28 @@ xmlns:fa="http://schemas.fontawesome.io/icons/" xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels" xmlns:global="clr-namespace:Tango.PPC.UI" + xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch" mc:Ignorable="d" d:DesignHeight="1280" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:LayoutViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.LayoutViewVM}"> - <Grid> - <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}"> + <UserControl.Resources> + <localConverters:NotificationItemConverter x:Key="NotificationItemConverter" /> + </UserControl.Resources> + + <touch:TouchNotificationBar HasNotifications="{Binding NotificationProvider.HasNotificationItems}" Notifications="{Binding NotificationProvider.NotificationItems}"> + <touch:TouchNotificationBar.NotificationTemplate> + <DataTemplate> + <Grid> + <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" /> + <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.NotificationProvider.PopNotificationCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" Width="60" Icon="Close" Foreground="White" /> + </Grid> + </DataTemplate> + </touch:TouchNotificationBar.NotificationTemplate> + + <touch:TouchSideMenu x:Name="menu" IsOpened="{Binding IsMenuOpened,Mode=TwoWay}" Grid.Row="1"> <touch:TouchSideMenu.MenuContent> <Border x:Name="border" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoDividerBrush}"> <DockPanel LastChildFill="False" Background="{StaticResource TangoPrimaryBackgroundBrush}"> @@ -59,7 +73,7 @@ </StackPanel> </touch:TouchButton> </StackPanel> - + <ItemsControl ItemsSource="{Binding ModuleLoader.UserModules}" Margin="0 20 0 0"> <ItemsControl.ItemTemplate> <DataTemplate> @@ -98,11 +112,13 @@ </touch:TouchHamburgerButton> </Border> <Grid> - <StackPanel HorizontalAlignment="Right" Margin="30 0" Orientation="Horizontal"> - <touch:TouchButton Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20"> - DYE - </touch:TouchButton> - </StackPanel> + <DockPanel> + <StackPanel DockPanel.Dock="Right" HorizontalAlignment="Right" Margin="30 0" Orientation="Horizontal"> + <touch:TouchButton Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20"> + DYE + </touch:TouchButton> + </StackPanel> + </DockPanel> </Grid> </DockPanel> </Border> @@ -111,12 +127,12 @@ <Grid> <keyboard:KeyboardView> <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom"> - + </controls:NavigationControl> </keyboard:KeyboardView> </Grid> </Grid> </DockPanel> </touch:TouchSideMenu> - </Grid> + </touch:TouchNotificationBar> </UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs index 18ffa8ab2..9ef698656 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,9 +10,11 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; +using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.EventArguments; using Tango.Logging; using Tango.PPC.Common; using Tango.PPC.UI.ViewsContracts; diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs index 948be3c4a..db3ced188 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/ObservableCollectionExtensions.cs @@ -4,12 +4,14 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Data; /// <summary> /// Contains <see cref="ObservableCollection{T}"/> extension methods. /// </summary> public static class ObservableCollectionExtensions { + private static object _syncLock = new object(); /// <summary> /// Replaces the specified old element with the specified new element. @@ -54,5 +56,15 @@ public static class ObservableCollectionExtensions collection.Remove(dragged); collection.Insert(collection.IndexOf(dropped), dragged); } + + /// <summary> + /// Enables cross thread operations on this collection. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <param name="collection">The collection.</param> + public static void EnableCrossThreadOperations<T>(this ObservableCollection<T> collection) + { + BindingOperations.EnableCollectionSynchronization(collection, _syncLock); + } } diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs index 4473e2879..1ba7907f9 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs @@ -782,8 +782,8 @@ namespace Tango.DragAndDrop /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private static void Element_Unloaded(object sender, RoutedEventArgs e) { - FrameworkElement element = sender as FrameworkElement; - UnRegisterDraggable(element); + //FrameworkElement element = sender as FrameworkElement; + //UnRegisterDraggable(element); } #endregion @@ -797,8 +797,8 @@ namespace Tango.DragAndDrop /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param> private static void Element_Unloaded1(object sender, RoutedEventArgs e) { - FrameworkElement element = sender as FrameworkElement; - UnRegisterDroppable(element); + //FrameworkElement element = sender as FrameworkElement; + //UnRegisterDroppable(element); } #endregion diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs index 8d3d2e9f7..11467980a 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchDataGrid.cs @@ -219,6 +219,8 @@ namespace Tango.Touch.Controls /// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param> private void OnRowMouseTouchUp(object sender, MouseOrTouchEventArgs e) { + if (e.OriginalSource.GetType() == typeof(DragThumb)) return; + var row = (e.Source is LightTouchDataGridRow) ? e.Source as LightTouchDataGridRow : (e.Source as DependencyObject).FindAncestor<LightTouchDataGridRow>(); var otherRows = GetRows().Where(x => x != row).ToList(); @@ -266,6 +268,8 @@ namespace Tango.Touch.Controls /// <exception cref="NotImplementedException"></exception> private async void OnRowMouseTouchDown(object sender, MouseOrTouchEventArgs e) { + if (e.OriginalSource.GetType() == typeof(DragThumb)) return; + var row = (e.Source is LightTouchDataGridRow) ? e.Source as LightTouchDataGridRow : (e.Source as DependencyObject).FindAncestor<LightTouchDataGridRow>(); var otherRows = GetRows().Where(x => x != row).ToList(); @@ -363,8 +367,11 @@ namespace Tango.Touch.Controls private void LightTouchDataGrid_Loaded(object sender, RoutedEventArgs e) { - _isLoaded = true; - LayoutRows(); + if (!_isLoaded) + { + _isLoaded = true; + LayoutRows(); + } } private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e) diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs new file mode 100644 index 000000000..d544af8c9 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Core.EventArguments; + +namespace Tango.Touch.Controls +{ + public class TouchNotificationBar : ContentControl + { + private bool _isMouseDown; + private Point _mouseDownLocation; + private bool _isMoving; + private Point _downLocation; + private TouchDevice _touchDevice; + + private Border border_notifications; + private Grid grid_container; + + static TouchNotificationBar() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchNotificationBar), new FrameworkPropertyMetadata(typeof(TouchNotificationBar))); + } + + public double MinNotificationHeight + { + get { return (double)GetValue(MinNotificationHeightProperty); } + set { SetValue(MinNotificationHeightProperty, value); } + } + public static readonly DependencyProperty MinNotificationHeightProperty = + DependencyProperty.Register("MinNotificationHeight", typeof(double), typeof(TouchNotificationBar), new PropertyMetadata(60.0)); + + public double MaxNotificationHeight + { + get { return (double)GetValue(MaxNotificationHeightProperty); } + set { SetValue(MaxNotificationHeightProperty, value); } + } + public static readonly DependencyProperty MaxNotificationHeightProperty = + DependencyProperty.Register("MaxNotificationHeight", typeof(double), typeof(TouchNotificationBar), new PropertyMetadata(100.0)); + + public Thickness NotificationPadding + { + get { return (Thickness)GetValue(NotificationPaddingProperty); } + set { SetValue(NotificationPaddingProperty, value); } + } + public static readonly DependencyProperty NotificationPaddingProperty = + DependencyProperty.Register("NotificationPadding", typeof(Thickness), typeof(TouchNotificationBar), new PropertyMetadata(new Thickness(0))); + + public bool HasNotifications + { + get { return (bool)GetValue(HasNotificationsProperty); } + set { SetValue(HasNotificationsProperty, value); } + } + public static readonly DependencyProperty HasNotificationsProperty = + DependencyProperty.Register("HasNotifications", typeof(bool), typeof(TouchNotificationBar), new PropertyMetadata(false,(d,e) => (d as TouchNotificationBar).OnHasNotificationsChanged())); + + public IList Notifications + { + get { return (IList)GetValue(NotificationsProperty); } + set { SetValue(NotificationsProperty, value); } + } + public static readonly DependencyProperty NotificationsProperty = + DependencyProperty.Register("Notifications", typeof(IList), typeof(TouchNotificationBar), new PropertyMetadata(null)); + + public DataTemplate NotificationTemplate + { + get { return (DataTemplate)GetValue(NotificationTemplateProperty); } + set { SetValue(NotificationTemplateProperty, value); } + } + public static readonly DependencyProperty NotificationTemplateProperty = + DependencyProperty.Register("NotificationTemplate", typeof(DataTemplate), typeof(TouchNotificationBar), new PropertyMetadata(null)); + + public override void OnApplyTemplate() + { + base.OnApplyTemplate(); + border_notifications = GetTemplateChild("PART_BorderNotifications") as Border; + grid_container = GetTemplateChild("PART_Grid_Container") as Grid; + + border_notifications.RegisterForPreviewMouseOrTouchDown(GridNotificationMouseDown); + border_notifications.RegisterForMouseOrTouchMove(GridNotificationMouseMove); + border_notifications.RegisterForPreviewMouseOrTouchUp(GridNotificationMouseUp); + + border_notifications.SizeChanged += Border_notifications_SizeChanged; + } + + private void Border_notifications_SizeChanged(object sender, SizeChangedEventArgs e) + { + double maxPadding = 20; + NotificationPadding = new Thickness((border_notifications.ActualHeight / ActualHeight) * maxPadding); + } + + private void OnHasNotificationsChanged() + { + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(0.2); + + if (HasNotifications) + { + ani.To = MinNotificationHeight; + } + else + { + ani.To = 0; + CloseNotifications(); + } + + grid_container.BeginAnimation(Grid.MinHeightProperty, ani); + } + + private void OpenNotifications() + { + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(0.2); + + if (double.IsNaN(border_notifications.Height)) + { + border_notifications.Height = border_notifications.ActualHeight; + } + + border_notifications.MaxHeight = this.ActualHeight; + ani.To = this.ActualHeight; + border_notifications.BeginAnimation(Grid.HeightProperty, ani); + } + + private void CloseNotifications() + { + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(0.2); + + ani.From = border_notifications.ActualHeight; + ani.To = MinNotificationHeight; + + ani.Completed += (_, __) => + { + border_notifications.BorderThickness = new Thickness(0); + border_notifications.BeginAnimation(Border.HeightProperty, null); + border_notifications.Height = double.NaN; + }; + + border_notifications.BeginAnimation(Border.MaxHeightProperty, ani); + border_notifications.BeginAnimation(Border.HeightProperty, ani); + + ThicknessAnimation tAni = new ThicknessAnimation(); + tAni.Duration = TimeSpan.FromSeconds(0.3); + tAni.To = new Thickness(0); + border_notifications.BeginAnimation(Border.BorderThicknessProperty, tAni); + } + + private void GridNotificationMouseUp(object sender, MouseOrTouchEventArgs e) + { + _isMouseDown = false; + + if (_isMoving) + { + if (_touchDevice != null) + { + border_notifications.ReleaseTouchCapture(_touchDevice); + _touchDevice = null; + } + else + { + border_notifications.ReleaseMouseCapture(); + } + + e.Handled = true; + _isMoving = false; + DoubleAnimation ani = new DoubleAnimation(); + ani.Duration = TimeSpan.FromSeconds(0.2); + + if (e.GetPosition(this).Y > ActualHeight / 2) + { + OpenNotifications(); + } + else + { + CloseNotifications(); + } + } + } + + private void GridNotificationMouseMove(object sender, MouseOrTouchEventArgs e) + { + if (_isMouseDown) + { + if (Math.Abs(e.Location.Y - _downLocation.Y) > 5) + { + _isMoving = true; + } + + if (_isMoving) + { + if (e.TouchDevice != null) + { + border_notifications.CaptureTouch(e.TouchDevice); + } + else + { + Mouse.Capture(border_notifications); + } + border_notifications.Height = Math.Max(e.Location.Y + _mouseDownLocation.Y, MinNotificationHeight); + border_notifications.MaxHeight = Math.Max(e.Location.Y + _mouseDownLocation.Y, MinNotificationHeight); + border_notifications.BeginAnimation(Border.HeightProperty, null); + border_notifications.BeginAnimation(Border.MaxHeightProperty, null); + + border_notifications.BeginAnimation(Border.BorderThicknessProperty, null); + if (border_notifications.ActualHeight > MinNotificationHeight) + { + border_notifications.BorderThickness = new Thickness(0, 0, 0, 20); + } + else + { + border_notifications.BorderThickness = new Thickness(0); + } + } + } + } + + private void GridNotificationMouseDown(object sender, MouseOrTouchEventArgs e) + { + _mouseDownLocation = new Point(e.Location.X, border_notifications.MaxHeight - e.Location.Y); + _downLocation = e.Location; + _isMouseDown = true; + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml new file mode 100644 index 000000000..40b0a2779 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNotificationBar.xaml @@ -0,0 +1,53 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style TargetType="{x:Type local:TouchNotificationBar}"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchNotificationBar}"> + <Border Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" /> + + <Grid x:Name="PART_Grid_Container" VerticalAlignment="Top" Background="Transparent" ClipToBounds="False"> + <Canvas> + <Border x:Name="PART_BorderNotifications" BorderBrush="Silver" Background="#83000000" MaxHeight="{Binding RelativeSource={RelativeSource TemplatedParent},Path=MinNotificationHeight}" Width="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualWidth}"> + <ItemsControl x:Name="notificationsItemsControl" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Notifications}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border BorderBrush="#595959" BorderThickness="0 0 0 5" Padding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=NotificationPadding}" MinHeight="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=MinNotificationHeight}" MaxHeight="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=MaxNotificationHeight}"> + <Border.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Color="#FF282828"/> + <GradientStop Color="#FF464646" Offset="1"/> + </LinearGradientBrush> + </Border.Background> + <ContentControl Content="{Binding}" ContentTemplate="{Binding RelativeSource={RelativeSource AncestorType=local:TouchNotificationBar},Path=NotificationTemplate}"></ContentControl> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Border> + </Canvas> + </Grid> + </Grid> + + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index be6c5add3..c950696d5 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -68,6 +68,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchNotificationBar.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\TouchBusyIndicator.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -158,6 +162,7 @@ <Compile Include="Controls\LightTouchDataGridRow.cs" /> <Compile Include="Controls\LightTouchDataGridSelectionMode.cs" /> <Compile Include="Controls\LightTouchScrollViewer.cs" /> + <Compile Include="Controls\TouchNotificationBar.cs" /> <Compile Include="Controls\TouchBusyIndicator.cs" /> <Compile Include="Controls\TouchContentControl.cs" /> <Compile Include="Controls\TouchDataGridRow.cs" /> diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index 26faaa754..b18184c9a 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -22,6 +22,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/LightTouchScrollViewer.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchHamburgerButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchLoadingPanel.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNotificationBar.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" /> |
