diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-29 00:52:48 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-29 00:52:48 +0300 |
| commit | 330c34d62c8dfe8ce03041c82b41f51e13ecefed (patch) | |
| tree | d0fdf3bae352ad57a63a34760b8616de42d7c5a4 /Software | |
| parent | 233e2ec157a443170f873934e0fa8083cf543ede (diff) | |
| download | Tango-330c34d62c8dfe8ce03041c82b41f51e13ecefed.tar.gz Tango-330c34d62c8dfe8ce03041c82b41f51e13ecefed.zip | |
Home navigation, start events view..
Diffstat (limited to 'Software')
11 files changed, 156 insertions, 4 deletions
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 Binary files differnew file mode 100644 index 000000000..33d1de883 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Images/Menu/events.png 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 @@ <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\AccountViewVM.cs" /> <Compile Include="ViewModels\DashboardViewVM.cs" /> + <Compile Include="ViewModels\EventsViewVM.cs" /> <Compile Include="ViewModels\InternalModuleViewVM.cs" /> <Compile Include="ViewModels\LayoutViewVM.cs" /> <Compile Include="ViewModels\LoadingViewVM.cs" /> <Compile Include="ViewModels\LoginViewVM.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="ViewModels\SettingsViewVM.cs" /> + <Compile Include="Views\EventsView.xaml.cs"> + <DependentUpon>EventsView.xaml</DependentUpon> + </Compile> <Compile Include="Views\SettingsView.xaml.cs"> <DependentUpon>SettingsView.xaml</DependentUpon> </Compile> @@ -368,6 +372,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Views\EventsView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\SettingsView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -625,6 +633,9 @@ <ItemGroup> <Resource Include="Images\alarm_fill_dark.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\Menu\events.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> <PostBuildEvent>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<InternalModuleViewVM>(); TangoIOC.Default.Register<DashboardViewVM>(); TangoIOC.Default.Register<AccountViewVM>(); + TangoIOC.Default.Register<EventsViewVM>(); TangoIOC.Default.Register<SettingsViewVM>(); } @@ -191,6 +192,14 @@ namespace Tango.FSE.UI } } + public static EventsViewVM EventsViewVM + { + get + { + return TangoIOC.Default.GetInstance<EventsViewVM>(); + } + } + 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 @@ -29,6 +29,17 @@ namespace Tango.FSE.UI.ViewModels NavigationManager.MenuItems.Add(new NavigationMenuItem(() => { + NavigationManager.NavigateTo<InternalModule>(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<InternalModule>(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 /// </summary> public RelayCommand ReportIssueCommand { get; set; } + /// <summary> + /// Navigates to the events view. + /// </summary> + public RelayCommand NavigateToEventsCommand { get; set; } + + /// <summary> + /// Navigates to the home view. + /// </summary> + 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<InternalModule>(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 @@ +<UserControl x:Class="Tango.FSE.UI.Views.EventsView" + 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:global="clr-namespace:Tango.FSE.UI" + xmlns:vm="clr-namespace:Tango.FSE.UI.ViewModels" + xmlns:local="clr-namespace:Tango.FSE.UI.Views" + mc:Ignorable="d" + d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:EventsViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.EventsViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid> + <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> + <TextBlock FontSize="100">Events</TextBlock> + </StackPanel> + </Grid> +</UserControl> 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 +{ + /// <summary> + /// Interaction logic for EventsView.xaml + /// </summary> + 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 @@ <controls:NavigationControl TransitionAlwaysFades="True"> <local:DashboardView/> <local:AccountView/> + <local:EventsView/> <local:SettingsView/> </controls:NavigationControl> </Grid> 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 @@ <Grid.ToolTip> <TextBlock> <Run Text="{Binding EventsProvider.ActiveEvents.Count,Mode=OneWay}"></Run> - <Run>active machine alerts. Press to see more details.</Run> + <Run>active machine events. Tap to see more details.</Run> </TextBlock> </Grid.ToolTip> - <Button FocusVisualStyle="{x:Null}" Padding="0" Background="Transparent" BorderThickness="0"> + <Button Command="{Binding NavigateToEventsCommand}" FocusVisualStyle="{x:Null}" Padding="0" Background="Transparent" BorderThickness="0"> <Image Source="/Images/alarm_fill_dark.png" RenderOptions.BitmapScalingMode="Fant"> </Image> @@ -474,7 +474,42 @@ <Grid Panel.ZIndex="100"> <DockPanel> - <Image Source="{StaticResource FSE_Machine_Full}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" Margin="10" /> + <Image x:Name="imgHome" RenderTransformOrigin="0.5,0.5" Cursor="Hand" Source="{StaticResource FSE_Machine_Full}" Stretch="Uniform" RenderOptions.BitmapScalingMode="Fant" Margin="10"> + <i:Interaction.Triggers> + <i:EventTrigger EventName="PreviewMouseUp"> + <i:InvokeCommandAction Command="{Binding NavigateHomeCommand}" /> + </i:EventTrigger> + </i:Interaction.Triggers> + <Image.Style> + <Style TargetType="Image"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Trigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0.9" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="0.9" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </Trigger.EnterActions> + <Trigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </Trigger.ExitActions> + </Trigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> <StackPanel VerticalAlignment="Center"> <TextBlock FontSize="{StaticResource FSE_LargerFontSize}">Tango FSE</TextBlock> <TextBlock HorizontalAlignment="Center" Margin="0 2 0 0" Foreground="{StaticResource FSE_GrayBrush}" FontSize="{StaticResource FSE_SmallFontSize}"> @@ -482,6 +517,11 @@ </TextBlock> </StackPanel> </DockPanel> + + <DockPanel Margin="25 0 0 -20" VerticalAlignment="Bottom" Visibility="{Binding ElementName=imgHome,Path=IsMouseOver,Converter={StaticResource BooleanToVisibilityConverter}}"> + <material:PackIcon Kind="Home" /> + <TextBlock Margin="5 0 0 0">Go To Dashboard...</TextBlock> + </DockPanel> </Grid> <Grid Grid.Row="1"> |
