DisplayPreferencesMenu.xaml.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using MediaBrowser.UI.Controls;
  2. using MediaBrowser.UI.Pages;
  3. using System.Windows;
  4. namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
  5. {
  6. /// <summary>
  7. /// Interaction logic for DisplayPreferencesMenu.xaml
  8. /// </summary>
  9. public partial class DisplayPreferencesMenu : BaseModalWindow
  10. {
  11. /// <summary>
  12. /// Gets or sets the main page.
  13. /// </summary>
  14. /// <value>The main page.</value>
  15. public BaseListPage MainPage { get; set; }
  16. /// <summary>
  17. /// Gets or sets the folder id.
  18. /// </summary>
  19. /// <value>The folder id.</value>
  20. public string FolderId { get; set; }
  21. /// <summary>
  22. /// Initializes a new instance of the <see cref="DisplayPreferencesMenu" /> class.
  23. /// </summary>
  24. public DisplayPreferencesMenu()
  25. {
  26. InitializeComponent();
  27. btnClose.Click += btnClose_Click;
  28. }
  29. /// <summary>
  30. /// Handles the Click event of the btnClose control.
  31. /// </summary>
  32. /// <param name="sender">The source of the event.</param>
  33. /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
  34. void btnClose_Click(object sender, RoutedEventArgs e)
  35. {
  36. CloseModal();
  37. }
  38. /// <summary>
  39. /// Closes the modal.
  40. /// </summary>
  41. protected override void CloseModal()
  42. {
  43. if (PageFrame.CanGoBack)
  44. {
  45. PageFrame.GoBackWithTransition();
  46. }
  47. else
  48. {
  49. base.CloseModal();
  50. }
  51. }
  52. /// <summary>
  53. /// Called when [loaded].
  54. /// </summary>
  55. protected override void OnLoaded()
  56. {
  57. base.OnLoaded();
  58. PageFrame.Navigate(new MainPage { DisplayPreferencesWindow = this });
  59. }
  60. /// <summary>
  61. /// Navigates to view menu.
  62. /// </summary>
  63. public void NavigateToViewMenu()
  64. {
  65. PageFrame.NavigateWithTransition(new ViewMenuPage { DisplayPreferencesWindow = this });
  66. }
  67. /// <summary>
  68. /// Navigates to index menu.
  69. /// </summary>
  70. public void NavigateToIndexMenu()
  71. {
  72. PageFrame.NavigateWithTransition(new IndexMenuPage { DisplayPreferencesWindow = this });
  73. }
  74. /// <summary>
  75. /// Navigates to sort menu.
  76. /// </summary>
  77. public void NavigateToSortMenu()
  78. {
  79. PageFrame.NavigateWithTransition(new SortMenuPage { DisplayPreferencesWindow = this });
  80. }
  81. }
  82. }