From 330c34d62c8dfe8ce03041c82b41f51e13ecefed Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Wed, 29 Apr 2020 00:52:48 +0300 Subject: Home navigation, start events view.. --- .../FSE/Tango.FSE.UI/Images/Menu/events.png | Bin 0 -> 1533 bytes .../FSE/Tango.FSE.UI/Tango.FSE.UI.csproj | 11 +++++ .../FSE/Tango.FSE.UI/ViewModelLocator.cs | 9 ++++ .../FSE/Tango.FSE.UI/ViewModels/EventsViewVM.cs | 13 ++++++ .../ViewModels/InternalModuleViewVM.cs | 11 +++++ .../FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs | 24 +++++++++++ .../FSE/Tango.FSE.UI/Views/AccountView.xaml | 1 - .../FSE/Tango.FSE.UI/Views/EventsView.xaml | 16 +++++++ .../FSE/Tango.FSE.UI/Views/EventsView.xaml.cs | 28 +++++++++++++ .../FSE/Tango.FSE.UI/Views/InternalModuleView.xaml | 1 + .../FSE/Tango.FSE.UI/Views/LayoutView.xaml | 46 +++++++++++++++++++-- 11 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/events.png create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/EventsViewVM.cs create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml create mode 100644 Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml.cs diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/events.png b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/events.png new file mode 100644 index 000000000..33d1de883 Binary files /dev/null and b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/events.png differ diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 855797861..6ab4609a5 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -282,12 +282,16 @@ + + + EventsView.xaml + SettingsView.xaml @@ -368,6 +372,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -625,6 +633,9 @@ + + + call "$(DevEnvDir)..\..\vc\vcvarsall.bat" x86 diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs index 3144403b2..3463908e6 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModelLocator.cs @@ -124,6 +124,7 @@ namespace Tango.FSE.UI TangoIOC.Default.Register(); TangoIOC.Default.Register(); TangoIOC.Default.Register(); + TangoIOC.Default.Register(); TangoIOC.Default.Register(); } @@ -191,6 +192,14 @@ namespace Tango.FSE.UI } } + public static EventsViewVM EventsViewVM + { + get + { + return TangoIOC.Default.GetInstance(); + } + } + public static SettingsViewVM SettingsViewVM { get diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/EventsViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/EventsViewVM.cs new file mode 100644 index 000000000..074a9c789 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/EventsViewVM.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common; + +namespace Tango.FSE.UI.ViewModels +{ + public class EventsViewVM : FSEViewModel + { + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/InternalModuleViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/InternalModuleViewVM.cs index 79aa75609..81927608f 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/InternalModuleViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/InternalModuleViewVM.cs @@ -27,6 +27,17 @@ namespace Tango.FSE.UI.ViewModels Image = ResourceHelper.GetImageFromResources("Images/Menu/account.png"), }); + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => + { + NavigationManager.NavigateTo(nameof(EventsView)); + }) + { + Name = "Events", + Index = 1, + Description = "View the active and history of the connected machine events.", + Image = ResourceHelper.GetImageFromResources("Images/Menu/events.png"), + }); + NavigationManager.MenuItems.Add(new NavigationMenuItem(() => { NavigationManager.NavigateTo(nameof(SettingsView)); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs index 3564f9b7b..a55e6cf64 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs @@ -10,6 +10,7 @@ using Tango.FSE.Common; using Tango.FSE.Common.Navigation; using Tango.FSE.Common.Notifications; using Tango.FSE.UI.Panes; +using Tango.FSE.UI.Views; using Tango.Integration.ExternalBridge; using Tango.SharedUI.Helpers; using Tango.Transport; @@ -126,6 +127,16 @@ namespace Tango.FSE.UI.ViewModels /// public RelayCommand ReportIssueCommand { get; set; } + /// + /// Navigates to the events view. + /// + public RelayCommand NavigateToEventsCommand { get; set; } + + /// + /// Navigates to the home view. + /// + public RelayCommand NavigateHomeCommand { get; set; } + #endregion #region Constructors @@ -150,6 +161,9 @@ namespace Tango.FSE.UI.ViewModels _transportInActionTimer = new ActionTimer(TimeSpan.FromMilliseconds(50)); ReportIssueCommand = new RelayCommand(OpenBugReportDialog); + + NavigateToEventsCommand = new RelayCommand(NavigateToEvents); + NavigateHomeCommand = new RelayCommand(NavigateHome); } #endregion @@ -292,6 +306,16 @@ namespace Tango.FSE.UI.ViewModels BugReporter.ShowBugReportDialog(); } + private void NavigateToEvents() + { + NavigationManager.NavigateTo(nameof(EventsView)); + } + + private void NavigateHome() + { + NavigationManager.NavigateTo(NavigationView.Home); + } + #endregion //Not used diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/AccountView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/AccountView.xaml index 630628720..0888e8a5e 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/AccountView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/AccountView.xaml @@ -4,7 +4,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:global="clr-namespace:Tango.FSE.UI" - xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.FSE.UI.ViewModels" xmlns:local="clr-namespace:Tango.FSE.UI.Views" mc:Ignorable="d" diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml new file mode 100644 index 000000000..e169e6d27 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml @@ -0,0 +1,16 @@ + + + + Events + + + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.xaml.cs new file mode 100644 index 000000000..a4a7e9f12 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/EventsView.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.FSE.UI.Views +{ + /// + /// Interaction logic for EventsView.xaml + /// + public partial class EventsView : UserControl + { + public EventsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/InternalModuleView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/InternalModuleView.xaml index e131c99bd..198fb0f6d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/InternalModuleView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/InternalModuleView.xaml @@ -13,6 +13,7 @@ + diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index b6f5cf9de..b6987f9cb 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -259,10 +259,10 @@ - active machine alerts. Press to see more details. + active machine events. Tap to see more details. -