From 119dfc3ac70db7536e86191eb3c89ffa1fd4f576 Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 20 Sep 2012 11:25:22 -0400 Subject: Adding the UI to the same repo. Made some default theme progress --- MediaBrowser.UI/Controls/WindowCommands.xaml.cs | 50 +++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 MediaBrowser.UI/Controls/WindowCommands.xaml.cs (limited to 'MediaBrowser.UI/Controls/WindowCommands.xaml.cs') diff --git a/MediaBrowser.UI/Controls/WindowCommands.xaml.cs b/MediaBrowser.UI/Controls/WindowCommands.xaml.cs new file mode 100644 index 000000000..1810c5bf3 --- /dev/null +++ b/MediaBrowser.UI/Controls/WindowCommands.xaml.cs @@ -0,0 +1,50 @@ +using System.Windows; +using System.Windows.Controls; + +namespace MediaBrowser.UI.Controls +{ + /// + /// Interaction logic for WindowCommands.xaml + /// + public partial class WindowCommands : UserControl + { + public Window ParentWindow + { + get { return TreeHelper.TryFindParent(this); } + } + + public WindowCommands() + { + InitializeComponent(); + Loaded += WindowCommandsLoaded; + } + + void WindowCommandsLoaded(object sender, RoutedEventArgs e) + { + CloseApplicationButton.Click += CloseApplicationButtonClick; + MinimizeApplicationButton.Click += MinimizeApplicationButtonClick; + MaximizeApplicationButton.Click += MaximizeApplicationButtonClick; + UndoMaximizeApplicationButton.Click += UndoMaximizeApplicationButtonClick; + } + + void UndoMaximizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Normal; + } + + void MaximizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Maximized; + } + + void MinimizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Minimized; + } + + void CloseApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.Close(); + } + } +} -- cgit v1.2.3