diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-25 17:08:27 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-08-25 17:08:27 -0400 |
| commit | ee91096eb0134016410e094e9f0231f4780e536f (patch) | |
| tree | 50f9fcf00b670ad87152d39d935413b18a6574d4 /MediaBrowser.Common/UI | |
| parent | c124672636e0027ed557b6e24ce54c605312f65c (diff) | |
Added a method in BaseApplication to get the logo image
Diffstat (limited to 'MediaBrowser.Common/UI')
| -rw-r--r-- | MediaBrowser.Common/UI/BaseApplication.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Common/UI/Splash.xaml | 2 | ||||
| -rw-r--r-- | MediaBrowser.Common/UI/Splash.xaml.cs | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/MediaBrowser.Common/UI/BaseApplication.cs b/MediaBrowser.Common/UI/BaseApplication.cs index b526781df..fb771f1e3 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 ac3c3ac98..56c295731 100644 --- a/MediaBrowser.Common/UI/Splash.xaml +++ b/MediaBrowser.Common/UI/Splash.xaml @@ -17,7 +17,7 @@ </RadialGradientBrush>
</Window.Background>
<Grid Name="splashGrid">
- <Image HorizontalAlignment="Left" VerticalAlignment="Top" Source="/MediaBrowser.Common;component/Resources/mblogo.png" Stretch="Uniform" Grid.Row="0" Margin="10 10 10 10"/>
+ <Image x:Name="imgLogo" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="Uniform" Grid.Row="0" Margin="10 10 10 10"/>
<ProgressBar Name="pbProgress" Minimum="0" Maximum="100" HorizontalAlignment="Left" Height="24" Margin="30,110,30,0" Width="460" Grid.Row="1"/>
<Label Name="lblProgress" Content="Label" Margin="0,190,10,0" VerticalContentAlignment="Center" HorizontalAlignment="Center" Grid.Row="2"/>
</Grid>
diff --git a/MediaBrowser.Common/UI/Splash.xaml.cs b/MediaBrowser.Common/UI/Splash.xaml.cs index f66f9ec8f..edfacf016 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();
}
}
}
|
