From af4e99d71390d050e321e4de3530b2774f84ba0c Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 9 May 2023 16:10:17 +0300 Subject: Added loading video on Eureka. --- .../Converters/BuildTypeToVisibilityConverter.cs | 2 +- .../BuildTypeToVisibilityInverseConverter.cs | 2 +- .../PPC/Tango.PPC.Common/Resources/Merged.xaml | 4 +- Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv | Bin 0 -> 6369158 bytes .../PPC/Tango.PPC.UI/Tango.PPC.UI.csproj | 15 ++++++- .../PPC/Tango.PPC.UI/ViewModels/LoginViewVM.cs | 9 +++++ .../PPC/Tango.PPC.UI/Views/LoadingView.xaml | 43 +++------------------ .../PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs | 16 ++++++++ .../Visual_Studio/PPC/Tango.PPC.UI/packages.config | 1 + 9 files changed, 49 insertions(+), 43 deletions(-) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Intro.wmv (limited to 'Software/Visual_Studio') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs index e697c1c6a..a9b3ff8bc 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityConverter.cs @@ -15,7 +15,7 @@ namespace Tango.PPC.Common.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return (BuildType)value == (BuildType)parameter ? Visibility.Visible : Visibility.Collapsed; + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Visible : Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs index a603a6d52..744d0d975 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Converters/BuildTypeToVisibilityInverseConverter.cs @@ -15,7 +15,7 @@ namespace Tango.PPC.Common.Converters { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return (BuildType)value == (BuildType)parameter ? Visibility.Collapsed : Visibility.Visible; + return (BuildType)value == (BuildType)Enum.Parse(typeof(BuildType), parameter.ToStringSafe()) ? Visibility.Collapsed : Visibility.Visible; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 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 5f8cabcca..da4e63b51 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -72,8 +72,8 @@ - - + + - - --> - + + + + + - diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs index a1214a0df..4616ea438 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LoadingView.xaml.cs @@ -12,6 +12,9 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Common.Application; +using Tango.PPC.Common.Build; namespace Tango.PPC.UI.Views { @@ -20,9 +23,22 @@ namespace Tango.PPC.UI.Views /// public partial class LoadingView : UserControl { + public static DateTime VideoStartTime { get; set; } + public LoadingView() { InitializeComponent(); + + var buildProvider = TangoIOC.Default.GetInstance(); + var appManager = TangoIOC.Default.GetInstance(); + + if (buildProvider.IsEureka) + { + VideoStartTime = DateTime.Now; + videoPlayer.Source = new Uri(appManager.StartPath + "\\Intro.wmv", UriKind.Absolute); + videoPlayer.MediaOpened += (_, __) => VideoStartTime = DateTime.Now; + videoPlayer.Play(); + } } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config index ec7ec1e3a..9e3e48198 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/packages.config @@ -11,4 +11,5 @@ + \ No newline at end of file -- cgit v1.3.1