aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.UI/Controls/WindowCommands.xaml.cs
diff options
context:
space:
mode:
authorebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com>2012-09-20 13:54:37 -0400
committerebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com>2012-09-20 13:54:37 -0400
commit7ed11c0bbae55cd2d5c559a2ef6af8f20edebeef (patch)
treef96d8d2ba2b3ba71b7b31f012fcdd80ae09f0868 /MediaBrowser.UI/Controls/WindowCommands.xaml.cs
parentda618f13e23cbef6ca71c8c0099dfd563a394fa5 (diff)
parent119dfc3ac70db7536e86191eb3c89ffa1fd4f576 (diff)
Merge with default
Diffstat (limited to 'MediaBrowser.UI/Controls/WindowCommands.xaml.cs')
-rw-r--r--MediaBrowser.UI/Controls/WindowCommands.xaml.cs50
1 files changed, 50 insertions, 0 deletions
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
+{
+ /// <summary>
+ /// Interaction logic for WindowCommands.xaml
+ /// </summary>
+ public partial class WindowCommands : UserControl
+ {
+ public Window ParentWindow
+ {
+ get { return TreeHelper.TryFindParent<Window>(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();
+ }
+ }
+}