diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-07-14 21:27:57 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-07-14 21:27:57 +0300 |
| commit | 64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b (patch) | |
| tree | 2dea80413ecffe5aa5d44b1d73d98f1f735e5916 /Software/Visual_Studio/PPC | |
| parent | 7f20e0b3199b469197364cb72436a4843b68b114 (diff) | |
| download | Tango-64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b.tar.gz Tango-64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b.zip | |
Implemented job completed notification item.
Diffstat (limited to 'Software/Visual_Studio/PPC')
16 files changed, 166 insertions, 254 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItem.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItem.cs new file mode 100644 index 000000000..5c48dc606 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItem.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common.Notifications; + +namespace Tango.PPC.Jobs.NotificationItems +{ + public class JobCompletedNotificationItem : NotificationItem + { + public override Type ViewType + { + get + { + return typeof(JobCompletedNotificationItemView); + } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml new file mode 100644 index 000000000..b96337eff --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml @@ -0,0 +1,16 @@ +<UserControl x:Class="Tango.PPC.Jobs.NotificationItems.JobCompletedNotificationItemView" + 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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:local="clr-namespace:Tango.PPC.Jobs.NotificationItems" + mc:Ignorable="d" + d:DesignHeight="60" d:DesignWidth="800"> + <Grid> + <DockPanel> + <touch:TouchIcon Margin="10" DockPanel.Dock="Left" Icon="Check" Foreground="{StaticResource TangoGreenBrush}" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource TangoGreenBrush}">The job has been completed</TextBlock> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml.cs index 5fab4ab44..b6d9797e5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml.cs @@ -13,14 +13,14 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; -namespace Tango.PPC.UI.Notifications.NotificationItems +namespace Tango.PPC.Jobs.NotificationItems { /// <summary> - /// Interaction logic for EmptyCartridgesNotification.xaml + /// Interaction logic for JobCompletedNotificationItemView.xaml /// </summary> - public partial class EmptyCartridgesNotificationView : UserControl + public partial class JobCompletedNotificationItemView : UserControl { - public EmptyCartridgesNotificationView() + public JobCompletedNotificationItemView() { InitializeComponent(); } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index aafa028c7..9ff90ca42 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -92,6 +92,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="NotificationItems\JobCompletedNotificationItemView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Resources\Styles.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -159,6 +163,10 @@ <Compile Include="Messages\JobRemovedMessage.cs" /> <Compile Include="Messages\JobSavedMessage.cs" /> <Compile Include="Messages\JobSelectedMessage.cs" /> + <Compile Include="NotificationItems\JobCompletedNotificationItem.cs" /> + <Compile Include="NotificationItems\JobCompletedNotificationItemView.xaml.cs"> + <DependentUpon>JobCompletedNotificationItemView.xaml</DependentUpon> + </Compile> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> @@ -322,5 +330,8 @@ <ItemGroup> <Resource Include="Images\JobView\sample-dye.png" /> </ItemGroup> + <ItemGroup> + <Folder Include="Images\NotificationItems\" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index 9a0d0f8ab..f3d16e899 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -8,6 +8,7 @@ using Tango.Integration.Operation; using Tango.PPC.Common; using Tango.PPC.Common.Navigation; using Tango.PPC.Jobs.AppBarItems; +using Tango.PPC.Jobs.NotificationItems; using Tango.PPC.Jobs.Views; namespace Tango.PPC.Jobs.ViewModels @@ -45,6 +46,18 @@ namespace Tango.PPC.Jobs.ViewModels Job = jobHandler.Job; jobHandler.StatusChanged += JobHandler_StatusChanged; jobHandler.Stopped += JobHandler_Stopped; + jobHandler.Completed += JobHandler_Completed; + } + + private void JobHandler_Completed(object sender, EventArgs e) + { + InvokeUI(() => + { + NotificationProvider.PushNotification<JobCompletedNotificationItem>().Pressed += (_, __) => + { + NavigationManager.NavigateTo<JobsModule>(nameof(JobView)); + }; + }); } public override void OnNavigatedFrom() @@ -53,7 +66,7 @@ namespace Tango.PPC.Jobs.ViewModels if (MachineProvider.MachineOperator.IsPrinting) { - NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Preesed += (_, __) => + NotificationProvider.PushAppBarItem<JobProgressAppBarItem>().Pressed += (_, __) => { NotificationProvider.CurrentAppBarItem.Close(); NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs index e35164cf7..1c47d2a97 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/AppBarItem.cs @@ -11,71 +11,8 @@ namespace Tango.PPC.Common.Notifications /// <summary> /// Represents an AppBar item that can be inserted into the application header. /// </summary> - /// <seealso cref="System.IDisposable" /> - public abstract class AppBarItem : IDisposable + public abstract class AppBarItem : ItemBase { - /// <summary> - /// Occurs when the AppBar item has been closed. - /// </summary> - public event EventHandler Closed; - /// <summary> - /// Occurs when the AppBar item has been pressed. - /// </summary> - public event EventHandler Preesed; - - /// <summary> - /// Gets or sets the remove action. - /// </summary> - internal Action RemoveAction { get; set; } - - /// <summary> - /// Gets or sets the AppBar view type. - /// </summary> - public abstract Type ViewType { get; } - - /// <summary> - /// Gets or sets the close command. - /// </summary> - public RelayCommand CloseCommand { get; set; } - - /// <summary> - /// Gets or sets the pressed command. - /// </summary - public RelayCommand PressedCommand { get; set; } - - /// <summary> - /// Initializes a new instance of the <see cref="AppBarItem"/> class. - /// </summary> - public AppBarItem() - { - CloseCommand = new RelayCommand(Close); - PressedCommand = new RelayCommand(OnPreesed); - } - - /// <summary> - /// Called when the AppBar item has been pressed. - /// </summary> - protected virtual void OnPreesed() - { - Preesed?.Invoke(this, new EventArgs()); - } - - /// <summary> - /// Called after the close command has been raised. - /// </summary> - public virtual void Close() - { - RemoveAction?.Invoke(); - Closed?.Invoke(this, new EventArgs()); - } - - /// <summary> - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// </summary> - public void Dispose() - { - Close(); - } } } 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 9063cef36..39cf2879f 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs @@ -88,6 +88,13 @@ namespace Tango.PPC.Common.Notifications NotificationItem PushNotification(NotificationItem item); /// <summary> + /// Pushes the notification. + /// </summary> + /// <typeparam name="T"></typeparam> + /// <returns></returns> + NotificationItem PushNotification<T>() where T : NotificationItem; + + /// <summary> /// Displays the specified dialog in a modal design. /// </summary> /// <typeparam name="VM"></typeparam> @@ -115,31 +122,12 @@ namespace Tango.PPC.Common.Notifications Task<VM> ShowDialog<VM>() where VM : DialogViewVM; /// <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; } - - /// <summary> /// Gets a value indicating whether this instance is in global busy state. /// </summary> bool IsInGlobalBusyState { get; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/ItemBase.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/ItemBase.cs new file mode 100644 index 000000000..12369948b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/ItemBase.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core; +using Tango.Core.Commands; + +namespace Tango.PPC.Common.Notifications +{ + public abstract class ItemBase : ExtendedObject, IDisposable + { + /// <summary> + /// Occurs when the item has been closed. + /// </summary> + public event EventHandler Closed; + + /// <summary> + /// Occurs when the item has been pressed. + /// </summary> + public event EventHandler Pressed; + + /// <summary> + /// Gets or sets the remove action. + /// </summary> + internal Action RemoveAction { get; set; } + + /// <summary> + /// Gets or sets the view type. + /// </summary> + public abstract Type ViewType { get; } + + /// <summary> + /// Gets or sets the close command. + /// </summary> + public RelayCommand CloseCommand { get; set; } + + /// <summary> + /// Gets or sets the pressed command. + /// </summary + public RelayCommand PressedCommand { get; set; } + + /// <summary> + /// Initializes a new instance of the <see cref="ItemBase"/> class. + /// </summary> + public ItemBase() + { + CloseCommand = new RelayCommand(Close); + PressedCommand = new RelayCommand(OnPreesed); + } + + /// <summary> + /// Called when the item has been pressed. + /// </summary> + protected virtual void OnPreesed() + { + Pressed?.Invoke(this, new EventArgs()); + } + + /// <summary> + /// Called after the close command has been raised. + /// </summary> + public virtual void Close() + { + RemoveAction?.Invoke(); + Closed?.Invoke(this, new EventArgs()); + } + + /// <summary> + /// Disposes the item. + /// </summary> + public void Dispose() + { + Close(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs index f5e319fa0..e1832090e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/NotificationItem.cs @@ -12,58 +12,8 @@ namespace Tango.PPC.Common.Notifications /// <summary> /// Represents a base notification item. /// </summary> - /// <seealso cref="Tango.Core.ExtendedObject" /> - public abstract class NotificationItem : ExtendedObject, IDisposable + public abstract class NotificationItem : ItemBase { - /// <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/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj index e48da8140..15f5d98c5 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 @@ -108,6 +108,7 @@ <Compile Include="Navigation\INavigationBlocker.cs" /> <Compile Include="Navigation\INavigationResultProvider.cs" /> <Compile Include="Notifications\AppBarItem.cs" /> + <Compile Include="Notifications\ItemBase.cs" /> <Compile Include="Notifications\NotificationItem.cs" /> <Compile Include="PPCModuleAttribute.cs" /> <Compile Include="PPCModuleBase.cs" /> 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 647fc1ef1..0ff9982ee 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs @@ -212,43 +212,20 @@ namespace Tango.PPC.UI.Notifications /// <returns></returns> public NotificationItem PushNotification(NotificationItem item) { - return PushNotification(item, null, false, null); + item.RemoveAction = () => { PopNotification(item); }; + NotificationItems.Insert(0, item); + RaisePropertyChanged(nameof(HasNotificationItems)); + return item; } /// <summary> - /// Inserts the notification item to the bottom of the notifications collection. + /// Pushes the notification. /// </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> + /// <typeparam name="T"></typeparam> /// <returns></returns> - public NotificationItem PushNotification(NotificationItem item, Func<bool> condition, bool autoCheck = true, TimeSpan? checkInterval = default(TimeSpan?)) + public NotificationItem PushNotification<T>() where T : NotificationItem { - 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; + return PushNotification(Activator.CreateInstance<T>()); } /// <summary> @@ -257,33 +234,11 @@ namespace Tango.PPC.UI.Notifications /// <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 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 deleted file mode 100644 index 49a0c03eb..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotification.cs +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index ccb6618e7..000000000 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/NotificationItems/EmptyCartridgesNotificationView.xaml +++ /dev/null @@ -1,15 +0,0 @@ -<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" Margin="5" /> - <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/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 2e344bdc9..dc3745bef 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 @@ -121,10 +121,6 @@ <Compile Include="Navigation\DefaultNavigationManager.cs" /> <Compile Include="Notifications\DefaultNotificationProvider.cs" /> <Compile Include="Notifications\DialogAndView.cs" /> - <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotification.cs" /> - <Compile Include="Notifications\NotificationItems\EmptyCartridgesNotificationView.xaml.cs"> - <DependentUpon>EmptyCartridgesNotificationView.xaml</DependentUpon> - </Compile> <Compile Include="Notifications\PendingNotification.cs" /> <Compile Include="PPCApplication\DefaultPPCApplicationManager.cs" /> <Compile Include="ViewModelLocator.cs" /> @@ -161,10 +157,6 @@ <DependentUpon>MainWindow.xaml</DependentUpon> <SubType>Code</SubType> </Compile> - <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> 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 b3a0c5b1a..11bef4827 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -9,7 +9,6 @@ using Tango.Integration.Operation; 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; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index dcb19dbee..f333ea2e8 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -27,10 +27,12 @@ CurrentDialog="{Binding NotificationProvider.CurrentDialog}"> <touch:TouchPanel.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" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" /> - </Grid> + <touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}"> + <Grid> + <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" /> + <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" /> + </Grid> + </touch:TouchButton> </DataTemplate> </touch:TouchPanel.NotificationTemplate> |
