aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-14 21:27:57 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-14 21:27:57 +0300
commit64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b (patch)
tree2dea80413ecffe5aa5d44b1d73d98f1f735e5916 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs
parent7f20e0b3199b469197364cb72436a4843b68b114 (diff)
downloadTango-64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b.tar.gz
Tango-64bcf92608faae31b7cd31ac3da5c7d1d7ebcd0b.zip
Implemented job completed notification item.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItem.cs20
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj11
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs15
5 files changed, 89 insertions, 1 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/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.xaml.cs
new file mode 100644
index 000000000..b6d9797e5
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NotificationItems/JobCompletedNotificationItemView.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.Jobs.NotificationItems
+{
+ /// <summary>
+ /// Interaction logic for JobCompletedNotificationItemView.xaml
+ /// </summary>
+ public partial class JobCompletedNotificationItemView : UserControl
+ {
+ 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));