aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Plugins.DefaultTheme/Pages
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Plugins.DefaultTheme/Pages')
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml102
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml.cs268
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml69
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml.cs442
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml14
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml.cs41
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml74
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml.cs545
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml34
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml.cs43
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml13
-rw-r--r--MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml.cs15
12 files changed, 0 insertions, 1660 deletions
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml
deleted file mode 100644
index 1d554e8d9..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml
+++ /dev/null
@@ -1,102 +0,0 @@
-<Pages:BaseDetailPage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.DetailPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:Pages="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI"
- xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300"
- Title="DetailPage">
-
- <Grid>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <Grid Grid.Column="0" Width="50"></Grid>
- <Grid Grid.Column="1">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- </Grid.RowDefinitions>
-
- <TextBlock x:Name="TxtName" Grid.Row="0" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Center" Margin="200 20 200 0" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
-
- <TextBlock x:Name="Tagline" Grid.Row="1" Style="{StaticResource TextBlockStyle}" HorizontalAlignment="Center" Margin="200 20 200 0" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"></TextBlock>
-
- <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 25 0 0">
- <controls:ExtendedButton x:Name="BtnOverview" Style="{StaticResource TextButton}" Margin="50 0 50 0">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">overview</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnMediaInfo" Style="{StaticResource TextButton}" Margin="50 0 50 0">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">media info</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnChapters" Style="{StaticResource TextButton}" Margin="50 0 50 0" Visibility="Collapsed">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">scenes</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnTrailers" Style="{StaticResource TextButton}" Margin="50 0 50 0" Visibility="Collapsed">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">trailers</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnSpecialFeatures" Style="{StaticResource TextButton}" Margin="50 0 50 0" Visibility="Collapsed">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">special features</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnPerformers" Style="{StaticResource TextButton}" Margin="50 0 50 0" Visibility="Collapsed">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">performers</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- <controls:ExtendedButton x:Name="BtnGallery" Style="{StaticResource TextButton}" Margin="50 0 50 0" Visibility="Collapsed">
- <StackPanel Orientation="Horizontal">
- <TextBlock Style="{StaticResource TextBlockStyle}">gallery</TextBlock>
- </StackPanel>
- </controls:ExtendedButton>
- </StackPanel>
-
- <Grid Grid.Row="3">
- <Separator Background="#eeeeee" Margin="50 5 50 0" Height="10"></Separator>
- </Grid>
-
- <Grid Grid.Row="4" Margin="0 25 0 0">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <Grid Grid.Column="0" x:Name="PrimaryImageGrid">
- <Image x:Name="PrimaryImage" Stretch="Uniform" HorizontalAlignment="Center" VerticalAlignment="Top" MaxWidth="550" MaxHeight="700"></Image>
- </Grid>
-
- <Grid Grid.Column="1" Width="50"></Grid>
-
- <Grid Grid.Column="2">
- <ContentControl x:Name="DetailContent"></ContentControl>
- </Grid>
-
- </Grid>
- <Grid Grid.Row="5" Height="50">
- </Grid>
- </Grid>
- <Grid Grid.Column="2" Width="50"></Grid>
- </Grid>
-</Pages:BaseDetailPage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml.cs
deleted file mode 100644
index e907ca6a0..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/DetailPage.xaml.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Net;
-using MediaBrowser.Plugins.DefaultTheme.Controls.Details;
-using MediaBrowser.Plugins.DefaultTheme.Resources;
-using MediaBrowser.UI;
-using MediaBrowser.UI.Controller;
-using MediaBrowser.UI.Pages;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media.Imaging;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for DetailPage.xaml
- /// </summary>
- public partial class DetailPage : BaseDetailPage
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="DetailPage" /> class.
- /// </summary>
- /// <param name="itemId">The item id.</param>
- public DetailPage(string itemId)
- : base(itemId)
- {
- InitializeComponent();
-
- BtnOverview.Click += BtnOverview_Click;
- BtnChapters.Click += BtnChapters_Click;
- BtnMediaInfo.Click += BtnDetails_Click;
- BtnPerformers.Click += BtnPerformers_Click;
- BtnTrailers.Click += BtnTrailers_Click;
- BtnSpecialFeatures.Click += BtnSpecialFeatures_Click;
- BtnGallery.Click += BtnGallery_Click;
- }
-
- /// <summary>
- /// Handles the Click event of the BtnGallery control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnGallery_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Collapsed;
- ShowDetailControl(BtnGallery, new ItemGallery { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnSpecialFeatures control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnSpecialFeatures_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Collapsed;
- ShowDetailControl(BtnSpecialFeatures, new ItemSpecialFeatures { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnTrailers control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnTrailers_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Collapsed;
- ShowDetailControl(BtnTrailers, new ItemTrailers { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnDetails control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnDetails_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Visible;
- ShowDetailControl(BtnMediaInfo, new ItemMediaInfo { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnChapters control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnChapters_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Collapsed;
- ShowDetailControl(BtnChapters, new ItemChapters { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnOverview control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnOverview_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Visible;
- ShowDetailControl(BtnOverview, new ItemOverview { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnPerformers control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnPerformers_Click(object sender, RoutedEventArgs e)
- {
- PrimaryImageGrid.Visibility = Visibility.Collapsed;
- ShowDetailControl(BtnPerformers, new ItemPerformers { });
- }
-
- /// <summary>
- /// Handles the Click event of the BtnQueue control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- void BtnQueue_Click(object sender, RoutedEventArgs e)
- {
- Queue();
- }
-
- /// <summary>
- /// Called when [loaded].
- /// </summary>
- protected override async void OnLoaded()
- {
- base.OnLoaded();
-
- if (Item != null)
- {
- await AppResources.Instance.SetPageTitle(Item);
- }
- }
-
- /// <summary>
- /// Called when [item changed].
- /// </summary>
- protected override async void OnItemChanged()
- {
- base.OnItemChanged();
-
- var pageTitleTask = AppResources.Instance.SetPageTitle(Item);
-
- BtnOverview_Click(null, null);
-
- RenderItem();
-
- await pageTitleTask;
- }
-
- /// <summary>
- /// Renders the item.
- /// </summary>
- private async void RenderItem()
- {
- Task<BitmapImage> primaryImageTask = null;
-
- if (Item.HasPrimaryImage)
- {
- PrimaryImage.Visibility = Visibility.Visible;
-
- primaryImageTask = App.Instance.GetRemoteBitmapAsync(UIKernel.Instance.ApiClient.GetImageUrl(Item, new ImageOptions
- {
- ImageType = ImageType.Primary,
- Quality = 100
- }));
- }
- else
- {
- SetDefaultImage();
- }
-
- if (Item.IsType("movie") || Item.IsType("trailer"))
- {
- TxtName.Visibility = Visibility.Collapsed;
- }
- else
- {
- var name = Item.Name;
-
- if (Item.IndexNumber.HasValue)
- {
- name = Item.IndexNumber.Value + " - " + name;
-
- if (Item.ParentIndexNumber.HasValue)
- {
- name = Item.ParentIndexNumber.Value + "." + name;
- }
- }
- TxtName.Text = name;
-
- TxtName.Visibility = Visibility.Visible;
- }
-
- if (Item.Taglines != null && Item.Taglines.Count > 0)
- {
- Tagline.Visibility = Visibility.Visible;
-
- Tagline.Text = Item.Taglines[0];
- }
- else
- {
- Tagline.Visibility = Visibility.Collapsed;
- }
-
- BtnGallery.Visibility = ItemGallery.GetImages(Item).Count > 0 ? Visibility.Visible : Visibility.Collapsed;
- BtnTrailers.Visibility = Item.HasTrailer ? Visibility.Visible : Visibility.Collapsed;
- BtnSpecialFeatures.Visibility = Item.SpecialFeatureCount > 0 ? Visibility.Visible : Visibility.Collapsed;
- BtnPerformers.Visibility = Item.People != null && Item.People.Length > 0 ? Visibility.Visible : Visibility.Collapsed;
- BtnChapters.Visibility = Item.Chapters != null && Item.Chapters.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
-
- if (primaryImageTask != null)
- {
- try
- {
- PrimaryImage.Source = await primaryImageTask;
- }
- catch (HttpException)
- {
- SetDefaultImage();
- }
- }
- }
-
- /// <summary>
- /// Sets the default image.
- /// </summary>
- private void SetDefaultImage()
- {
- PrimaryImage.Visibility = Visibility.Collapsed;
- }
-
- /// <summary>
- /// Handles the 1 event of the Button_Click control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- Play();
- }
-
- /// <summary>
- /// Handles the 2 event of the Button_Click control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- private async void Button_Click_2(object sender, RoutedEventArgs e)
- {
- await UIKernel.Instance.PlaybackManager.StopAllPlayback();
- }
-
- /// <summary>
- /// Shows the detail control.
- /// </summary>
- /// <param name="button">The button.</param>
- /// <param name="element">The element.</param>
- private void ShowDetailControl(Button button, BaseDetailsControl element)
- {
- DetailContent.Content = element;
- element.Item = Item;
- }
- }
-}
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml
deleted file mode 100644
index 5ac73b2b3..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml
+++ /dev/null
@@ -1,69 +0,0 @@
-<Pages:BaseHomePage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.HomePage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Pages="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI"
- xmlns:themecontrols="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls"
- xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
- Title="HomePage">
-
- <controls:ExtendedScrollViewer x:Name="scrollviewer" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" CanContentScroll="True">
- <controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False" HorizontalAlignment="Stretch">
- <Grid HorizontalAlignment="Stretch">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="4*"></ColumnDefinition>
- <ColumnDefinition Width="1*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <TextBlock HorizontalAlignment="Left" Text="my media >" Grid.Row="0" Grid.Column="0" Style="{StaticResource Heading2TextBlockStyle}" Margin="90 40 0 0"></TextBlock>
-
- <Grid Grid.Row="1" Grid.Column="0" Margin="70 60 20 50">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <controls:ExtendedButton x:Name="btnSpotlight" Style="{StaticResource SpotlightButtonStyle}" Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
- <themecontrols:MultiItemTile x:Name="spotlightControl" DataContext="{Binding SpotlightItems}" ImageWidth="806" ImageHeight="456"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
- <controls:ExtendedButton Style="{StaticResource BaseItemButtonStyle}" Grid.Row="2" Grid.Column="0">
- <themecontrols:MultiItemTile x:Name="recentlyAddedControl" DataContext="{Binding RecentlyAddedItems}" ImageWidth="400" ImageHeight="225"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
- <controls:ExtendedButton Style="{StaticResource BaseItemButtonStyle}" Grid.Row="2" Grid.Column="1">
- <themecontrols:MultiItemTile x:Name="topPicksControl" DataContext="{Binding TopPicks}" ImageWidth="400" ImageHeight="225"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
- <controls:ExtendedButton Style="{StaticResource BaseItemButtonStyle}" Grid.Row="0" Grid.Column="2">
- <themecontrols:MultiItemTile x:Name="recentlyPlayedControl" DataContext="{Binding RecentlyPlayedItems}" ImageWidth="400" ImageHeight="225"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
- <controls:ExtendedButton Style="{StaticResource BaseItemButtonStyle}" Grid.Row="1" Grid.Column="2">
- <themecontrols:MultiItemTile x:Name="resumableControl" DataContext="{Binding ResumableItems}" ImageWidth="400" ImageHeight="225"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
- <controls:ExtendedButton Style="{StaticResource BaseItemButtonStyle}" Grid.Row="2" Grid.Column="2">
- <themecontrols:MultiItemTile x:Name="favoriteItemsControl" DataContext="{Binding FavoriteItems}" ImageWidth="400" ImageHeight="225"></themecontrols:MultiItemTile>
- </controls:ExtendedButton>
-
- </Grid>
- <TextBlock HorizontalAlignment="Left" Text="all media >" Grid.Row="0" Grid.Column="1" Style="{StaticResource Heading2TextBlockStyle}" Margin="90 40 0 0"></TextBlock>
-
- <controls:ExtendedListBox x:Name="lstCollectionFolders" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" ItemsSource="{Binding Path=DisplayChildren,IsAsync=True,Mode=OneWay}" Style="{StaticResource ListBoxStyle}" ItemContainerStyle="{StaticResource ListBoxItemStyle}" Grid.Row="1" Grid.Column="1" AutoFocus="False" ScrollViewer.CanContentScroll="False" ItemTemplate="{StaticResource HomePageListBoxItemTemplate}">
- <controls:ExtendedListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Orientation="Vertical" VerticalAlignment="Top" IsItemsHost="True" Margin="50 60 50 50" />
- </ItemsPanelTemplate>
- </controls:ExtendedListBox.ItemsPanel>
- </controls:ExtendedListBox>
- </Grid>
- </controls:ScrollingPanel>
- </controls:ExtendedScrollViewer>
-</Pages:BaseHomePage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml.cs
deleted file mode 100644
index 719a31f34..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/HomePage.xaml.cs
+++ /dev/null
@@ -1,442 +0,0 @@
-using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Net;
-using MediaBrowser.Plugins.DefaultTheme.Resources;
-using MediaBrowser.UI;
-using MediaBrowser.UI.Controls;
-using MediaBrowser.UI.Pages;
-using MediaBrowser.UI.ViewModels;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for HomePage.xaml
- /// </summary>
- public partial class HomePage : BaseHomePage
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="HomePage" /> class.
- /// </summary>
- public HomePage()
- {
- InitializeComponent();
-
- lstCollectionFolders.ItemInvoked += lstCollectionFolders_ItemInvoked;
- }
-
- /// <summary>
- /// The _favorite items
- /// </summary>
- private ItemCollectionViewModel _favoriteItems;
- /// <summary>
- /// Gets or sets the favorite items.
- /// </summary>
- /// <value>The favorite items.</value>
- public ItemCollectionViewModel FavoriteItems
- {
- get { return _favoriteItems; }
-
- set
- {
- _favoriteItems = value;
- OnPropertyChanged("FavoriteItems");
- }
- }
-
- /// <summary>
- /// The _resumable items
- /// </summary>
- private ItemCollectionViewModel _resumableItems;
- /// <summary>
- /// Gets or sets the resumable items.
- /// </summary>
- /// <value>The resumable items.</value>
- public ItemCollectionViewModel ResumableItems
- {
- get { return _resumableItems; }
-
- set
- {
- _resumableItems = value;
- OnPropertyChanged("ResumableItems");
- }
- }
-
- /// <summary>
- /// The _recently added items
- /// </summary>
- private ItemCollectionViewModel _recentlyAddedItems;
- /// <summary>
- /// Gets or sets the recently added items.
- /// </summary>
- /// <value>The recently added items.</value>
- public ItemCollectionViewModel RecentlyAddedItems
- {
- get { return _recentlyAddedItems; }
-
- set
- {
- _recentlyAddedItems = value;
- OnPropertyChanged("RecentlyAddedItems");
- }
- }
-
- /// <summary>
- /// The _recently played items
- /// </summary>
- private ItemCollectionViewModel _recentlyPlayedItems;
- /// <summary>
- /// Gets or sets the recently played items.
- /// </summary>
- /// <value>The recently played items.</value>
- public ItemCollectionViewModel RecentlyPlayedItems
- {
- get { return _recentlyPlayedItems; }
-
- set
- {
- _recentlyPlayedItems = value;
- OnPropertyChanged("RecentlyPlayedItems");
- }
- }
-
- /// <summary>
- /// The _spotlight items
- /// </summary>
- private ItemCollectionViewModel _spotlightItems;
- /// <summary>
- /// Gets or sets the spotlight items.
- /// </summary>
- /// <value>The spotlight items.</value>
- public ItemCollectionViewModel SpotlightItems
- {
- get { return _spotlightItems; }
-
- set
- {
- _spotlightItems = value;
- OnPropertyChanged("SpotlightItems");
- }
- }
-
- /// <summary>
- /// The _top picks
- /// </summary>
- private ItemCollectionViewModel _topPicks;
- /// <summary>
- /// Gets or sets the top picks.
- /// </summary>
- /// <value>The top picks.</value>
- public ItemCollectionViewModel TopPicks
- {
- get { return _topPicks; }
-
- set
- {
- _topPicks = value;
- OnPropertyChanged("TopPicks");
- }
- }
-
- /// <summary>
- /// LSTs the collection folders_ item invoked.
- /// </summary>
- /// <param name="sender">The sender.</param>
- /// <param name="e">The e.</param>
- void lstCollectionFolders_ItemInvoked(object sender, ItemEventArgs<object> e)
- {
- var model = e.Argument as DtoBaseItemViewModel;
-
- if (model != null)
- {
- App.Instance.NavigateToItem(model.Item);
- }
- }
-
- /// <summary>
- /// Called when [loaded].
- /// </summary>
- protected override void OnLoaded()
- {
- base.OnLoaded();
-
- AppResources.Instance.SetDefaultPageTitle();
- }
-
- /// <summary>
- /// Gets called anytime the Folder gets refreshed
- /// </summary>
- protected override void OnFolderChanged()
- {
- base.OnFolderChanged();
-
- Task.Run(() => RefreshSpecialItems());
- }
-
- /// <summary>
- /// Refreshes the special items.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshSpecialItems()
- {
- var tasks = new List<Task>();
-
- tasks.Add(RefreshFavoriteItemsAsync());
-
- // In-Progress Items
- if (Folder.ResumableItemCount > 0)
- {
- tasks.Add(RefreshResumableItemsAsync());
- }
- else
- {
- SetResumableItems(new BaseItemDto[] { });
- }
-
- // Recently Added Items
- if (Folder.RecentlyAddedItemCount > 0)
- {
- tasks.Add(RefreshRecentlyAddedItemsAsync());
- }
- else
- {
- SetRecentlyAddedItems(new BaseItemDto[] { });
- }
-
- // Recently Played Items
- if (Folder.RecentlyPlayedItemCount > 0)
- {
- tasks.Add(RefreshRecentlyPlayedItemsAsync());
- }
- else
- {
- SetRecentlyPlayedItems(new BaseItemDto[] { });
- }
-
- tasks.Add(RefreshTopPicksAsync());
- tasks.Add(RefreshSpotlightItemsAsync());
-
- await Task.WhenAll(tasks).ConfigureAwait(false);
- }
-
- /// <summary>
- /// Refreshes the favorite items async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshFavoriteItemsAsync()
- {
- var query = new ItemQuery
- {
- Filters = new[] { ItemFilter.IsFavorite },
- ImageTypes = new[] { ImageType.Backdrop, ImageType.Thumb },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.Random },
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
-
- SetFavoriteItems(result.Items);
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Refreshes the resumable items async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshResumableItemsAsync()
- {
- var query = new ItemQuery
- {
- Filters = new[] { ItemFilter.IsResumable },
- ImageTypes = new[] { ImageType.Backdrop, ImageType.Thumb },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.DatePlayed },
- SortOrder = SortOrder.Descending,
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
-
- SetResumableItems(result.Items);
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Refreshes the recently played items async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshRecentlyPlayedItemsAsync()
- {
- var query = new ItemQuery
- {
- Filters = new[] { ItemFilter.IsRecentlyPlayed },
- ImageTypes = new[] { ImageType.Backdrop, ImageType.Thumb },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.DatePlayed },
- SortOrder = SortOrder.Descending,
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
- SetRecentlyPlayedItems(result.Items);
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Refreshes the recently added items async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshRecentlyAddedItemsAsync()
- {
- var query = new ItemQuery
- {
- Filters = new[] { ItemFilter.IsRecentlyAdded, ItemFilter.IsNotFolder },
- ImageTypes = new[] { ImageType.Backdrop, ImageType.Thumb },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.DateCreated },
- SortOrder = SortOrder.Descending,
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
- SetRecentlyAddedItems(result.Items);
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Refreshes the top picks async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshTopPicksAsync()
- {
- var query = new ItemQuery
- {
- ImageTypes = new[] { ImageType.Backdrop, ImageType.Thumb },
- Filters = new[] { ItemFilter.IsRecentlyAdded, ItemFilter.IsNotFolder },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.Random },
- SortOrder = SortOrder.Descending,
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
-
- TopPicks = new ItemCollectionViewModel { Items = result.Items, Name = "Top Picks" };
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Refreshes the spotlight items async.
- /// </summary>
- /// <returns>Task.</returns>
- private async Task RefreshSpotlightItemsAsync()
- {
- var query = new ItemQuery
- {
- ImageTypes = new[] { ImageType.Backdrop },
- ExcludeItemTypes = new[] { "Season" },
- UserId = App.Instance.CurrentUser.Id,
- ParentId = Folder.Id,
- Limit = 10,
- SortBy = new[] { ItemSortBy.Random },
- Recursive = true
- };
-
- try
- {
- var result = await App.Instance.ApiClient.GetItemsAsync(query).ConfigureAwait(false);
-
- SpotlightItems = new ItemCollectionViewModel(rotationPeriodMs: 6000, rotationDevaiationMs: 1000) { Items = result.Items };
- }
- catch (HttpException)
- {
- // Already logged in lower levels
- // Don't allow the entire screen to fail
- }
- }
-
- /// <summary>
- /// Sets the favorite items.
- /// </summary>
- /// <param name="items">The items.</param>
- private void SetFavoriteItems(BaseItemDto[] items)
- {
- FavoriteItems = new ItemCollectionViewModel { Items = items, Name = "Favorites" };
- }
-
- /// <summary>
- /// Sets the resumable items.
- /// </summary>
- /// <param name="items">The items.</param>
- private void SetResumableItems(BaseItemDto[] items)
- {
- ResumableItems = new ItemCollectionViewModel { Items = items, Name = "Resume" };
- }
-
- /// <summary>
- /// Sets the recently played items.
- /// </summary>
- /// <param name="items">The items.</param>
- private void SetRecentlyPlayedItems(BaseItemDto[] items)
- {
- RecentlyPlayedItems = new ItemCollectionViewModel { Items = items, Name = "Recently Played" };
- }
-
- /// <summary>
- /// Sets the recently added items.
- /// </summary>
- /// <param name="items">The items.</param>
- private void SetRecentlyAddedItems(BaseItemDto[] items)
- {
- RecentlyAddedItems = new ItemCollectionViewModel { Items = items, Name = "Recently Added" };
- }
- }
-}
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml
deleted file mode 100644
index e8e4af2aa..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml
+++ /dev/null
@@ -1,14 +0,0 @@
-<pages:BaseInternalPlayerPage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.InternalPlayerPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:pages="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300"
- Title="InternalPlayerPage">
-
- <Grid>
-
- </Grid>
-</pages:BaseInternalPlayerPage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml.cs
deleted file mode 100644
index 82a1e9cf8..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/InternalPlayerPage.xaml.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using MediaBrowser.Plugins.DefaultTheme.Resources;
-using MediaBrowser.UI.Pages;
-using System.Windows;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for InternalPlayerPage.xaml
- /// </summary>
- public partial class InternalPlayerPage : BaseInternalPlayerPage
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="InternalPlayerPage" /> class.
- /// </summary>
- public InternalPlayerPage()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// Called when [loaded].
- /// </summary>
- protected override void OnLoaded()
- {
- base.OnLoaded();
-
- AppResources.Instance.ClearPageTitle();
- AppResources.Instance.HeaderContent.Visibility = Visibility.Collapsed;
- }
-
- /// <summary>
- /// Called when [unloaded].
- /// </summary>
- protected override void OnUnloaded()
- {
- base.OnUnloaded();
-
- AppResources.Instance.HeaderContent.Visibility = Visibility.Visible;
- }
- }
-}
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml
deleted file mode 100644
index 58f6db177..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml
+++ /dev/null
@@ -1,74 +0,0 @@
-<Pages:BaseListPage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.ListPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:Pages="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI"
- xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
- mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300"
- Title="ListPage">
-
- <Page.Resources>
- <ResourceDictionary>
- <Style TargetType="Image" x:Key="CommunityRatingImage">
- <Setter Property="Stretch" Value="Uniform"/>
- <Setter Property="Height" Value="36" />
- </Style>
- <Style TargetType="Image" x:Key="CommunityRatingImageFull" BasedOn="{StaticResource CommunityRatingImage}">
- <Setter Property="Source" Value="../Resources/Images/starFull.png" />
- </Style>
- <Style TargetType="Image" x:Key="CommunityRatingImageHalf" BasedOn="{StaticResource CommunityRatingImage}">
- <Setter Property="Source" Value="../Resources/Images/starHalf.png" />
- </Style>
- <Style TargetType="Image" x:Key="CommunityRatingImageEmpty" BasedOn="{StaticResource CommunityRatingImage}">
- <Setter Property="Source" Value="../Resources/Images/starEmpty.png" />
- </Style>
-
- <Style TargetType="Border" x:Key="MediaInfoSeparator">
- <Setter Property="Height" Value="15" />
- <Setter Property="Width" Value="15" />
- <Setter Property="Background" Value="#cc3333" />
- <Setter Property="Margin" Value="0 0 5 0" />
- </Style>
-
- </ResourceDictionary>
- </Page.Resources>
-
- <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- </Grid.RowDefinitions>
-
- <TextBlock x:Name="TxtName" Style="{StaticResource TextBlockStyle}" Margin="30 0 0 0" Grid.Row="0"></TextBlock>
-
- <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Left" Margin="30 0 0 0">
- <TextBlock x:Name="currentItemIndex" Style="{StaticResource TextBlockStyle}"></TextBlock>
- <TextBlock x:Name="currentItemIndexDivider" Text="|" Style="{StaticResource TextBlockStyle}"></TextBlock>
- <TextBlock Text="{Binding Path=ChildCount,Mode=OneWay}" Style="{StaticResource TextBlockStyle}"></TextBlock>
- </StackPanel>
-
- <Grid Grid.Row="2">
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- </Grid.ColumnDefinitions>
-
- <Grid x:Name="sidebar" Grid.Column="0" Margin="40 50 30 0" Width="560">
- <StackPanel Orientation="Vertical">
-
- <Image x:Name="backdropImage" Stretch="Uniform"></Image>
-
- <TextBlock Text="{Binding Path=Folder.Overview,Mode=OneWay}"></TextBlock>
- </StackPanel>
- </Grid>
-
- <controls:ExtendedListBox x:Name="lstItems" ItemsSource="{Binding Path=DisplayChildren,IsAsync=True,Mode=OneWay}" Style="{StaticResource ListPageListBoxStyle}" ItemContainerStyle="{StaticResource ListBoxItemStyle}" DataContext="{Binding Mode=OneWay}" Grid.Column="1">
- </controls:ExtendedListBox>
- </Grid>
- </Grid>
-</Pages:BaseListPage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml.cs
deleted file mode 100644
index 096ba9ea7..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/ListPage.xaml.cs
+++ /dev/null
@@ -1,545 +0,0 @@
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Net;
-using MediaBrowser.Plugins.DefaultTheme.DisplayPreferences;
-using MediaBrowser.Plugins.DefaultTheme.Resources;
-using MediaBrowser.UI;
-using MediaBrowser.UI.Controls;
-using MediaBrowser.UI.Pages;
-using System;
-using System.Windows;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for ListPage.xaml
- /// </summary>
- public partial class ListPage : BaseListPage
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="ListPage" /> class.
- /// </summary>
- /// <param name="itemId">The item id.</param>
- public ListPage(string itemId)
- : base(itemId)
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// Subclasses must provide the list box that holds the items
- /// </summary>
- /// <value>The items list.</value>
- protected override ExtendedListBox ItemsList
- {
- get
- {
- return lstItems;
- }
- }
-
- /// <summary>
- /// If the page is using it's own image type and not honoring the DisplayPreferences setting, it should return it here
- /// </summary>
- /// <value>The type of the fixed image.</value>
- protected override ImageType? FixedImageType
- {
- get { return ImageType.Primary; }
- }
-
- /// <summary>
- /// Called when [loaded].
- /// </summary>
- protected override async void OnLoaded()
- {
- base.OnLoaded();
-
- if (Folder != null)
- {
- ShowViewButton();
-
- await AppResources.Instance.SetPageTitle(Folder);
- }
- else
- {
- HideViewButton();
- }
- }
-
- /// <summary>
- /// Called when [unloaded].
- /// </summary>
- protected override void OnUnloaded()
- {
- base.OnUnloaded();
-
- HideViewButton();
- }
-
- /// <summary>
- /// Called when [property changed].
- /// </summary>
- /// <param name="name">The name.</param>
- public override void OnPropertyChanged(string name)
- {
- base.OnPropertyChanged(name);
-
- if (name.Equals("CurrentItemIndex", StringComparison.OrdinalIgnoreCase))
- {
- UpdateCurrentItemIndex();
- }
- }
-
- /// <summary>
- /// Updates the index of the current item.
- /// </summary>
- private void UpdateCurrentItemIndex()
- {
- var index = CurrentItemIndex;
-
- currentItemIndex.Visibility = index == -1 ? Visibility.Collapsed : Visibility.Visible;
- currentItemIndex.Text = (CurrentItemIndex + 1).ToString();
-
- currentItemIndexDivider.Visibility = index == -1 ? Visibility.Collapsed : Visibility.Visible;
- }
-
- /// <summary>
- /// Gets called anytime the Folder gets refreshed
- /// </summary>
- protected override async void OnFolderChanged()
- {
- base.OnFolderChanged();
-
- var pageTitleTask = AppResources.Instance.SetPageTitle(Folder);
-
- ShowViewButton();
-
- if (Folder.IsType("Season"))
- {
- TxtName.Visibility = Visibility.Visible;
- TxtName.Text = Folder.Name;
- }
- else
- {
- TxtName.Visibility = Visibility.Collapsed;
- }
-
- if (!string.IsNullOrEmpty(Folder.Overview) || Folder.IsType("Series") || Folder.IsType("Season"))
- {
- sidebar.Visibility = Visibility.Collapsed;
-
- //RefreshSidebar();
- }
- else
- {
- sidebar.Visibility = Visibility.Collapsed;
- }
-
- await pageTitleTask;
- }
-
- /// <summary>
- /// Shows the view button.
- /// </summary>
- private void ShowViewButton()
- {
- var viewButton = AppResources.Instance.ViewButton;
- viewButton.Visibility = Visibility.Visible;
- viewButton.Click -= ViewButton_Click;
- viewButton.Click += ViewButton_Click;
- }
-
- /// <summary>
- /// Hides the view button.
- /// </summary>
- private void HideViewButton()
- {
- var viewButton = AppResources.Instance.ViewButton;
- viewButton.Visibility = Visibility.Collapsed;
- viewButton.Click -= ViewButton_Click;
- }
-
- /// <summary>
- /// Handles the Click event of the ViewButton control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
- async void ViewButton_Click(object sender, RoutedEventArgs e)
- {
- var menu = new DisplayPreferencesMenu
- {
- FolderId = Folder.Id,
- MainPage = this
- };
-
- menu.ShowModal(this.GetWindow());
-
- try
- {
- await App.Instance.ApiClient.UpdateDisplayPreferencesAsync(App.Instance.CurrentUser.Id, Folder.Id, DisplayPreferences);
- }
- catch (HttpException)
- {
- App.Instance.ShowDefaultErrorMessage();
- }
- }
-
- /// <summary>
- /// Refreshes the sidebar.
- /// </summary>
- private void RefreshSidebar()
- {
- //if (Folder.BackdropCount > 0)
- //{
- // //backdropImage.Source = App.Instance.GetBitmapImage(ApiClient.GetImageUrl(Folder.Id, Model.Entities.ImageType.Backdrop, width: 560, height: 315));
- // backdropImage.Visibility = Visibility.Visible;
- //}
- //else
- //{
- // backdropImage.Source = null;
- // backdropImage.Visibility = Visibility.Collapsed;
- //}
- }
-
- /// <summary>
- /// Handles current item selection changes
- /// </summary>
- protected override void OnCurrentItemChanged()
- {
- base.OnCurrentItemChanged();
-
- // Name
- /*if (CurrentItem != null)
- {
- txtName.Visibility = CurrentItem.HasLogo ? Visibility.Collapsed : Visibility.Visible;
- currentItemLogo.Visibility = CurrentItem.HasLogo ? Visibility.Visible : Visibility.Collapsed;
-
- if (CurrentItem.HasLogo)
- {
- var uri = ApiClient.GetImageUrl(CurrentItem.Id, ImageType.Logo, maxWidth: 400, maxHeight: 125);
-
- Dispatcher.InvokeAsync(() => currentItemLogo.Source = App.Instance.GetBitmapImage(new Uri(uri, UriKind.Absolute)));
- }
- else
- {
- var name = CurrentItem.Name;
-
- if (!CurrentItem.IsType("Season") && CurrentItem.IndexNumber.HasValue)
- {
- name = CurrentItem.IndexNumber + " - " + name;
- }
-
- if (CurrentItem.IsType("Movie") && CurrentItem.ProductionYear.HasValue)
- {
- name += " (" + CurrentItem.ProductionYear + ")";
- }
-
- txtName.Text = name;
- }
- }
- else
- {
- txtName.Visibility = Visibility.Collapsed;
- currentItemLogo.Visibility = Visibility.Collapsed;
- }
-
- // PremiereDate
- if (CurrentItem != null && CurrentItem.PremiereDate.HasValue && !CurrentItem.IsType("Series"))
- {
- pnlPremiereDate.Visibility = Visibility.Visible;
-
- var prefix = CurrentItem.IsType("Episode") ? "Aired" : CurrentItem.IsType("Series") ? "First Aired" : "Premiered";
-
- txtPremiereDate.Text = string.Format("{0} {1}", prefix, CurrentItem.PremiereDate.Value.ToShortDateString());
- }
- else
- {
- pnlPremiereDate.Visibility = Visibility.Collapsed;
- }
-
- // Taglines
- if (CurrentItem != null && CurrentItem.Taglines != null && CurrentItem.Taglines.Length > 0)
- {
- txtTagLine.Visibility = Visibility.Visible;
- txtTagLine.Text = CurrentItem.Taglines[0];
- }
- else
- {
- txtTagLine.Visibility = Visibility.Collapsed;
- }
-
- // Genres
- if (CurrentItem != null && CurrentItem.Genres != null && CurrentItem.Genres.Length > 0)
- {
- txtGenres.Visibility = Visibility.Visible;
-
- // Try to keep them on one line by limiting to three
- txtGenres.Text = string.Join(" / ", CurrentItem.Genres.Take(3));
- }
- else
- {
- txtGenres.Visibility = Visibility.Collapsed;
- }
-
- // Season Number
- if (CurrentItem != null && CurrentItem.ParentIndexNumber.HasValue && CurrentItem.IsType("Episode"))
- {
- txtSeasonHeader.Visibility = Visibility.Visible;
-
- txtSeasonHeader.Text = string.Format("Season {0}", CurrentItem.ParentIndexNumber);
- }
- else
- {
- txtSeasonHeader.Visibility = Visibility.Collapsed;
- }
-
- UpdateSeriesAirTime();
- UpdateMiscellaneousFields();
- UpdateCommunityRating();
- UpdateVideoInfo();
- UpdateAudioInfo();*/
- }
-
- /// <summary>
- /// Updates the series air time.
- /// </summary>
- private void UpdateSeriesAirTime()
- {
- /*if (CurrentItem != null && CurrentItem.SeriesInfo != null)
- {
- var series = CurrentItem.SeriesInfo;
-
- txtSeriesAirTime.Visibility = Visibility.Visible;
-
- if (series.Status.HasValue && series.Status.Value == SeriesStatus.Ended)
- {
- txtSeriesAirTime.Text = "Ended";
- }
- else
- {
- string txt = "Airs";
-
- if (series.AirDays.Length > 0)
- {
- if (series.AirDays.Length == 7)
- {
- txt += " Everyday";
- }
- else
- {
- txt += " " + series.AirDays[0].ToString();
- }
- }
-
- if (CurrentItem.Studios != null && CurrentItem.Studios.Length > 0)
- {
- txt += " on " + CurrentItem.Studios[0].Name;
- }
-
- if (!string.IsNullOrEmpty(series.AirTime))
- {
- txt += " at " + series.AirTime;
- }
-
- txtSeriesAirTime.Text = txt;
- }
- }
- else
- {
- txtSeriesAirTime.Visibility = Visibility.Collapsed;
- }*/
- }
-
- /// <summary>
- /// Updates the miscellaneous fields.
- /// </summary>
- private void UpdateMiscellaneousFields()
- {
- /*if (CurrentItem == null)
- {
- pnlRuntime.Visibility = Visibility.Collapsed;
- pnlOfficialRating.Visibility = Visibility.Collapsed;
- }
- else
- {
- var runtimeTicks = CurrentItem.RunTimeTicks ?? 0;
-
- // Runtime
- if (runtimeTicks > 0)
- {
- pnlRuntime.Visibility = Visibility.Visible;
- txtRuntime.Text = string.Format("{0} minutes", Convert.ToInt32(TimeSpan.FromTicks(runtimeTicks).TotalMinutes));
- }
- else
- {
- pnlRuntime.Visibility = Visibility.Collapsed;
- }
-
- pnlOfficialRating.Visibility = string.IsNullOrEmpty(CurrentItem.OfficialRating) ? Visibility.Collapsed : Visibility.Visible;
- }
-
- // Show the parent panel only if one of the children is visible
- pnlMisc.Visibility = pnlRuntime.Visibility == Visibility.Visible ||
- pnlOfficialRating.Visibility == Visibility.Visible
- ? Visibility.Visible
- : Visibility.Collapsed;*/
- }
-
- /// <summary>
- /// Updates the community rating.
- /// </summary>
- private void UpdateCommunityRating()
- {
- /*// Community Rating
- if (CurrentItem != null && CurrentItem.CommunityRating.HasValue)
- {
- pnlRating.Visibility = Visibility.Visible;
- }
- else
- {
- pnlRating.Visibility = Visibility.Collapsed;
- return;
- }
-
- var rating = CurrentItem.CommunityRating.Value;
-
- for (var i = 0; i < 10; i++)
- {
- if (rating < i - 1)
- {
- TreeHelper.FindChild<Image>(this, "communityRatingImage" + i).SetResourceReference(Image.StyleProperty, "CommunityRatingImageEmpty");
- }
- else if (rating < i)
- {
- TreeHelper.FindChild<Image>(this, "communityRatingImage" + i).SetResourceReference(Image.StyleProperty, "CommunityRatingImageHalf");
- }
- else
- {
- TreeHelper.FindChild<Image>(this, "communityRatingImage" + i).SetResourceReference(Image.StyleProperty, "CommunityRatingImageFull");
- }
- }*/
- }
-
- /// <summary>
- /// Updates the video info.
- /// </summary>
- private void UpdateVideoInfo()
- {
- /*if (CurrentItem != null && CurrentItem.VideoInfo != null)
- {
- pnlVideoInfo.Visibility = Visibility.Visible;
- }
- else
- {
- pnlVideoInfo.Visibility = Visibility.Collapsed;
- return;
- }
-
- var videoInfo = CurrentItem.VideoInfo;
-
- if (videoInfo.VideoType == VideoType.VideoFile)
- {
- txtVideoType.Text = Path.GetExtension(CurrentItem.Path).Replace(".", string.Empty).ToLower();
- }
- else
- {
- txtVideoType.Text = videoInfo.VideoType.ToString().ToLower();
- }
-
- txtVideoResolution.Text = GetResolutionText(videoInfo);
- pnlVideoResolution.Visibility = string.IsNullOrEmpty(txtVideoResolution.Text) ? Visibility.Collapsed : Visibility.Visible;
-
- if (!string.IsNullOrEmpty(videoInfo.Codec))
- {
- pnlVideoCodec.Visibility = Visibility.Visible;
- txtVideoCodec.Text = videoInfo.Codec.ToLower();
- }
- else
- {
- pnlVideoCodec.Visibility = Visibility.Collapsed;
- }
-
- var audio = videoInfo.GetDefaultAudioStream();
-
- if (audio == null || string.IsNullOrEmpty(audio.Codec))
- {
- pnlAudioCodec.Visibility = Visibility.Collapsed;
- }
- else
- {
- pnlAudioCodec.Visibility = Visibility.Visible;
- txtAudioCodec.Text = audio.Codec.ToLower();
- }*/
- }
-
- /// <summary>
- /// Updates the audio info.
- /// </summary>
- private void UpdateAudioInfo()
- {
- /*if (CurrentItem != null && CurrentItem.AudioInfo != null)
- {
- pnlAudioInfo.Visibility = Visibility.Visible;
- }
- else
- {
- pnlAudioInfo.Visibility = Visibility.Collapsed;
- return;
- }
-
- var audioInfo = CurrentItem.AudioInfo;
-
- txtAudioType.Text = Path.GetExtension(CurrentItem.Path).Replace(".", string.Empty).ToLower();
-
- if (audioInfo.BitRate > 0)
- {
- pnlAudioBitrate.Visibility = Visibility.Visible;
- txtAudioBitrate.Text = (audioInfo.BitRate / 1000).ToString() + "kbps";
- }
- else
- {
- pnlAudioBitrate.Visibility = Visibility.Collapsed;
- }*/
- }
-
- /*private string GetResolutionText(VideoInfo info)
- {
- var scanType = info.ScanType ?? string.Empty;
-
- if (info.Height == 1080)
- {
- if (scanType.Equals("progressive", StringComparison.OrdinalIgnoreCase))
- {
- return "1080p";
- }
- if (scanType.Equals("interlaced", StringComparison.OrdinalIgnoreCase))
- {
- return "1080i";
- }
- }
- if (info.Height == 720)
- {
- if (scanType.Equals("progressive", StringComparison.OrdinalIgnoreCase))
- {
- return "720p";
- }
- if (scanType.Equals("interlaced", StringComparison.OrdinalIgnoreCase))
- {
- return "720i";
- }
- }
- if (info.Height == 480)
- {
- if (scanType.Equals("progressive", StringComparison.OrdinalIgnoreCase))
- {
- return "480p";
- }
- if (scanType.Equals("interlaced", StringComparison.OrdinalIgnoreCase))
- {
- return "480i";
- }
- }
-
- return info.Width == 0 || info.Height == 0 ? string.Empty : info.Width + "x" + info.Height;
- }*/
- }
-}
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml
deleted file mode 100644
index 6a9e796ee..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml
+++ /dev/null
@@ -1,34 +0,0 @@
-<base:BaseLoginPage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.LoginPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:base="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI"
- xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
- mc:Ignorable="d"
- d:DesignHeight="300"
- d:DesignWidth="300"
- Title="LoginPage">
-
- <Grid HorizontalAlignment="Center">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"></RowDefinition>
- <RowDefinition Height="*"></RowDefinition>
- </Grid.RowDefinitions>
-
- <TextBlock Text="select profile >" Grid.Row="0" HorizontalAlignment="Left" Style="{StaticResource Heading2TextBlockStyle}" Margin="70 30 0 0"></TextBlock>
-
- <controls:ExtendedScrollViewer Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" VerticalAlignment="Stretch" HorizontalAlignment="Center" CanContentScroll="True">
- <controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False">
- <controls:ExtendedListBox x:Name="lstUsers" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding Path=Users,IsAsync=True,Mode=OneWay}" Style="{StaticResource ListBoxStyle}" ItemContainerStyle="{StaticResource ListBoxItemStyle}">
- <controls:ExtendedListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Orientation="Vertical" Margin="50" />
- </ItemsPanelTemplate>
- </controls:ExtendedListBox.ItemsPanel>
- </controls:ExtendedListBox>
- </controls:ScrollingPanel>
- </controls:ExtendedScrollViewer>
- </Grid>
-</base:BaseLoginPage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml.cs
deleted file mode 100644
index 35f2c1088..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/LoginPage.xaml.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using MediaBrowser.Plugins.DefaultTheme.Resources;
-using MediaBrowser.UI.Controls;
-using MediaBrowser.UI.Pages;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for LoginPage.xaml
- /// </summary>
- public partial class LoginPage : BaseLoginPage
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="LoginPage" /> class.
- /// </summary>
- public LoginPage()
- : base()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// Subclasses must provide the list that holds the users
- /// </summary>
- /// <value>The items list.</value>
- protected override ExtendedListBox ItemsList
- {
- get
- {
- return lstUsers;
- }
- }
-
- /// <summary>
- /// Called when [loaded].
- /// </summary>
- protected override void OnLoaded()
- {
- base.OnLoaded();
-
- AppResources.Instance.SetDefaultPageTitle();
- }
- }
-}
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml b/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml
deleted file mode 100644
index 17a8239e5..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-<Pages:BaseWeatherPage x:Class="MediaBrowser.Plugins.DefaultTheme.Pages.WeatherPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:Pages="clr-namespace:MediaBrowser.UI.Pages;assembly=MediaBrowser.UI" mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300"
- Title="WeatherPage">
-
- <Grid>
- <TextBlock>Weather Page</TextBlock>
- </Grid>
-</Pages:BaseWeatherPage>
diff --git a/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml.cs b/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml.cs
deleted file mode 100644
index eae50befb..000000000
--- a/MediaBrowser.Plugins.DefaultTheme/Pages/WeatherPage.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using MediaBrowser.UI.Pages;
-
-namespace MediaBrowser.Plugins.DefaultTheme.Pages
-{
- /// <summary>
- /// Interaction logic for WeatherPage.xaml
- /// </summary>
- public partial class WeatherPage : BaseWeatherPage
- {
- public WeatherPage()
- {
- InitializeComponent();
- }
- }
-}