using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Pages;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
    /// 
    /// Interaction logic for DisplayPreferencesMenu.xaml
    /// 
    public partial class DisplayPreferencesMenu : BaseModalWindow
    {
        /// 
        /// Gets or sets the main page.
        /// 
        /// The main page.
        public BaseListPage MainPage { get; set; }
        /// 
        /// Gets or sets the folder id.
        /// 
        /// The folder id.
        public string FolderId { get; set; }
        /// 
        /// Initializes a new instance of the  class.
        /// 
        public DisplayPreferencesMenu()
        {
            InitializeComponent();
            btnClose.Click += btnClose_Click;
        }
        /// 
        /// Handles the Click event of the btnClose control.
        /// 
        /// The source of the event.
        /// The  instance containing the event data.
        void btnClose_Click(object sender, RoutedEventArgs e)
        {
            CloseModal();
        }
        /// 
        /// Closes the modal.
        /// 
        protected override void CloseModal()
        {
            if (PageFrame.CanGoBack)
            {
                PageFrame.GoBackWithTransition();
            }
            else
            {
                base.CloseModal();
            }
        }
        /// 
        /// Called when [loaded].
        /// 
        protected override void OnLoaded()
        {
            base.OnLoaded();
            PageFrame.Navigate(new MainPage { DisplayPreferencesWindow = this });
        }
        /// 
        /// Navigates to view menu.
        /// 
        public void NavigateToViewMenu()
        {
            PageFrame.NavigateWithTransition(new ViewMenuPage { DisplayPreferencesWindow = this });
        }
        /// 
        /// Navigates to index menu.
        /// 
        public void NavigateToIndexMenu()
        {
            PageFrame.NavigateWithTransition(new IndexMenuPage { DisplayPreferencesWindow = this });
        }
        /// 
        /// Navigates to sort menu.
        /// 
        public void NavigateToSortMenu()
        {
            PageFrame.NavigateWithTransition(new SortMenuPage { DisplayPreferencesWindow = this });
        }
    }
}