From fc6b2a7f54e9f20641ad9948036ae4d6cc87f926 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Sat, 25 Aug 2012 13:05:41 -0400 Subject: Added MahApps.Metro --- MediaBrowser.Common/UI/Splash.xaml | 16 ++++++++++++---- MediaBrowser.Common/UI/Splash.xaml.cs | 8 ++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Common/UI') diff --git a/MediaBrowser.Common/UI/Splash.xaml b/MediaBrowser.Common/UI/Splash.xaml index b02863f41b..8bb6d0acad 100644 --- a/MediaBrowser.Common/UI/Splash.xaml +++ b/MediaBrowser.Common/UI/Splash.xaml @@ -1,11 +1,19 @@ - + xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" + Title="MediaBrowser" + Height="346" + Width="600" + ShowInTaskbar="True" + ResizeMode="NoResize" + WindowStartupLocation="CenterScreen" + WindowState="Normal" + Background="Black"> + - + diff --git a/MediaBrowser.Common/UI/Splash.xaml.cs b/MediaBrowser.Common/UI/Splash.xaml.cs index 5041792917..1fd66bda45 100644 --- a/MediaBrowser.Common/UI/Splash.xaml.cs +++ b/MediaBrowser.Common/UI/Splash.xaml.cs @@ -2,6 +2,7 @@ using System.Runtime.InteropServices; using System.Windows; using System.Windows.Interop; +using MahApps.Metro.Controls; using MediaBrowser.Common.Logging; using MediaBrowser.Model.Progress; @@ -10,7 +11,7 @@ namespace MediaBrowser.Common.UI /// /// Interaction logic for Splash.xaml /// - public partial class Splash : Window + public partial class Splash : MetroWindow { private const int GWL_STYLE = -16; private const int WS_SYSMENU = 0x80000; @@ -19,12 +20,12 @@ namespace MediaBrowser.Common.UI [DllImport("user32.dll")] private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); - public Splash(Progress progress) { InitializeComponent(); progress.ProgressChanged += progress_ProgressChanged; + Loaded+=Splash_Loaded; } void progress_ProgressChanged(object sender, TaskProgress e) @@ -43,6 +44,9 @@ namespace MediaBrowser.Common.UI { var hwnd = new WindowInteropHelper(this).Handle; SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU); + + // Setting this in markup throws an exception at runtime + ShowTitleBar = false; } } } -- cgit v1.2.3