From afd359b383a09f720d512dbf1f3bb6707dc4b83e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 10 Jul 2018 11:38:50 +0300 Subject: Implemented job type picker dialog. Implemented "native" touch listbox. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes Software/Graphics/Mobile/ball-of-yarn.svg | 89 +++++++++++++++++++ Software/Graphics/Mobile/embroidery.xaml | 54 ++++++++++++ Software/Graphics/Mobile/sewing-machine (1).svg | 7 ++ Software/Graphics/Mobile/sewing-machine (1).xaml | 19 +++++ Software/Graphics/Mobile/sewing-machine.svg | 14 +++ Software/Graphics/Mobile/sewing.xaml | 34 ++++++++ .../Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml | 48 +++++++++++ .../Dialogs/JobTypePickerView.xaml.cs | 32 +++++++ .../Tango.PPC.Jobs/Dialogs/JobTypePickerViewVM.cs | 42 +++++++++ .../Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj | 8 ++ .../Tango.PPC.Jobs/ViewModels/JobsViewVM.cs | 7 +- .../PPC/Tango.PPC.Common/Resources/Merged.xaml | 1 + .../PPCApplication/DefaultPPCApplicationManager.cs | 6 +- .../Tango.BL/Enumerations/JobTypes.cs | 3 + .../CustomAttributes/XamlVectorAttribute.cs | 30 +++++++ .../Visual_Studio/Tango.Core/Tango.Core.csproj | 1 + .../Converters/EnumToXamlVectorConverter.cs | 26 ++++++ .../Tango.SharedUI/Tango.SharedUI.csproj | 1 + .../Tango.Touch/Controls/TouchNativeListBox.cs | 95 +++++++++++++++++++++ .../Tango.Touch/Controls/TouchNativeListBox.xaml | 57 +++++++++++++ .../Visual_Studio/Tango.Touch/Tango.Touch.csproj | 5 ++ .../Visual_Studio/Tango.Touch/Themes/Generic.xaml | 2 + 24 files changed, 577 insertions(+), 4 deletions(-) create mode 100644 Software/Graphics/Mobile/ball-of-yarn.svg create mode 100644 Software/Graphics/Mobile/embroidery.xaml create mode 100644 Software/Graphics/Mobile/sewing-machine (1).svg create mode 100644 Software/Graphics/Mobile/sewing-machine (1).xaml create mode 100644 Software/Graphics/Mobile/sewing-machine.svg create mode 100644 Software/Graphics/Mobile/sewing.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerViewVM.cs create mode 100644 Software/Visual_Studio/Tango.Core/CustomAttributes/XamlVectorAttribute.cs create mode 100644 Software/Visual_Studio/Tango.SharedUI/Converters/EnumToXamlVectorConverter.cs create mode 100644 Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.cs create mode 100644 Software/Visual_Studio/Tango.Touch/Controls/TouchNativeListBox.xaml diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index b9148d93d..180d6a4d6 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index aa502ea4b..caf093b45 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/Mobile/ball-of-yarn.svg b/Software/Graphics/Mobile/ball-of-yarn.svg new file mode 100644 index 000000000..5b7bce46b --- /dev/null +++ b/Software/Graphics/Mobile/ball-of-yarn.svg @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Graphics/Mobile/embroidery.xaml b/Software/Graphics/Mobile/embroidery.xaml new file mode 100644 index 000000000..366f71237 --- /dev/null +++ b/Software/Graphics/Mobile/embroidery.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Graphics/Mobile/sewing-machine (1).svg b/Software/Graphics/Mobile/sewing-machine (1).svg new file mode 100644 index 000000000..41a171227 --- /dev/null +++ b/Software/Graphics/Mobile/sewing-machine (1).svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Software/Graphics/Mobile/sewing-machine (1).xaml b/Software/Graphics/Mobile/sewing-machine (1).xaml new file mode 100644 index 000000000..d07e2910f --- /dev/null +++ b/Software/Graphics/Mobile/sewing-machine (1).xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Software/Graphics/Mobile/sewing-machine.svg b/Software/Graphics/Mobile/sewing-machine.svg new file mode 100644 index 000000000..42d06ec3a --- /dev/null +++ b/Software/Graphics/Mobile/sewing-machine.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Software/Graphics/Mobile/sewing.xaml b/Software/Graphics/Mobile/sewing.xaml new file mode 100644 index 000000000..22f138236 --- /dev/null +++ b/Software/Graphics/Mobile/sewing.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml new file mode 100644 index 000000000..07a662c77 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLOSE + + + + + diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml.cs new file mode 100644 index 000000000..cf5725685 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerView.xaml.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 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; +using Tango.BL.Enumerations; + +namespace Tango.PPC.Jobs.Dialogs +{ + /// + /// Interaction logic for JobTypePickerView.xaml + /// + public partial class JobTypePickerView : UserControl + { + /// + /// Initializes a new instance of the class. + /// + public JobTypePickerView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerViewVM.cs new file mode 100644 index 000000000..ead969126 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/JobTypePickerViewVM.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Enumerations; +using Tango.SharedUI; + +namespace Tango.PPC.Jobs.Dialogs +{ + /// + /// Represents the a job type picker view model + /// + /// + public class JobTypePickerViewVM : DialogViewVM + { + private JobTypes? _selectedJobType; + /// + /// Gets or sets the type of the selected job. + /// + public JobTypes? SelectedJobType + { + get { return _selectedJobType; } + set + { + _selectedJobType = value; + OnSelectedJobTypeChanged(); + } + } + + /// + /// Called when the selected job type has been changed + /// + private void OnSelectedJobTypeChanged() + { + if (SelectedJobType.HasValue) + { + Accept(); + } + } + } +} 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 0a151b54b..0163b77c2 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 @@ -84,6 +84,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -138,6 +142,10 @@ BasicColorCorrectionView.xaml + + JobTypePickerView.xaml + + 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 d2c229187..39963201e 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 @@ -15,6 +15,7 @@ using Tango.Core.Commands; using Tango.Core.DI; using Tango.DragAndDrop; using Tango.PPC.Common; +using Tango.PPC.Jobs.Dialogs; using Tango.PPC.Jobs.Messages; using Tango.PPC.Jobs.Views; @@ -263,11 +264,15 @@ namespace Tango.PPC.Jobs.ViewModels /// private async void AddNewJob() { + var vm = await NotificationProvider.ShowDialog(); + + if (!vm.DialogResult) return; + Job job = new Job(); job.Name = "untitled"; job.CreationDate = DateTime.UtcNow; job.JobStatus = JobStatuses.Draft; - job.JobType = JobTypes.Sewing; + job.JobType = vm.SelectedJobType.Value; job.ColorSpaceGuid = Adapter.ColorSpaces.FirstOrDefault(x => x.Code == ColorSpaces.RGB.ToInt32()).Guid; job.MachineGuid = ApplicationManager.Machine.Guid; job.UserGuid = AuthenticationProvider.CurrentUser.Guid; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml index 21e37307f..7115b6557 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -36,6 +36,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 108726a76..fada6cad8 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -74,6 +74,7 @@ + @@ -129,6 +130,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index f8e3eaea5..971f3dd46 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -37,6 +37,8 @@ + + -- cgit v1.3.1