From ee91096eb0134016410e094e9f0231f4780e536f Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Sat, 25 Aug 2012 17:08:27 -0400 Subject: Added a method in BaseApplication to get the logo image --- MediaBrowser.Common/UI/BaseApplication.cs | 17 +++++++++++++++++ MediaBrowser.Common/UI/Splash.xaml | 2 +- MediaBrowser.Common/UI/Splash.xaml.cs | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Common/UI') diff --git a/MediaBrowser.Common/UI/BaseApplication.cs b/MediaBrowser.Common/UI/BaseApplication.cs index b526781dfe..fb771f1e3c 100644 --- a/MediaBrowser.Common/UI/BaseApplication.cs +++ b/MediaBrowser.Common/UI/BaseApplication.cs @@ -1,9 +1,13 @@ using System; +using System.IO; using System.Threading.Tasks; using System.Windows; +using System.Windows.Controls; +using System.Windows.Media.Imaging; using MediaBrowser.Common.Kernel; using MediaBrowser.Common.Logging; using MediaBrowser.Model.Progress; +using System.Reflection; namespace MediaBrowser.Common.UI { @@ -67,5 +71,18 @@ namespace MediaBrowser.Common.UI Kernel.Dispose(); } + + public BitmapImage GetLogoImage() + { + BitmapImage bitmap = new BitmapImage(); + + bitmap.CacheOption = BitmapCacheOption.Default; + + bitmap.BeginInit(); + bitmap.StreamSource = Assembly.GetExecutingAssembly().GetManifestResourceStream("MediaBrowser.Common.Resources.mblogo.png"); + bitmap.EndInit(); + + return bitmap; + } } } diff --git a/MediaBrowser.Common/UI/Splash.xaml b/MediaBrowser.Common/UI/Splash.xaml index ac3c3ac980..56c2957311 100644 --- a/MediaBrowser.Common/UI/Splash.xaml +++ b/MediaBrowser.Common/UI/Splash.xaml @@ -17,7 +17,7 @@ - + diff --git a/MediaBrowser.Common/UI/Splash.xaml.cs b/MediaBrowser.Common/UI/Splash.xaml.cs index f66f9ec8fc..edfacf0167 100644 --- a/MediaBrowser.Common/UI/Splash.xaml.cs +++ b/MediaBrowser.Common/UI/Splash.xaml.cs @@ -35,6 +35,8 @@ namespace MediaBrowser.Common.UI { // Setting this in markup throws an exception at runtime ShowTitleBar = false; + + imgLogo.Source = (Application.Current as BaseApplication).GetLogoImage(); } } } -- cgit v1.2.3