From 767cdc1f6f6a63ce997fc9476911e2c361f9d402 Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Wed, 20 Feb 2013 20:33:05 -0500 Subject: Pushing missing changes --- MediaBrowser.UI/Controls/WindowCommands.xaml.cs | 132 +++++++++++++++--------- 1 file changed, 82 insertions(+), 50 deletions(-) (limited to 'MediaBrowser.UI/Controls/WindowCommands.xaml.cs') diff --git a/MediaBrowser.UI/Controls/WindowCommands.xaml.cs b/MediaBrowser.UI/Controls/WindowCommands.xaml.cs index 1810c5bf3..e285cced1 100644 --- a/MediaBrowser.UI/Controls/WindowCommands.xaml.cs +++ b/MediaBrowser.UI/Controls/WindowCommands.xaml.cs @@ -1,50 +1,82 @@ -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(); - } - } -} +using System.Windows; +using System.Windows.Controls; + +namespace MediaBrowser.UI.Controls +{ + /// + /// Interaction logic for WindowCommands.xaml + /// + public partial class WindowCommands : UserControl + { + /// + /// Gets the parent window. + /// + /// The parent window. + public Window ParentWindow + { + get { return TreeHelper.TryFindParent(this); } + } + + /// + /// Initializes a new instance of the class. + /// + public WindowCommands() + { + InitializeComponent(); + Loaded += WindowCommandsLoaded; + } + + /// + /// Windows the commands loaded. + /// + /// The sender. + /// The instance containing the event data. + void WindowCommandsLoaded(object sender, RoutedEventArgs e) + { + CloseApplicationButton.Click += CloseApplicationButtonClick; + MinimizeApplicationButton.Click += MinimizeApplicationButtonClick; + MaximizeApplicationButton.Click += MaximizeApplicationButtonClick; + UndoMaximizeApplicationButton.Click += UndoMaximizeApplicationButtonClick; + } + + /// + /// Undoes the maximize application button click. + /// + /// The sender. + /// The instance containing the event data. + void UndoMaximizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Normal; + } + + /// + /// Maximizes the application button click. + /// + /// The sender. + /// The instance containing the event data. + void MaximizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Maximized; + } + + /// + /// Minimizes the application button click. + /// + /// The sender. + /// The instance containing the event data. + void MinimizeApplicationButtonClick(object sender, RoutedEventArgs e) + { + ParentWindow.WindowState = WindowState.Minimized; + } + + /// + /// Closes the application button click. + /// + /// The sender. + /// The instance containing the event data. + void CloseApplicationButtonClick(object sender, RoutedEventArgs e) + { + App.Instance.Shutdown(); + } + } +} -- cgit v1.2.3