moved ui to it's own repo

This commit is contained in:
LukePulverenti 2013-02-23 10:58:08 -05:00
parent 33ed929b52
commit 17c1fd5760
214 changed files with 0 additions and 19327 deletions

View File

@ -1,23 +0,0 @@
<controls:BaseUserControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.BaseItemTile"
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:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid x:Name="mainGrid" HorizontalAlignment="Center">
<Border x:Name="border">
<Image x:Name="image" Stretch="Uniform"></Image>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<TextBlock x:Name="txtName" Margin="10 5 0 10" Foreground="White" TextWrapping="Wrap" Style="{StaticResource TextBlockStyle}"></TextBlock>
</Grid>
</Grid>
</controls:BaseUserControl>

View File

@ -1,177 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Converters;
using MediaBrowser.UI.ViewModels;
using System;
using System.ComponentModel;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.Controls
{
/// <summary>
/// Interaction logic for BaseItemTile.xaml
/// </summary>
public partial class BaseItemTile : BaseUserControl
{
/// <summary>
/// Gets the view model.
/// </summary>
/// <value>The view model.</value>
public DtoBaseItemViewModel ViewModel
{
get { return DataContext as DtoBaseItemViewModel; }
}
/// <summary>
/// Gets the item.
/// </summary>
/// <value>The item.</value>
private BaseItemDto Item
{
get { return ViewModel.Item; }
}
/// <summary>
/// Initializes a new instance of the <see cref="BaseItemTile" /> class.
/// </summary>
public BaseItemTile()
{
InitializeComponent();
DataContextChanged += BaseItemTile_DataContextChanged;
Loaded += BaseItemTile_Loaded;
Unloaded += BaseItemTile_Unloaded;
}
/// <summary>
/// Handles the Unloaded event of the BaseItemTile 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 BaseItemTile_Unloaded(object sender, RoutedEventArgs e)
{
if (ViewModel != null)
{
ViewModel.PropertyChanged -= ViewModel_PropertyChanged;
}
}
/// <summary>
/// Handles the Loaded event of the BaseItemTile 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 BaseItemTile_Loaded(object sender, RoutedEventArgs e)
{
if (ViewModel != null)
{
ViewModel.PropertyChanged -= ViewModel_PropertyChanged;
ViewModel.PropertyChanged += ViewModel_PropertyChanged;
}
}
/// <summary>
/// Handles the DataContextChanged event of the BaseItemTile control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs" /> instance containing the event data.</param>
void BaseItemTile_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
OnItemChanged();
if (ViewModel != null)
{
ViewModel.PropertyChanged -= ViewModel_PropertyChanged;
ViewModel.PropertyChanged += ViewModel_PropertyChanged;
}
}
/// <summary>
/// Handles the PropertyChanged event of the ViewModel control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PropertyChangedEventArgs" /> instance containing the event data.</param>
void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
ReloadImage();
}
/// <summary>
/// Called when [item changed].
/// </summary>
private void OnItemChanged()
{
ReloadImage();
var visibility = Item.HasPrimaryImage && !Item.IsType("Episode") ? Visibility.Collapsed : Visibility.Visible;
if (Item.IsType("Person") || Item.IsType("IndexFolder"))
{
visibility = Visibility.Visible;
}
txtName.Visibility = visibility;
var name = Item.Name;
if (Item.IndexNumber.HasValue)
{
name = Item.IndexNumber + " - " + name;
}
txtName.Text = name;
}
/// <summary>
/// Reloads the image.
/// </summary>
private async void ReloadImage()
{
mainGrid.Height = ViewModel.ParentDisplayPreferences.PrimaryImageHeight;
mainGrid.Width = ViewModel.ParentDisplayPreferences.PrimaryImageWidth;
if (Item.HasPrimaryImage)
{
var url = ViewModel.GetImageUrl(ViewModel.ParentDisplayPreferences.PrimaryImageType);
border.Background = null;
try
{
image.Source = await App.Instance.GetRemoteBitmapAsync(url);
}
catch (HttpException)
{
SetDefaultImage();
}
}
else
{
SetDefaultImage();
}
}
/// <summary>
/// Sets the default image.
/// </summary>
private void SetDefaultImage()
{
if (Item.IsAudio || Item.IsType("MusicAlbum") || Item.IsType("MusicArtist"))
{
var imageUri = new Uri("../Resources/Images/AudioDefault.png", UriKind.Relative);
border.Background = MetroTileBackgroundConverter.GetRandomBackground();
image.Source = App.Instance.GetBitmapImage(imageUri);
}
else
{
var imageUri = new Uri("../Resources/Images/VideoDefault.png", UriKind.Relative);
border.Background = MetroTileBackgroundConverter.GetRandomBackground();
image.Source = App.Instance.GetBitmapImage(imageUri);
}
}
}
}

View File

@ -1,44 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.UI.Controls;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Class BaseDetailsControl
/// </summary>
public abstract class BaseDetailsControl : BaseUserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="BaseDetailsControl" /> class.
/// </summary>
protected BaseDetailsControl()
{
DataContext = this;
}
/// <summary>
/// The _item
/// </summary>
private BaseItemDto _item;
/// <summary>
/// Gets or sets the item.
/// </summary>
/// <value>The item.</value>
public BaseItemDto Item
{
get { return _item; }
set
{
_item = value;
OnPropertyChanged("Item");
OnItemChanged();
}
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected abstract void OnItemChanged();
}
}

View File

@ -1,23 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemChapters"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<controls:ExtendedScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False">
<controls:ExtendedListBox x:Name="lstItems" HorizontalAlignment="Center" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemTemplate="{StaticResource ItemChaptersTemplate}" 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>
</details:BaseDetailsControl>

View File

@ -1,67 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Playback;
using MediaBrowser.UI.ViewModels;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemChapters.xaml
/// </summary>
public partial class ItemChapters : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemChapters" /> class.
/// </summary>
public ItemChapters()
{
InitializeComponent();
lstItems.ItemInvoked += lstItems_ItemInvoked;
}
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var chapterViewModel = (ChapterInfoDtoViewModel) e.Argument;
UIKernel.Instance.PlaybackManager.Play(new PlayOptions
{
Items = new List<BaseItemDto> { Item },
StartPositionTicks = chapterViewModel.Chapter.StartPositionTicks
});
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override void OnItemChanged()
{
const double height = 297;
var width = ChapterInfoDtoViewModel.GetChapterImageWidth(Item, height, 528);
var chapters = Item.Chapters ?? new List<ChapterInfoDto> { };
lstItems.ItemsSource = new ObservableCollection<ChapterInfoDtoViewModel>(chapters.Select(i => new ChapterInfoDtoViewModel
{
Item = Item,
Chapter = i,
ImageWidth = width,
ImageHeight = height,
ImageDownloadOptions = new ImageOptions
{
MaxHeight = 400
}
}));
}
}
}

View File

@ -1,23 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemGallery"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<controls:ExtendedScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False">
<controls:ExtendedListBox VerticalAlignment="Top" HorizontalAlignment="Center" x:Name="lstItems" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemTemplate="{StaticResource ItemGalleryTemplate}" 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>
</details:BaseDetailsControl>

View File

@ -1,163 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.Controls;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemGallery.xaml
/// </summary>
public partial class ItemGallery : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemGallery" /> class.
/// </summary>
public ItemGallery()
: base()
{
InitializeComponent();
lstItems.ItemInvoked += lstItems_ItemInvoked;
}
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var img = (BitmapImage)e.Argument;
var index = Images.IndexOf(img);
//App.Instance.OpenImageViewer(new Uri(ImageUrls[index]), Item.Name);
}
/// <summary>
/// The _images
/// </summary>
private List<BitmapImage> _images;
/// <summary>
/// Gets or sets the images.
/// </summary>
/// <value>The images.</value>
public List<BitmapImage> Images
{
get { return _images; }
set
{
_images = value;
lstItems.ItemsSource = value;
OnPropertyChanged("Images");
}
}
/// <summary>
/// Gets or sets the image urls.
/// </summary>
/// <value>The image urls.</value>
private List<string> ImageUrls { get; set; }
/// <summary>
/// Called when [item changed].
/// </summary>
protected override async void OnItemChanged()
{
ImageUrls = GetImages(Item);
var tasks = ImageUrls.Select(GetImage);
var results = await Task.WhenAll(tasks);
Images = results.Where(i => i != null).ToList();
}
/// <summary>
/// Gets the image.
/// </summary>
/// <param name="url">The URL.</param>
/// <returns>Task{BitmapImage}.</returns>
private async Task<BitmapImage> GetImage(string url)
{
try
{
return await App.Instance.GetRemoteBitmapAsync(url);
}
catch (HttpException)
{
return null;
}
}
/// <summary>
/// Gets the images.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>List{System.String}.</returns>
internal static List<string> GetImages(BaseItemDto item)
{
var images = new List<string> { };
if (item.BackdropCount > 0)
{
for (var i = 0; i < item.BackdropCount; i++)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Backdrop,
ImageIndex = i
}));
}
}
if (item.HasThumb)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Thumb
}));
}
if (item.HasArtImage)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Art
}));
}
if (item.HasDiscImage)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Disc
}));
}
if (item.HasMenuImage)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Menu
}));
}
if (item.HasBoxImage)
{
images.Add(UIKernel.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Box
}));
}
return images;
}
}
}

View File

@ -1,22 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemMediaInfo"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource TextBlockStyle}" Grid.Row="0" x:Name="TxtPath"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" Grid.Row="1" Margin="0 20 0 0" x:Name="TxtVideoFormat"></TextBlock>
<StackPanel Orientation="Vertical" x:Name="MediaStreams" Grid.Row="2" Margin="0 20 0 0"></StackPanel>
</Grid>
</details:BaseDetailsControl>

View File

@ -1,49 +0,0 @@
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemMediaInfo.xaml
/// </summary>
public partial class ItemMediaInfo : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemMediaInfo" /> class.
/// </summary>
public ItemMediaInfo()
{
InitializeComponent();
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override void OnItemChanged()
{
MediaStreams.Children.Clear();
TxtPath.Text = Item.Path;
if (Item.VideoFormat.HasValue && Item.VideoFormat.Value != VideoFormat.Standard)
{
TxtVideoFormat.Visibility = Visibility.Visible;
TxtVideoFormat.Text = Item.VideoFormat.Value == VideoFormat.Digital3D ? "Digital 3D" : "SBS 3D";
}
else
{
TxtVideoFormat.Visibility = Visibility.Collapsed;
}
foreach (var stream in Item.MediaStreams ?? new List<MediaStream> {})
{
MediaStreams.Children.Add(new MediaStreamControl
{
MediaStream = stream
});
}
}
}
}

View File

@ -1,68 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemOverview"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Grid.Row="0" x:Name="PnlAlbum" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" Width="250" Text="album"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Album"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" x:Name="PnlArtist" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" Width="250" Text="artist"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Artist"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" x:Name="PnlAlbumArtist" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" Width="250" Text="album artist"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="AlbumArtist"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="3" x:Name="PnlDirectors" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="DirectorLabel" Width="250"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Directors"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="4" x:Name="PnlGenres" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="GenreLabel" Width="250"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Genres"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="5" x:Name="PnlStudios" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="StudiosLabel" Width="250"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Studios"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="6" x:Name="PnlPremiereDate" Visibility="Collapsed">
<TextBlock Style="{StaticResource TextBlockStyle}" Width="250" Text="premiere date"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="PremiereDate"></TextBlock>
</StackPanel>
<Grid Grid.Row="7">
<TextBlock Style="{StaticResource TextBlockStyle}" x:Name="Overview" Margin="0 20 0 0"></TextBlock>
</Grid>
</Grid>
</details:BaseDetailsControl>

View File

@ -1,109 +0,0 @@
using MediaBrowser.Model.Dto;
using System;
using System.Linq;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemOverview.xaml
/// </summary>
public partial class ItemOverview : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemOverview" /> class.
/// </summary>
public ItemOverview()
: base()
{
InitializeComponent();
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override void OnItemChanged()
{
var directors = (Item.People ?? new BaseItemPerson[] { }).Where(p => string.Equals(p.Type, "director", StringComparison.OrdinalIgnoreCase)).ToList();
if (directors.Count > 0)
{
PnlDirectors.Visibility = Visibility.Visible;
Directors.Text = string.Join(" / ", directors.Take(3).Select(d => d.Name).ToArray());
DirectorLabel.Text = directors.Count > 1 ? "directors" : "director";
}
else
{
PnlDirectors.Visibility = Visibility.Collapsed;
}
if (Item.Genres != null && Item.Genres.Count > 0)
{
PnlGenres.Visibility = Visibility.Visible;
Genres.Text = string.Join(" / ", Item.Genres.Take(4).ToArray());
GenreLabel.Text = Item.Genres.Count > 1 ? "genres" : "genre";
}
else
{
PnlGenres.Visibility = Visibility.Collapsed;
}
if (Item.Studios != null && Item.Studios.Count > 0)
{
PnlStudios.Visibility = Visibility.Visible;
Studios.Text = string.Join(" / ", Item.Studios.Take(3).ToArray());
StudiosLabel.Text = Item.Studios.Count > 1 ? "studios" : "studio";
}
else
{
PnlStudios.Visibility = Visibility.Collapsed;
}
if (Item.PremiereDate.HasValue)
{
PnlPremiereDate.Visibility = Visibility.Visible;
PremiereDate.Text = Item.PremiereDate.Value.ToShortDateString();
}
else
{
PnlPremiereDate.Visibility = Visibility.Collapsed;
}
if (!string.IsNullOrEmpty(Item.Artist))
{
PnlArtist.Visibility = Visibility.Visible;
Artist.Text = Item.Artist;
}
else
{
PnlArtist.Visibility = Visibility.Collapsed;
}
if (!string.IsNullOrEmpty(Item.Album))
{
PnlAlbum.Visibility = Visibility.Visible;
Album.Text = Item.Artist;
}
else
{
PnlAlbum.Visibility = Visibility.Collapsed;
}
if (!string.IsNullOrEmpty(Item.AlbumArtist))
{
PnlAlbumArtist.Visibility = Visibility.Visible;
AlbumArtist.Text = Item.Artist;
}
else
{
PnlAlbumArtist.Visibility = Visibility.Collapsed;
}
Overview.Text = Item.Overview;
}
}
}

View File

@ -1,23 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemPerformers"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<controls:ExtendedScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<controls:ScrollingPanel CanHorizontallyScroll="False" CanVerticallyScroll="True">
<controls:ExtendedListBox VerticalAlignment="Center" x:Name="lstItems" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding Path=People}" ItemTemplate="{StaticResource ItemPerformersTemplate}" 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>
</details:BaseDetailsControl>

View File

@ -1,72 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.ViewModels;
using System.Collections.ObjectModel;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemPerformers.xaml
/// </summary>
public partial class ItemPerformers : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemPerformers" /> class.
/// </summary>
public ItemPerformers()
{
InitializeComponent();
}
/// <summary>
/// The _itemsResult
/// </summary>
private ItemsResult _itemsResult;
/// <summary>
/// Gets or sets the children of the Folder being displayed
/// </summary>
/// <value>The children.</value>
public ItemsResult ItemsResult
{
get { return _itemsResult; }
private set
{
_itemsResult = value;
OnPropertyChanged("ItemsResult");
Items = DtoBaseItemViewModel.GetObservableItems(ItemsResult.Items);
}
}
/// <summary>
/// The _display children
/// </summary>
private ObservableCollection<DtoBaseItemViewModel> _items;
/// <summary>
/// Gets the actual children that should be displayed.
/// Subclasses should bind to this, not ItemsResult.
/// </summary>
/// <value>The display children.</value>
public ObservableCollection<DtoBaseItemViewModel> Items
{
get { return _items; }
private set
{
_items = value;
//lstItems.ItemsSource = value;
OnPropertyChanged("Items");
}
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override async void OnItemChanged()
{
ItemsResult = await UIKernel.Instance.ApiClient.GetAllPeopleAsync(App.Instance.CurrentUser.Id, itemId: Item.Id);
}
}
}

View File

@ -1,23 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemSpecialFeatures"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<controls:ExtendedScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False">
<controls:ExtendedListBox x:Name="lstItems" HorizontalAlignment="Center" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemTemplate="{StaticResource ItemSpecialFeaturesTemplate}" 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>
</details:BaseDetailsControl>

View File

@ -1,77 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Playback;
using MediaBrowser.UI.ViewModels;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemSpecialFeatures.xaml
/// </summary>
public partial class ItemSpecialFeatures : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemSpecialFeatures" /> class.
/// </summary>
public ItemSpecialFeatures()
{
InitializeComponent();
lstItems.ItemInvoked += lstItems_ItemInvoked;
}
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var viewModel = (SpecialFeatureViewModel) e.Argument;
UIKernel.Instance.PlaybackManager.Play(new PlayOptions
{
Items = new List<BaseItemDto> { viewModel.Item }
});
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override async void OnItemChanged()
{
BaseItemDto[] result;
try
{
result = await UIKernel.Instance.ApiClient.GetSpecialFeaturesAsync(App.Instance.CurrentUser.Id, Item.Id);
}
catch (HttpException)
{
App.Instance.ShowDefaultErrorMessage();
return;
}
var resultItems = result ?? new BaseItemDto[] { };
const int height = 297;
var aspectRatio = DtoBaseItemViewModel.GetAveragePrimaryImageAspectRatio(resultItems);
var width = aspectRatio == 0 ? 528 : height * aspectRatio;
lstItems.ItemsSource = resultItems.Select(i => new SpecialFeatureViewModel
{
Item = i,
ImageHeight = height,
ImageWidth = width
}).ToList();
}
}
}

View File

@ -1,23 +0,0 @@
<details:BaseDetailsControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.ItemTrailers"
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:details="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls.Details"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<controls:ExtendedScrollViewer ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Disabled" CanContentScroll="True">
<controls:ScrollingPanel CanHorizontallyScroll="True" CanVerticallyScroll="False">
<controls:ExtendedListBox x:Name="lstItems" HorizontalAlignment="Center" VerticalAlignment="Top" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemTemplate="{StaticResource ItemSpecialFeaturesTemplate}" 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>
</details:BaseDetailsControl>

View File

@ -1,82 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Playback;
using MediaBrowser.UI.ViewModels;
using System.Collections.Generic;
using System.Linq;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for ItemTrailers.xaml
/// </summary>
public partial class ItemTrailers : BaseDetailsControl
{
/// <summary>
/// Initializes a new instance of the <see cref="ItemSpecialFeatures" /> class.
/// </summary>
public ItemTrailers()
{
InitializeComponent();
lstItems.ItemInvoked += lstItems_ItemInvoked;
}
/// <summary>
/// LSTs the items_ item invoked.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The e.</param>
void lstItems_ItemInvoked(object sender, ItemEventArgs<object> e)
{
var viewModel = (SpecialFeatureViewModel)e.Argument;
UIKernel.Instance.PlaybackManager.Play(new PlayOptions
{
Items = new List<BaseItemDto> { viewModel.Item }
});
}
/// <summary>
/// Called when [item changed].
/// </summary>
protected override async void OnItemChanged()
{
BaseItemDto[] result;
try
{
result = await UIKernel.Instance.ApiClient.GetLocalTrailersAsync(App.Instance.CurrentUser.Id, Item.Id);
}
catch (HttpException)
{
App.Instance.ShowDefaultErrorMessage();
return;
}
var resultItems = result ?? new BaseItemDto[] { };
const int height = 297;
var aspectRatio = DtoBaseItemViewModel.GetAveragePrimaryImageAspectRatio(resultItems);
var width = aspectRatio == 0 ? 528 : height * aspectRatio;
if (Item.TrailerUrls != null)
{
//resultItems.AddRange(Item.TrailerUrls.Select(i => UIKernel.Instance.PlaybackManager.GetPlayableItem(new Uri(i), "Trailer")));
}
lstItems.ItemsSource = resultItems.Select(i => new SpecialFeatureViewModel
{
Item = i,
ImageHeight = height,
ImageWidth = width
}).ToList();
}
}
}

View File

@ -1,18 +0,0 @@
<controls:BaseUserControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.Details.MediaStreamControl"
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:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource TextBlockStyle}" Grid.Column="0" x:Name="StreamName"></TextBlock>
<StackPanel Orientation="Vertical" Grid.Column="1" x:Name="StreamDetails"></StackPanel>
</Grid>
</controls:BaseUserControl>

View File

@ -1,142 +0,0 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.UI.Controls;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Windows.Controls;
namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
/// <summary>
/// Interaction logic for MediaStreamControl.xaml
/// </summary>
public partial class MediaStreamControl : BaseUserControl
{
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
/// <summary>
/// Initializes a new instance of the <see cref="MediaStreamControl" /> class.
/// </summary>
public MediaStreamControl()
{
InitializeComponent();
}
/// <summary>
/// The _media stream
/// </summary>
private MediaStream _mediaStream;
/// <summary>
/// Gets or sets the media stream.
/// </summary>
/// <value>The media stream.</value>
public MediaStream MediaStream
{
get { return _mediaStream; }
set
{
_mediaStream = value;
OnPropertyChanged("MediaStream");
OnStreamChanged();
}
}
/// <summary>
/// Called when [stream changed].
/// </summary>
private void OnStreamChanged()
{
if (MediaStream == null)
{
StreamName.Text = string.Empty;
StreamDetails.Children.Clear();
return;
}
var details = new List<string> { };
if (MediaStream.Type != MediaStreamType.Video)
{
AddDetail(details, MediaStream.Language);
}
if (!string.IsNullOrEmpty(MediaStream.Path))
{
AddDetail(details, Path.GetFileName(MediaStream.Path));
}
if (MediaStream.Type == MediaStreamType.Video)
{
var resolution = string.Format("{0}*{1}", MediaStream.Width, MediaStream.Height);
AddDetail(details, resolution);
}
AddDetail(details, MediaStream.AspectRatio);
if (MediaStream.Type != MediaStreamType.Video)
{
if (MediaStream.IsDefault)
{
//AddDetail(details, "default");
}
if (MediaStream.IsForced)
{
AddDetail(details, "forced");
}
}
AddDetail(details, MediaStream.Codec);
if (MediaStream.Channels.HasValue)
{
AddDetail(details, MediaStream.Channels.Value.ToString(UsCulture) + "ch");
}
if (MediaStream.BitRate.HasValue)
{
var text = (MediaStream.BitRate.Value / 1000).ToString(UsCulture) + "kbps";
AddDetail(details, text);
}
var framerate = MediaStream.AverageFrameRate ?? MediaStream.RealFrameRate ?? 0;
if (framerate > 0)
{
AddDetail(details, framerate.ToString(UsCulture));
}
if (MediaStream.SampleRate.HasValue)
{
AddDetail(details, MediaStream.SampleRate.Value.ToString(UsCulture) + "khz");
}
AddDetail(string.Join(" \u2022 ", details.ToArray()));
StreamName.Text = MediaStream.Type.ToString();
}
private void AddDetail(string text)
{
if (string.IsNullOrEmpty(text))
{
return;
}
var control = new TextBlock() { Text = text };
control.SetResourceReference(StyleProperty, "TextBlockStyle");
StreamDetails.Children.Add(control);
}
private void AddDetail(ICollection<string> list, string text)
{
if (string.IsNullOrEmpty(text))
{
return;
}
list.Add(text);
}
}
}

View File

@ -1,22 +0,0 @@
<controls:BaseUserControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.HomePageTile"
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:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid HorizontalAlignment="Left" Width="400" Height="225">
<Border Background="{Binding Converter={StaticResource MetroTileBackgroundConverter}}">
<Image x:Name="image" Stretch="Uniform"></Image>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<TextBlock Margin="10 5 0 10" Foreground="White" Text="{Binding Path=Item.Name}" TextWrapping="Wrap"></TextBlock>
</Grid>
</Grid>
</controls:BaseUserControl>

View File

@ -1,128 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.ViewModels;
using System;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.Controls
{
/// <summary>
/// Interaction logic for BaseItemTile.xaml
/// </summary>
public partial class HomePageTile : BaseUserControl
{
/// <summary>
/// Gets the view model.
/// </summary>
/// <value>The view model.</value>
public DtoBaseItemViewModel ViewModel
{
get { return DataContext as DtoBaseItemViewModel; }
}
/// <summary>
/// Gets the item.
/// </summary>
/// <value>The item.</value>
private BaseItemDto Item
{
get { return ViewModel.Item; }
}
/// <summary>
/// Initializes a new instance of the <see cref="HomePageTile" /> class.
/// </summary>
public HomePageTile()
{
InitializeComponent();
DataContextChanged += BaseItemTile_DataContextChanged;
}
/// <summary>
/// Handles the DataContextChanged event of the BaseItemTile control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs" /> instance containing the event data.</param>
void BaseItemTile_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
OnItemChanged();
}
/// <summary>
/// Called when [item changed].
/// </summary>
private void OnItemChanged()
{
ReloadImage();
}
/// <summary>
/// Reloads the image.
/// </summary>
private void ReloadImage()
{
if (Item.HasPrimaryImage)
{
var url = App.Instance.ApiClient.GetImageUrl(Item, new ImageOptions
{
ImageType = ImageType.Primary,
Height = 225
});
SetImage(url);
}
else if (Item.BackdropCount > 0)
{
var url = App.Instance.ApiClient.GetImageUrl(Item, new ImageOptions
{
ImageType = ImageType.Backdrop,
Height = 225,
Width = 400
});
SetImage(url);
}
else if (Item.HasThumb)
{
var url = App.Instance.ApiClient.GetImageUrl(Item, new ImageOptions
{
ImageType = ImageType.Thumb,
Height = 225,
Width = 400
});
SetImage(url);
}
else
{
SetDefaultImage();
}
}
/// <summary>
/// Sets the image.
/// </summary>
/// <param name="url">The URL.</param>
private async void SetImage(string url)
{
try
{
image.Source = await App.Instance.GetRemoteBitmapAsync(url);
}
catch (HttpException)
{
SetDefaultImage();
}
}
private void SetDefaultImage()
{
var imageUri = new Uri("../Resources/Images/VideoDefault.png", UriKind.Relative);
image.Source = App.Instance.GetBitmapImage(imageUri);
}
}
}

View File

@ -1,30 +0,0 @@
<controls:BaseUserControl x:Class="MediaBrowser.Plugins.DefaultTheme.Controls.MultiItemTile"
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:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid x:Name="mainGrid" HorizontalAlignment="Left">
<Border Background="{Binding Converter={StaticResource MetroTileBackgroundConverter}}">
<controls:TransitionControl x:Name="transitionControl">
<controls:TransitionControl.TransitionAnimation>
<DoubleAnimation Duration="0:0:1" >
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</controls:TransitionControl.TransitionAnimation>
</controls:TransitionControl>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<TextBlock x:Name="txtName" Margin="10 5 0 10" Foreground="White" TextWrapping="Wrap"></TextBlock>
</Grid>
</Grid>
</controls:BaseUserControl>

View File

@ -1,219 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.ViewModels;
using Microsoft.Expression.Media.Effects;
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace MediaBrowser.Plugins.DefaultTheme.Controls
{
/// <summary>
/// Interaction logic for MultiItemTile.xaml
/// </summary>
public partial class MultiItemTile : BaseUserControl
{
/// <summary>
/// The _image width
/// </summary>
private int _imageWidth;
/// <summary>
/// Gets or sets the width of the image.
/// </summary>
/// <value>The width of the image.</value>
public int ImageWidth
{
get { return _imageWidth; }
set
{
_imageWidth = value;
mainGrid.Width = value;
}
}
/// <summary>
/// The _image height
/// </summary>
private int _imageHeight;
/// <summary>
/// Gets or sets the height of the image.
/// </summary>
/// <value>The height of the image.</value>
public int ImageHeight
{
get { return _imageHeight; }
set
{
_imageHeight = value;
mainGrid.Height = value;
}
}
/// <summary>
/// The _effects
/// </summary>
TransitionEffect[] _effects = new TransitionEffect[]
{
new BlindsTransitionEffect { Orientation = BlindOrientation.Horizontal },
new BlindsTransitionEffect { Orientation = BlindOrientation.Vertical },
new CircleRevealTransitionEffect { },
new FadeTransitionEffect { },
new SlideInTransitionEffect { SlideDirection= SlideDirection.TopToBottom},
new SlideInTransitionEffect { SlideDirection= SlideDirection.RightToLeft},
new WipeTransitionEffect { WipeDirection = WipeDirection.RightToLeft},
new WipeTransitionEffect { WipeDirection = WipeDirection.TopLeftToBottomRight}
};
/// <summary>
/// Gets or sets the random.
/// </summary>
/// <value>The random.</value>
private Random Random { get; set; }
/// <summary>
/// Gets the collection.
/// </summary>
/// <value>The collection.</value>
public ItemCollectionViewModel Collection
{
get { return DataContext as ItemCollectionViewModel; }
}
/// <summary>
/// Initializes a new instance of the <see cref="MultiItemTile" /> class.
/// </summary>
public MultiItemTile()
{
InitializeComponent();
Random = new Random(Guid.NewGuid().GetHashCode());
mainGrid.Width = ImageWidth;
mainGrid.Height = ImageHeight;
DataContextChanged += BaseItemTile_DataContextChanged;
}
/// <summary>
/// Handles the DataContextChanged event of the BaseItemTile control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs" /> instance containing the event data.</param>
void BaseItemTile_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
OnCurrentItemChanged();
if (Collection != null)
{
Collection.PropertyChanged += Collection_PropertyChanged;
}
}
/// <summary>
/// Handles the PropertyChanged event of the Collection control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PropertyChangedEventArgs" /> instance containing the event data.</param>
void Collection_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName.Equals("CurrentItem"))
{
OnCurrentItemChanged();
}
}
/// <summary>
/// Called when [current item changed].
/// </summary>
private async void OnCurrentItemChanged()
{
if (Collection == null)
{
// Setting this to null doesn't seem to clear out the content
transitionControl.Content = new FrameworkElement();
txtName.Text = null;
return;
}
var currentItem = Collection.CurrentItem;
if (currentItem == null)
{
// Setting this to null doesn't seem to clear out the content
transitionControl.Content = new FrameworkElement();
txtName.Text = Collection.Name;
return;
}
var img = new Image
{
Stretch = Stretch.Uniform,
Width = ImageWidth,
Height = ImageHeight
};
var url = GetImageSource(currentItem);
if (!string.IsNullOrEmpty(url))
{
try
{
img.Source = await App.Instance.GetRemoteBitmapAsync(url);
txtName.Text = Collection.Name ?? currentItem.Name;
}
catch (HttpException)
{
}
}
transitionControl.TransitionType = _effects[Random.Next(0, _effects.Length)];
transitionControl.Content = img;
}
/// <summary>
/// Gets the image source.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>Uri.</returns>
private string GetImageSource(BaseItemDto item)
{
if (item != null)
{
if (item.BackdropCount > 0)
{
return App.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Backdrop,
Height = ImageHeight,
Width = ImageWidth
});
}
if (item.HasThumb)
{
return App.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Thumb,
Height = ImageHeight,
Width = ImageWidth
});
}
if (item.HasPrimaryImage)
{
return App.Instance.ApiClient.GetImageUrl(item, new ImageOptions
{
ImageType = ImageType.Primary,
Height = ImageHeight
});
}
}
return null;
}
}
}

View File

@ -1,48 +0,0 @@
using MediaBrowser.Model.Weather;
using System;
using System.Globalization;
using System.Windows.Data;
namespace MediaBrowser.Plugins.DefaultTheme.Converters
{
/// <summary>
/// Generates a weather image based on the current forecast
/// </summary>
public class WeatherImageConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var weather = value as WeatherInfo;
if (weather != null && weather.CurrentWeather != null)
{
switch (weather.CurrentWeather.Condition)
{
case WeatherConditions.Thunderstorm:
return "../Resources/Images/Weather/Thunder.png";
case WeatherConditions.Overcast:
return "../Resources/Images/Weather/Overcast.png";
case WeatherConditions.Mist:
case WeatherConditions.Sleet:
case WeatherConditions.Rain:
return "../Resources/Images/Weather/Rain.png";
case WeatherConditions.Blizzard:
case WeatherConditions.Snow:
return "../Resources/Images/Weather/Snow.png";
case WeatherConditions.Cloudy:
return "../Resources/Images/Weather/Cloudy.png";
case WeatherConditions.PartlyCloudy:
return "../Resources/Images/Weather/PartlyCloudy.png";
default:
return "../Resources/Images/Weather/Sunny.png";
}
}
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -1,25 +0,0 @@
using MediaBrowser.UI.Pages;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
/// <summary>
/// Class BaseDisplayPreferencesPage
/// </summary>
public class BaseDisplayPreferencesPage : BasePage
{
/// <summary>
/// Gets or sets the display preferences window.
/// </summary>
/// <value>The display preferences window.</value>
public DisplayPreferencesMenu DisplayPreferencesWindow { get; set; }
/// <summary>
/// Gets the main page.
/// </summary>
/// <value>The main page.</value>
protected BaseListPage MainPage
{
get { return DisplayPreferencesWindow.MainPage; }
}
}
}

View File

@ -1,47 +0,0 @@
<controls:BaseModalWindow x:Class="MediaBrowser.Plugins.DefaultTheme.DisplayPreferences.DisplayPreferencesMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
Title="DisplayPreferencesMenu" Height="300" Width="300"
AllowsTransparency="True"
Background="Transparent"
Style="{StaticResource ModalWindow}">
<Grid>
<Grid Style="{StaticResource ModalOverlayStyle}">
</Grid>
<Grid Style="{StaticResource ModalContentStyle}" HorizontalAlignment="Right" VerticalAlignment="Stretch">
<Grid Margin="50 50 120 0">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
</Grid.RowDefinitions>
<controls:TransitionFrame x:Name="PageFrame" Grid.Row="0" MinWidth="400" MinHeight="550">
<controls:TransitionFrame.TransitionAnimation>
<DoubleAnimation Duration="0:0:0.35" >
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</controls:TransitionFrame.TransitionAnimation>
<controls:TransitionFrame.TransitionType>
<ee:WipeTransitionEffect WipeDirection="RightToLeft"></ee:WipeTransitionEffect>
</controls:TransitionFrame.TransitionType>
</controls:TransitionFrame>
<controls:ExtendedButton x:Name="btnClose" Style="{StaticResource ViewMenuButton}" HorizontalAlignment="Left" Margin="0 50 0 0" Grid.Row="1">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Close.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Close</TextBlock>
</StackPanel>
</controls:ExtendedButton>
</Grid>
</Grid>
<Grid.LayoutTransform>
<ScaleTransform ScaleX="{Binding Path=ContentScale}" ScaleY="{Binding Path=ContentScale}" CenterX="0" CenterY="0" />
</Grid.LayoutTransform>
</Grid>
</controls:BaseModalWindow>

View File

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

View File

@ -1,21 +0,0 @@
<DisplayPreferences:BaseDisplayPreferencesPage x:Class="MediaBrowser.Plugins.DefaultTheme.DisplayPreferences.IndexMenuPage"
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:DisplayPreferences="clr-namespace:MediaBrowser.Plugins.DefaultTheme.DisplayPreferences"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="IndexMenuPage">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Style="{StaticResource Heading2TextBlockStyle}">Index By</TextBlock>
<StackPanel x:Name="pnlOptions" Orientation="Vertical"></StackPanel>
<controls:ExtendedCheckbox x:Name="chkRememberIndex" Margin="0 20 0 0" Style="{StaticResource CheckBoxStyle}">
<TextBlock Text="Remember Indexing" Style="{StaticResource TextBlockStyle}"></TextBlock>
</controls:ExtendedCheckbox>
</StackPanel>
</Grid>
</DisplayPreferences:BaseDisplayPreferencesPage>

View File

@ -1,95 +0,0 @@
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controls;
using System;
using System.Windows;
using System.Windows.Controls;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
/// <summary>
/// Interaction logic for IndexMenuPage.xaml
/// </summary>
public partial class IndexMenuPage : BaseDisplayPreferencesPage
{
/// <summary>
/// Initializes a new instance of the <see cref="IndexMenuPage" /> class.
/// </summary>
public IndexMenuPage()
{
InitializeComponent();
chkRememberIndex.Click += chkRememberIndex_Click;
}
/// <summary>
/// Handles the Click event of the chkRememberIndex 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 chkRememberIndex_Click(object sender, RoutedEventArgs e)
{
try
{
await MainPage.UpdateRememberIndex(chkRememberIndex.IsChecked.HasValue && chkRememberIndex.IsChecked.Value);
}
catch (HttpException)
{
App.Instance.ShowDefaultErrorMessage();
}
}
/// <summary>
/// Called when [loaded].
/// </summary>
protected override void OnLoaded()
{
chkRememberIndex.IsChecked = MainPage.DisplayPreferences.RememberIndexing;
var index = 0;
var currentValue = MainPage.IndexBy ?? string.Empty;
foreach (var option in MainPage.Folder.IndexOptions)
{
var radio = new ExtendedRadioButton { GroupName = "Options" };
radio.SetResourceReference(StyleProperty, "ViewMenuRadioButton");
var textblock = new TextBlock { Text = option };
textblock.SetResourceReference(StyleProperty, "TextBlockStyle");
radio.Content = textblock;
if (string.IsNullOrEmpty(MainPage.DisplayPreferences.IndexBy))
{
radio.IsChecked = index == 0;
}
else
{
radio.IsChecked = currentValue.Equals(option, StringComparison.OrdinalIgnoreCase);
}
radio.Tag = option;
radio.Click += radio_Click;
pnlOptions.Children.Add(radio);
index++;
}
base.OnLoaded();
}
/// <summary>
/// Handles the Click event of the radio 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 radio_Click(object sender, RoutedEventArgs e)
{
await MainPage.UpdateIndexOption((sender as RadioButton).Tag.ToString());
}
}
}

View File

@ -1,54 +0,0 @@
<DisplayPreferences:BaseDisplayPreferencesPage x:Class="MediaBrowser.Plugins.DefaultTheme.DisplayPreferences.MainPage"
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:DisplayPreferences="clr-namespace:MediaBrowser.Plugins.DefaultTheme.DisplayPreferences"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="MainPage">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Style="{StaticResource Heading2TextBlockStyle}">Display Options</TextBlock>
<controls:ExtendedButton x:Name="ViewMenuButton" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\View.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">View Menu</TextBlock>
</StackPanel>
</controls:ExtendedButton>
<controls:ExtendedButton x:Name="SortMenuButton" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Sort.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Sort Menu</TextBlock>
</StackPanel>
</controls:ExtendedButton>
<controls:ExtendedButton x:Name="IndexMenuButton" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Index.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Index Menu</TextBlock>
</StackPanel>
</controls:ExtendedButton>
<controls:ExtendedButton x:Name="btnIncrease" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Increase.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Increase Image Size</TextBlock>
</StackPanel>
</controls:ExtendedButton>
<controls:ExtendedButton x:Name="btnDecrease" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Decrease.png" Stretch="None" />
<TextBlock Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Decrease Image Size</TextBlock>
</StackPanel>
</controls:ExtendedButton>
<controls:ExtendedButton x:Name="btnScroll" Style="{StaticResource ViewMenuButton}">
<StackPanel Orientation="Horizontal">
<Image Source="..\Resources\Images\ViewMenu\Scroll.png" Stretch="None" />
<TextBlock x:Name="txtScrollDirection" Style="{StaticResource TextBlockStyle}" VerticalAlignment="Center" Margin="10 0 0 0">Scroll: Vertical</TextBlock>
</StackPanel>
</controls:ExtendedButton>
</StackPanel>
</Grid>
</DisplayPreferences:BaseDisplayPreferencesPage>

View File

@ -1,118 +0,0 @@
using MediaBrowser.Model.Entities;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
/// <summary>
/// Interaction logic for MainPage.xaml
/// </summary>
public partial class MainPage : BaseDisplayPreferencesPage
{
/// <summary>
/// Initializes a new instance of the <see cref="MainPage" /> class.
/// </summary>
public MainPage()
{
InitializeComponent();
btnScroll.Click += btnScroll_Click;
btnIncrease.Click += btnIncrease_Click;
btnDecrease.Click += btnDecrease_Click;
ViewMenuButton.Click += ViewMenuButton_Click;
SortMenuButton.Click += SortMenuButton_Click;
IndexMenuButton.Click += IndexMenuButton_Click;
}
/// <summary>
/// Handles the Click event of the IndexMenuButton 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 IndexMenuButton_Click(object sender, RoutedEventArgs e)
{
DisplayPreferencesWindow.NavigateToIndexMenu();
}
/// <summary>
/// Handles the Click event of the SortMenuButton 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 SortMenuButton_Click(object sender, RoutedEventArgs e)
{
DisplayPreferencesWindow.NavigateToSortMenu();
}
/// <summary>
/// Called when [loaded].
/// </summary>
protected override void OnLoaded()
{
base.OnLoaded();
UpdateFields();
}
/// <summary>
/// Handles the Click event of the ViewMenuButton 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 ViewMenuButton_Click(object sender, RoutedEventArgs e)
{
DisplayPreferencesWindow.NavigateToViewMenu();
}
/// <summary>
/// Handles the Click event of the btnDecrease 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 btnDecrease_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.DecreaseImageSize();
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Handles the Click event of the btnIncrease 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 btnIncrease_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.IncreaseImageSize();
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Handles the Click event of the btnScroll 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 btnScroll_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.ScrollDirection = MainPage.DisplayPreferences.ScrollDirection == ScrollDirection.Horizontal
? ScrollDirection.Vertical
: ScrollDirection.Horizontal;
MainPage.NotifyDisplayPreferencesChanged();
UpdateFields();
}
/// <summary>
/// Updates the fields.
/// </summary>
private void UpdateFields()
{
var displayPreferences = MainPage.DisplayPreferences;
btnScroll.Visibility = displayPreferences.ViewType == ViewTypes.Poster
? Visibility.Visible
: Visibility.Collapsed;
txtScrollDirection.Text = displayPreferences.ScrollDirection == ScrollDirection.Horizontal ? "Scroll: Horizontal" : "Scroll: Vertical";
}
}
}

View File

@ -1,21 +0,0 @@
<DisplayPreferences:BaseDisplayPreferencesPage x:Class="MediaBrowser.Plugins.DefaultTheme.DisplayPreferences.SortMenuPage"
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:DisplayPreferences="clr-namespace:MediaBrowser.Plugins.DefaultTheme.DisplayPreferences"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="SortMenuPage">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Style="{StaticResource Heading2TextBlockStyle}">Sort By</TextBlock>
<StackPanel x:Name="pnlOptions" Orientation="Vertical"></StackPanel>
<controls:ExtendedCheckbox x:Name="chkRemember" Margin="0 20 0 0" Style="{StaticResource CheckBoxStyle}">
<TextBlock Text="Remember Sorting" Style="{StaticResource TextBlockStyle}"></TextBlock>
</controls:ExtendedCheckbox>
</StackPanel>
</Grid>
</DisplayPreferences:BaseDisplayPreferencesPage>

View File

@ -1,95 +0,0 @@
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controls;
using System;
using System.Windows;
using System.Windows.Controls;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
/// <summary>
/// Interaction logic for SortMenuPage.xaml
/// </summary>
public partial class SortMenuPage : BaseDisplayPreferencesPage
{
/// <summary>
/// Initializes a new instance of the <see cref="SortMenuPage" /> class.
/// </summary>
public SortMenuPage()
{
InitializeComponent();
chkRemember.Click += chkRemember_Click;
}
/// <summary>
/// Handles the Click event of the chkRemember 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 chkRemember_Click(object sender, RoutedEventArgs e)
{
try
{
await MainPage.UpdateRememberSort(chkRemember.IsChecked.HasValue && chkRemember.IsChecked.Value);
}
catch (HttpException)
{
App.Instance.ShowDefaultErrorMessage();
}
}
/// <summary>
/// Called when [loaded].
/// </summary>
protected override void OnLoaded()
{
chkRemember.IsChecked = MainPage.DisplayPreferences.RememberSorting;
var index = 0;
var currentValue = MainPage.SortBy ?? string.Empty;
foreach (var option in MainPage.Folder.SortOptions)
{
var radio = new ExtendedRadioButton { GroupName = "Options" };
radio.SetResourceReference(StyleProperty, "ViewMenuRadioButton");
var textblock = new TextBlock { Text = option };
textblock.SetResourceReference(StyleProperty, "TextBlockStyle");
radio.Content = textblock;
if (string.IsNullOrEmpty(MainPage.DisplayPreferences.SortBy))
{
radio.IsChecked = index == 0;
}
else
{
radio.IsChecked = currentValue.Equals(option, StringComparison.OrdinalIgnoreCase);
}
radio.Tag = option;
radio.Click += radio_Click;
pnlOptions.Children.Add(radio);
index++;
}
base.OnLoaded();
}
/// <summary>
/// Handles the Click event of the radio 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 radio_Click(object sender, RoutedEventArgs e)
{
await MainPage.UpdateSortOption((sender as RadioButton).Tag.ToString());
}
}
}

View File

@ -1,30 +0,0 @@
<DisplayPreferences:BaseDisplayPreferencesPage x:Class="MediaBrowser.Plugins.DefaultTheme.DisplayPreferences.ViewMenuPage"
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:DisplayPreferences="clr-namespace:MediaBrowser.Plugins.DefaultTheme.DisplayPreferences"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
Title="ViewMenuPage">
<Grid>
<StackPanel Orientation="Vertical">
<TextBlock Style="{StaticResource Heading2TextBlockStyle}">Select View</TextBlock>
<controls:ExtendedRadioButton x:Name="radioCoverFlow" GroupName="View" Style="{StaticResource ViewMenuRadioButton}">
<TextBlock Style="{StaticResource TextBlockStyle}">Cover Flow</TextBlock>
</controls:ExtendedRadioButton>
<controls:ExtendedRadioButton x:Name="radioList" GroupName="View" Style="{StaticResource ViewMenuRadioButton}">
<TextBlock Style="{StaticResource TextBlockStyle}">List</TextBlock>
</controls:ExtendedRadioButton>
<controls:ExtendedRadioButton x:Name="radioPoster" GroupName="View" Style="{StaticResource ViewMenuRadioButton}">
<TextBlock Style="{StaticResource TextBlockStyle}">Poster</TextBlock>
</controls:ExtendedRadioButton>
<controls:ExtendedRadioButton x:Name="radioThumbstrip" GroupName="View" Style="{StaticResource ViewMenuRadioButton}">
<TextBlock Style="{StaticResource TextBlockStyle}">Thumbstrip</TextBlock>
</controls:ExtendedRadioButton>
</StackPanel>
</Grid>
</DisplayPreferences:BaseDisplayPreferencesPage>

View File

@ -1,94 +0,0 @@
using MediaBrowser.Model.Entities;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.DisplayPreferences
{
/// <summary>
/// Interaction logic for ViewMenuPage.xaml
/// </summary>
public partial class ViewMenuPage : BaseDisplayPreferencesPage
{
/// <summary>
/// Initializes a new instance of the <see cref="ViewMenuPage" /> class.
/// </summary>
public ViewMenuPage()
{
InitializeComponent();
radioCoverFlow.Click += radioCoverFlow_Click;
radioList.Click += radioList_Click;
radioPoster.Click += radioPoster_Click;
radioThumbstrip.Click += radioThumbstrip_Click;
}
/// <summary>
/// Called when [loaded].
/// </summary>
protected override void OnLoaded()
{
base.OnLoaded();
UpdateFields();
}
/// <summary>
/// Handles the Click event of the radioThumbstrip 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 radioThumbstrip_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.ScrollDirection = ScrollDirection.Horizontal;
MainPage.DisplayPreferences.ViewType = ViewTypes.ThumbStrip;
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Handles the Click event of the radioPoster 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 radioPoster_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.ViewType = ViewTypes.Poster;
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Handles the Click event of the radioList 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 radioList_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.ScrollDirection = ScrollDirection.Vertical;
MainPage.DisplayPreferences.ViewType = ViewTypes.List;
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Handles the Click event of the radioCoverFlow 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 radioCoverFlow_Click(object sender, RoutedEventArgs e)
{
MainPage.DisplayPreferences.ScrollDirection = ScrollDirection.Horizontal;
MainPage.DisplayPreferences.ViewType = ViewTypes.CoverFlow;
MainPage.NotifyDisplayPreferencesChanged();
}
/// <summary>
/// Updates the fields.
/// </summary>
private void UpdateFields()
{
var displayPreferences = MainPage.DisplayPreferences;
radioCoverFlow.IsChecked = displayPreferences.ViewType == ViewTypes.CoverFlow;
radioList.IsChecked = displayPreferences.ViewType == ViewTypes.List;
radioPoster.IsChecked = displayPreferences.ViewType == ViewTypes.Poster;
radioThumbstrip.IsChecked = displayPreferences.ViewType == ViewTypes.ThumbStrip;
}
}
}

View File

@ -1,354 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6E892999-711D-4E24-8BAC-DACF5BFA783A}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.Plugins.DefaultTheme</RootNamespace>
<AssemblyName>MediaBrowser.Plugins.DefaultTheme</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<ExpressionBlendVersion>5.2.30810.0</ExpressionBlendVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Expression.Effects, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\Expression\Microsoft.Expression.Effects.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Expression.Interactions, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\Expression\Microsoft.Expression.Interactions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="Controls\BaseItemTile.xaml.cs">
<DependentUpon>BaseItemTile.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\BaseDetailsControl.cs" />
<Compile Include="Controls\Details\ItemChapters.xaml.cs">
<DependentUpon>ItemChapters.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemGallery.xaml.cs">
<DependentUpon>ItemGallery.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemMediaInfo.xaml.cs">
<DependentUpon>ItemMediaInfo.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemOverview.xaml.cs">
<DependentUpon>ItemOverview.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemPerformers.xaml.cs">
<DependentUpon>ItemPerformers.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemSpecialFeatures.xaml.cs">
<DependentUpon>ItemSpecialFeatures.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\ItemTrailers.xaml.cs">
<DependentUpon>ItemTrailers.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\Details\MediaStreamControl.xaml.cs">
<DependentUpon>MediaStreamControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\HomePageTile.xaml.cs">
<DependentUpon>HomePageTile.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\MultiItemTile.xaml.cs">
<DependentUpon>MultiItemTile.xaml</DependentUpon>
</Compile>
<Compile Include="DisplayPreferences\BaseDisplayPreferencesPage.cs" />
<Compile Include="DisplayPreferences\DisplayPreferencesMenu.xaml.cs">
<DependentUpon>DisplayPreferencesMenu.xaml</DependentUpon>
</Compile>
<Compile Include="DisplayPreferences\IndexMenuPage.xaml.cs">
<DependentUpon>IndexMenuPage.xaml</DependentUpon>
</Compile>
<Compile Include="DisplayPreferences\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="DisplayPreferences\SortMenuPage.xaml.cs">
<DependentUpon>SortMenuPage.xaml</DependentUpon>
</Compile>
<Compile Include="DisplayPreferences\ViewMenuPage.xaml.cs">
<DependentUpon>ViewMenuPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\DetailPage.xaml.cs">
<DependentUpon>DetailPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\HomePage.xaml.cs">
<DependentUpon>HomePage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\InternalPlayerPage.xaml.cs">
<DependentUpon>InternalPlayerPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\ListPage.xaml.cs">
<DependentUpon>ListPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\LoginPage.xaml.cs">
<DependentUpon>LoginPage.xaml</DependentUpon>
</Compile>
<Compile Include="Pages\WeatherPage.xaml.cs">
<DependentUpon>WeatherPage.xaml</DependentUpon>
</Compile>
<Compile Include="Resources\AppResources.cs" />
<Compile Include="Converters\WeatherImageConverter.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Theme.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.ApiInteraction\MediaBrowser.ApiInteraction.csproj">
<Project>{921c0f64-fda7-4e9f-9e73-0cb0eedb2422}</Project>
<Name>MediaBrowser.ApiInteraction</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
<Name>MediaBrowser.Common</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
<Name>MediaBrowser.Model</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.UI.Controls\MediaBrowser.UI.Controls.csproj">
<Project>{1adfe460-fd95-46fa-8871-cccb4b62e2e8}</Project>
<Name>MediaBrowser.UI.Controls</Name>
</ProjectReference>
<ProjectReference Include="..\MediaBrowser.UI\MediaBrowser.UI.csproj">
<Project>{b5ece1fb-618e-420b-9a99-8e972d76920a}</Project>
<Name>MediaBrowser.UI</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Controls\BaseItemTile.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemChapters.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemGallery.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemMediaInfo.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemOverview.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemPerformers.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemSpecialFeatures.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\ItemTrailers.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\Details\MediaStreamControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\HomePageTile.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\MultiItemTile.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DisplayPreferences\DisplayPreferencesMenu.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DisplayPreferences\IndexMenuPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DisplayPreferences\MainPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DisplayPreferences\SortMenuPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="DisplayPreferences\ViewMenuPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\DetailPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\HomePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\InternalPlayerPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\ListPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\LoginPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Pages\WeatherPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Properties\DesignTimeResources.xaml" Condition="'$(DesignTime)'=='true' OR ('$(SolutionPath)'!='' AND Exists('$(SolutionPath)') AND '$(BuildingInsideVisualStudio)'!='true' AND '$(BuildingInsideExpressionBlend)'!='true')">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<ContainsDesignTimeResources>true</ContainsDesignTimeResources>
</Page>
<Page Include="Resources\AppResources.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\CurrentUserDefault.png" />
<Resource Include="Resources\Images\UserLoginDefault.png" />
<Resource Include="Resources\Images\Weather\Overcast.png" />
<Resource Include="Resources\Images\Weather\Rain.png" />
<Resource Include="Resources\Images\Weather\Snow.png" />
<Resource Include="Resources\Images\Weather\Sunny.png" />
<Resource Include="Resources\Images\Weather\Thunder.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\SettingsButton.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\SearchButton.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\VideoDefault.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\starEmpty.png" />
<Resource Include="Resources\Images\starFull.png" />
<Resource Include="Resources\Images\starHalf.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\Watched.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\DislikeOverlay.png" />
<Resource Include="Resources\Images\FavoriteOverlay.png" />
<Resource Include="Resources\Images\LikeOverlay.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\Weather\Cloudy.png" />
<Resource Include="Resources\Images\Weather\PartlyCloudy.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\ViewButton.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\ViewMenu\View.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\ViewMenu\Decrease.png" />
<Resource Include="Resources\Images\ViewMenu\Increase.png" />
<Resource Include="Resources\Images\ViewMenu\Index.png" />
<Resource Include="Resources\Images\ViewMenu\Scroll.png" />
<Resource Include="Resources\Images\ViewMenu\Sort.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\ViewMenu\Close.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\ChapterDefault.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\NowPlayingButton.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\AudioDefault.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\MediaBrowser.UI\CorePlugins\" /y</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,90 +0,0 @@
using MediaBrowser.Model.DTO;
using MediaBrowser.UI.Controls;
using System;
using System.Threading;
using System.Windows;
namespace MediaBrowser.Plugins.DefaultTheme.Model
{
public class VirtualCollection : ModelItem, IDisposable
{
private string _name;
public string Name
{
get { return _name; }
set
{
_name = value;
OnPropertyChanged("Name");
}
}
private DtoBaseItem[] _items;
public DtoBaseItem[] Items
{
get { return _items; }
set
{
_items = value;
OnPropertyChanged("Items");
CurrentItemIndex = Items.Length == 0 ? -1 : 0;
ReloadTimer();
}
}
private int _currentItemIndex;
public int CurrentItemIndex
{
get { return _currentItemIndex; }
set
{
_currentItemIndex = value;
OnPropertyChanged("CurrentItemIndex");
OnPropertyChanged("CurrentItem");
}
}
public DtoBaseItem CurrentItem
{
get { return CurrentItemIndex == -1 ? null : Items[CurrentItemIndex]; }
}
private Timer CurrentItemTimer { get; set; }
private void DisposeTimer()
{
if (CurrentItemTimer != null)
{
CurrentItemTimer.Dispose();
}
}
private void ReloadTimer()
{
DisposeTimer();
if (Items.Length > 0)
{
CurrentItemTimer = new Timer(state => Application.Current.Dispatcher.InvokeAsync(() => IncrementCurrentItemIndex()), null, 5000, 5000);
}
}
private void IncrementCurrentItemIndex()
{
var newIndex = CurrentItemIndex + 1;
if (newIndex >= Items.Length)
{
newIndex = 0;
}
CurrentItemIndex = newIndex;
}
public void Dispose()
{
DisposeTimer();
}
}
}

View File

@ -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>

View File

@ -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;
}
}
}

View File

@ -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>

View File

@ -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" };
}
}
}

View File

@ -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>

View File

@ -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;
}
}
}

View File

@ -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>

View File

@ -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;
}*/
}
}

View File

@ -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>

View File

@ -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();
}
}
}

View File

@ -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>

View File

@ -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();
}
}
}

View File

@ -1,53 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MediaBrowser.Plugins.DefaultTheme")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MediaBrowser.Plugins.DefaultTheme")]
[assembly: AssemblyCopyright("Copyright © 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
[assembly: Guid("411f938b-89d5-48f6-b6ab-a5d75036efcc")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]

View File

@ -1,5 +0,0 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Resource dictionary entries should be defined here. -->
</ResourceDictionary>

View File

@ -1,62 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MediaBrowser.Plugins.DefaultTheme.Properties {
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MediaBrowser.Plugins.DefaultTheme.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MediaBrowser.Plugins.DefaultTheme.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -1,223 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Net;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.Controls;
using MediaBrowser.UI.Playback;
using MediaBrowser.UI.Playback.InternalPlayer;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace MediaBrowser.Plugins.DefaultTheme.Resources
{
/// <summary>
/// Class AppResources
/// </summary>
public partial class AppResources : ResourceDictionary
{
/// <summary>
/// Gets the instance.
/// </summary>
/// <value>The instance.</value>
public static AppResources Instance { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="AppResources" /> class.
/// </summary>
public AppResources()
{
InitializeComponent();
Instance = this;
UIKernel.Instance.PlaybackManager.PlaybackStarted += PlaybackManager_PlaybackStarted;
UIKernel.Instance.PlaybackManager.PlaybackCompleted += PlaybackManager_PlaybackCompleted;
}
/// <summary>
/// Handles the Click event of the NowPlayingButton 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 NowPlaying_Click(object sender, RoutedEventArgs e)
{
App.Instance.NavigateToInternalPlayerPage();
}
/// <summary>
/// Handles the PlaybackCompleted event of the PlaybackManager control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PlaybackStopEventArgs" /> instance containing the event data.</param>
/// <exception cref="System.NotImplementedException"></exception>
void PlaybackManager_PlaybackCompleted(object sender, PlaybackStopEventArgs e)
{
App.Instance.ApplicationWindow.Dispatcher.Invoke(() => NowPlayingButton.Visibility = Visibility.Collapsed);
}
/// <summary>
/// Handles the PlaybackStarted event of the PlaybackManager control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="PlaybackEventArgs" /> instance containing the event data.</param>
void PlaybackManager_PlaybackStarted(object sender, PlaybackEventArgs e)
{
if (e.Player is BaseInternalMediaPlayer)
{
App.Instance.ApplicationWindow.Dispatcher.Invoke(() => NowPlayingButton.Visibility = Visibility.Visible);
}
}
/// <summary>
/// Weathers the button click.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
void WeatherButtonClick(object sender, RoutedEventArgs e)
{
App.Instance.DisplayWeather();
}
/// <summary>
/// Settingses the button click.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
void SettingsButtonClick(object sender, RoutedEventArgs e)
{
App.Instance.NavigateToSettingsPage();
}
/// <summary>
/// This is a common element that appears on every page.
/// </summary>
/// <value>The view button.</value>
public Button ViewButton
{
get
{
return TreeHelper.FindChild<Button>(App.Instance.ApplicationWindow, "ViewButton");
}
}
/// <summary>
/// Gets the now playing button.
/// </summary>
/// <value>The now playing button.</value>
private Button NowPlayingButton
{
get
{
return TreeHelper.FindChild<Button>(App.Instance.ApplicationWindow, "NowPlayingButton");
}
}
/// <summary>
/// This is a common element that appears on every page.
/// </summary>
/// <value>The page title panel.</value>
public StackPanel PageTitlePanel
{
get
{
return TreeHelper.FindChild<StackPanel>(App.Instance.ApplicationWindow, "PageTitlePanel");
}
}
/// <summary>
/// Gets the content of the header.
/// </summary>
/// <value>The content of the header.</value>
public StackPanel HeaderContent
{
get
{
return TreeHelper.FindChild<StackPanel>(App.Instance.ApplicationWindow, "HeaderContent");
}
}
/// <summary>
/// Sets the default page title.
/// </summary>
public void SetDefaultPageTitle()
{
var img = new Image { };
img.SetResourceReference(Image.StyleProperty, "MBLogoImageWhite");
SetPageTitle(img);
}
/// <summary>
/// Clears the page title.
/// </summary>
public void ClearPageTitle()
{
PageTitlePanel.Children.Clear();
}
/// <summary>
/// Sets the page title.
/// </summary>
/// <param name="item">The item.</param>
public async Task SetPageTitle(BaseItemDto item)
{
if (item.HasLogo || !string.IsNullOrEmpty(item.ParentLogoItemId))
{
var url = App.Instance.ApiClient.GetLogoImageUrl(item, new ImageOptions
{
Quality = 100
});
try
{
var image = await App.Instance.GetRemoteImageAsync(url);
image.SetResourceReference(Image.StyleProperty, "ItemLogo");
SetPageTitle(image);
}
catch (HttpException)
{
SetPageTitleText(item);
}
}
else
{
SetPageTitleText(item);
}
}
/// <summary>
/// Sets the page title text.
/// </summary>
/// <param name="item">The item.</param>
private void SetPageTitleText(BaseItemDto item)
{
SetPageTitle(item.SeriesName ?? item.Album ?? item.Name);
}
/// <summary>
/// Sets the page title.
/// </summary>
/// <param name="title">The title.</param>
public void SetPageTitle(string title)
{
var textblock = new TextBlock { Text = title, Margin = new Thickness(0, 10, 0, 0) };
textblock.SetResourceReference(TextBlock.StyleProperty, "Heading2TextBlockStyle");
SetPageTitle(textblock);
}
/// <summary>
/// Sets the page title.
/// </summary>
/// <param name="element">The element.</param>
public void SetPageTitle(UIElement element)
{
var panel = PageTitlePanel;
panel.Children.Clear();
panel.Children.Add(element);
}
}
}

View File

@ -1,617 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:themeconverters="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Converters"
xmlns:themecontrols="clr-namespace:MediaBrowser.Plugins.DefaultTheme.Controls"
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
xmlns:ViewModels="clr-namespace:MediaBrowser.UI.ViewModels;assembly=MediaBrowser.UI"
xmlns:controls="clr-namespace:MediaBrowser.UI.Controls;assembly=MediaBrowser.UI.Controls"
xmlns:dto="clr-namespace:MediaBrowser.Model.Dto;assembly=MediaBrowser.Model"
x:Class="MediaBrowser.Plugins.DefaultTheme.Resources.AppResources">
<themeconverters:WeatherImageConverter x:Key="WeatherImageConverter"></themeconverters:WeatherImageConverter>
<Style TargetType="Grid" x:Key="WindowBackgroundContent">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush SpreadMethod="Reflect" ColorInterpolationMode="SRgbLinearInterpolation" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Color="#ff000000" Offset="0" />
<GradientStop Color="#ffbbbbbb" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Grid" x:Key="WindowBackgroundContentDuringPlayback">
<Setter Property="Opacity" Value=".75"/>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush SpreadMethod="Reflect" ColorInterpolationMode="SRgbLinearInterpolation" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Color="#ff000000" Offset="0" />
<GradientStop Color="#ffbbbbbb" Offset="1" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Style>
<!--Default font for text. Themes should override these as needed-->
<Brush x:Key="DefaultForeground">#ffffff</Brush>
<!--Default font for small text. Themes should override these as needed-->
<Brush x:Key="SmallForeground">#ffffff</Brush>
<!--Default font for h1 headers. Themes should override these as needed-->
<Brush x:Key="Heading1Foreground">#ffffff</Brush>
<!--Default font for h2 headers. Themes should override these as needed-->
<Brush x:Key="Heading2Foreground">#ffffff</Brush>
<DataTemplate DataType="{x:Type dto:UserDto}">
<Grid HorizontalAlignment="Left">
<Border Background="{Binding Converter={StaticResource MetroTileBackgroundConverter},Mode=OneWay}">
<Image Stretch="Uniform" Width="330" Height="330">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger Binding="{Binding HasPrimaryImage}" Value="true">
<Setter Property="Image.Source" Value="{Binding Converter={StaticResource UserImageConverter}, ConverterParameter='0,0,0,0',Mode=OneWay}" />
</DataTrigger>
<DataTrigger Binding="{Binding HasPrimaryImage}" Value="false">
<Setter Property="Image.Source" Value="../Resources/Images/UserLoginDefault.png" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<StackPanel Orientation="Vertical" Margin="10 5 0 10">
<TextBlock Foreground="White" Text="{Binding Name,Mode=OneWay}" Style="{StaticResource TextBlockStyle}"></TextBlock>
<TextBlock Foreground="White" Text="{Binding Converter={StaticResource LastSeenTextConverter},Mode=OneWay}" Style="{StaticResource SmallTextBlockStyle}"></TextBlock>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
<DataTemplate x:Key="HomePageListBoxItemTemplate" DataType="{x:Type ViewModels:DtoBaseItemViewModel}">
<themecontrols:HomePageTile DataContext="{Binding Mode=OneWay}"></themecontrols:HomePageTile>
</DataTemplate>
<Style x:Key="SpotlightButtonStyle" TargetType="{x:Type Button}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Bd" SnapsToDevicePixels="true" RenderTransformOrigin="0.5,0.5" Padding="3">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.25"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
</VisualState>
<VisualState x:Name="Disabled"/>
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Bd">
<EasingDoubleKeyFrame KeyTime="0" Value="1.035">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="Bd">
<EasingDoubleKeyFrame KeyTime="0" Value="1.035">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Bd">
<EasingDoubleKeyFrame KeyTime="0" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="Bd">
<EasingDoubleKeyFrame KeyTime="0" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Effect).(DropShadowEffect.Opacity)" Storyboard.TargetName="BdDropShadow">
<EasingDoubleKeyFrame KeyTime="0" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="ContentGrid">
<Border x:Name="BdDropShadow" Margin="-15" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{DynamicResource SelectedItemHighlightColor}" SnapsToDevicePixels="true" CornerRadius="10" Visibility="Hidden">
<Border.Effect>
<BlurEffect Radius="10" KernelType="Gaussian"></BlurEffect>
</Border.Effect>
</Border>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="Visibility" TargetName="BdDropShadow" Value="Visible"/>
<Setter Property="Panel.ZIndex" Value="5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Item logos. -->
<Style TargetType="Image" x:Key="ItemLogo">
<Setter Property="Margin" Value="0 10 0 0"/>
<Setter Property="MaxHeight" Value="100"/>
<Setter Property="MaxWidth" Value="700"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Stretch" Value="Uniform"/>
</Style>
<!--Override PageContentTemplate-->
<ControlTemplate x:Key="PageContentTemplate">
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="0 10 0 0">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<StackPanel x:Name="PageTitlePanel" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="30 0 0 0">
</StackPanel>
<StackPanel x:Name="HeaderContent" Orientation="Horizontal" Panel.ZIndex="3" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 10 30 0">
<Button x:Name="NowPlayingButton" Style="{StaticResource ImageButton}" Margin="0 0 40 0" Visibility="Collapsed" Click="NowPlaying_Click">
<Image Source="..\Resources\Images\NowPlayingButton.png" />
</Button>
<Button x:Name="ViewButton" Style="{StaticResource ImageButton}" Margin="0 0 40 0" Visibility="Collapsed">
<Image Source="..\Resources\Images\ViewButton.png" />
</Button>
<Button Style="{StaticResource ImageButton}" Margin="0 0 40 0">
<Image Source="..\Resources\Images\SearchButton.png" />
</Button>
<Button Style="{StaticResource ImageButton}" Margin="0 0 50 0" Click="SettingsButtonClick">
<Image Source="..\Resources\Images\SettingsButton.png" />
</Button>
<!--Display CurrentUser-->
<StackPanel Orientation="Horizontal" Margin="0 0 50 0" Visibility="{Binding Path=CurrentUser,Converter={StaticResource CurrentUserVisibilityConverter},Mode=OneWay}">
<Button Style="{StaticResource ImageButton}">
<Image Height="64">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=CurrentUser.HasPrimaryImage,Mode=OneWay}" Value="true">
<Setter Property="Image.Source" Value="{Binding Path=CurrentUser,Converter={StaticResource UserImageConverter}, ConverterParameter='0,0,0,0',Mode=OneWay}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=CurrentUser.HasPrimaryImage}" Value="false">
<Setter Property="Image.Source" Value="Images\CurrentUserDefault.png" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Button>
</StackPanel>
<!--Display Weather-->
<StackPanel Orientation="Horizontal" Margin="0 0 50 0" Visibility="{Binding Path=CurrentWeather,Converter={StaticResource WeatherVisibilityConverter},Mode=OneWay}">
<TextBlock Style="{StaticResource Heading2TextBlockStyle}" Text="{Binding Path=CurrentWeather,Converter={StaticResource WeatherTemperatureConverter},Mode=OneWay}">
</TextBlock>
<Button Style="{StaticResource ImageButton}" Click="WeatherButtonClick">
<Image Source="{Binding Path=CurrentWeather,Converter={StaticResource WeatherImageConverter},Mode=OneWay}"></Image>
</Button>
</StackPanel>
<!--Display Clock-->
<TextBlock Style="{StaticResource Heading2TextBlockStyle}">
<TextBlock.Text>
<Binding Path="CurrentTime" Converter="{StaticResource DateTimeToStringConverter}" ConverterParameter="h:mm" />
</TextBlock.Text>
</TextBlock>
<TextBlock Style="{StaticResource Heading2TextBlockStyle}" Foreground="#52B54B">
<TextBlock.Text>
<Binding Path="CurrentTime" Converter="{StaticResource DateTimeToStringConverter}" ConverterParameter="timesuffixlower" />
</TextBlock.Text>
</TextBlock>
</StackPanel>
<!--Add the frame to hold the pages. The UI core expects this to appear somewhere within the template.-->
<controls:TransitionFrame x:Name="PageFrame" Grid.Row="1">
<controls:TransitionFrame.TransitionAnimation>
<DoubleAnimation Duration="0:0:0.35" >
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"></ExponentialEase>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</controls:TransitionFrame.TransitionAnimation>
<controls:TransitionFrame.TransitionType>
<ee:SlideInTransitionEffect SlideDirection="RightToLeft"></ee:SlideInTransitionEffect>
</controls:TransitionFrame.TransitionType>
</controls:TransitionFrame>
</Grid>
</ControlTemplate>
<DataTemplate x:Key="ItemSpecialFeaturesTemplate" DataType="{x:Type ViewModels:SpecialFeatureViewModel}">
<Grid HorizontalAlignment="Left">
<Border Width="{Binding Path=ImageWidth}" Height="{Binding Path=ImageHeight}">
<Border.Background>
<LinearGradientBrush SpreadMethod="Reflect" ColorInterpolationMode="SRgbLinearInterpolation" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Color="#ff545358" Offset="0" />
<GradientStop Color="#ffCBCBCB" Offset="1" />
</LinearGradientBrush>
</Border.Background>
<Image>
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Stretch" Value="Uniform" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Item.HasPrimaryImage}" Value="True">
<Setter Property="Source" Value="{Binding Path=Image}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Item.HasPrimaryImage}" Value="False">
<Setter Property="Source" Value="../Resources/Images/ChapterDefault.png" />
<Setter Property="VerticalAlignment" Value="Top" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<StackPanel Orientation="Vertical" Margin="10 5 0 10">
<TextBlock Foreground="White" Text="{Binding Path=Item.Name}" Style="{StaticResource TextBlockStyle}"></TextBlock>
<TextBlock Foreground="White" Text="{Binding Path=MinutesString}" Style="{StaticResource SmallTextBlockStyle}"></TextBlock>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
<DataTemplate x:Key="ItemPerformersTemplate" DataType="{x:Type ViewModels:DtoBaseItemViewModel}">
<Grid HorizontalAlignment="Left">
<TextBlock Text="{Binding Path=Item.Name}"></TextBlock>
</Grid>
</DataTemplate>
<DataTemplate x:Key="ItemChaptersTemplate" DataType="{x:Type ViewModels:ChapterInfoDtoViewModel}">
<Grid HorizontalAlignment="Left">
<Border Width="{Binding Path=ImageWidth}" Height="{Binding Path=ImageHeight}">
<Border.Background>
<LinearGradientBrush SpreadMethod="Reflect" ColorInterpolationMode="SRgbLinearInterpolation" StartPoint="0,0" EndPoint="0,1" >
<GradientStop Color="#ff545358" Offset="0" />
<GradientStop Color="#ffCBCBCB" Offset="1" />
</LinearGradientBrush>
</Border.Background>
<Image>
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="Stretch" Value="Uniform" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Chapter.HasImage}" Value="True">
<Setter Property="Source" Value="{Binding Path=Image}" />
</DataTrigger>
<DataTrigger Binding="{Binding Path=Chapter.HasImage}" Value="False">
<Setter Property="Source" Value="../Resources/Images/ChapterDefault.png" />
<Setter Property="VerticalAlignment" Value="Top" />
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</Border>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid.Background>
<SolidColorBrush Color="#A6000000"></SolidColorBrush>
</Grid.Background>
<StackPanel Orientation="Vertical" Margin="10 5 0 10">
<TextBlock Foreground="White" Text="{Binding Path=Chapter.Name}" Style="{StaticResource TextBlockStyle}"></TextBlock>
<TextBlock Foreground="White" Text="{Binding Path=TimeString}" Style="{StaticResource SmallTextBlockStyle}"></TextBlock>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
<DataTemplate x:Key="ItemGalleryTemplate" DataType="{x:Type BitmapImage}">
<Image Source="{Binding}" Height="297" VerticalAlignment="Center" HorizontalAlignment="Center">
</Image>
</DataTemplate>
<DataTemplate x:Key="ListPageItemTemplate" DataType="{x:Type ViewModels:DtoBaseItemViewModel}">
<themecontrols:BaseItemTile DataContext="{Binding}"></themecontrols:BaseItemTile>
</DataTemplate>
<!--List Page ListBox. -->
<Style TargetType="controls:ExtendedListBox" x:Key="ListPageListBoxStyle" BasedOn="{StaticResource ListBoxStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=DisplayPreferences.ViewType,Mode=OneWay}" Value="Poster">
<Setter Property="ItemTemplate" Value="{StaticResource ListPageItemTemplate}"></Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<controls:VirtualizingWrapPanel ItemHeight="{Binding Path=DisplayPreferences.PrimaryImageHeight,Mode=OneWay}" ItemWidth="{Binding Path=DisplayPreferences.PrimaryImageWidth,Mode=OneWay}" Orientation="{Binding WrapPanelOrientation}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20 50 20 50">
</controls:VirtualizingWrapPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=DisplayPreferences.ViewType,Mode=OneWay}" Value="CoverFlow">
<Setter Property="ItemTemplate" Value="{StaticResource ListPageItemTemplate}"></Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="50"></VirtualizingStackPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=DisplayPreferences.ViewType,Mode=OneWay}" Value="ThumbStrip">
<Setter Property="ItemTemplate" Value="{StaticResource ListPageItemTemplate}"></Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="50"></VirtualizingStackPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=DisplayPreferences.ViewType}" Value="List">
<Setter Property="ItemTemplate" Value="{StaticResource ListPageItemTemplate}"></Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="50"></VirtualizingStackPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<Style TargetType="Button" x:Key="TextButton" BasedOn="{StaticResource ImageButton}">
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderThickness="0 0 0 2" BorderBrush="Transparent">
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="Gray" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Border" Property="Opacity" Value=".2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="ViewMenuButton" BasedOn="{StaticResource ImageButton}">
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="Margin" Value="0 15 0 0"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderThickness="2" BorderBrush="Transparent" Padding="0 5 20 5">
<ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="White" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="BorderBrush" Value="Gray" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Border" Property="Opacity" Value=".2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="PressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#888" Offset="0.1"/>
<GradientStop Color="#EEE" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<!-- Miscellaneous Brushes -->
<SolidColorBrush x:Key="GlyphBrush" Color="#ffffff" />
<SolidColorBrush x:Key="FocusBackgroundBrush" Color="#ffffff" />
<SolidColorBrush x:Key="FocusGlyphBrush" Color="#022255" />
<SolidColorBrush x:Key="NormalBackgroundBrush" Color="Transparent" />
<SolidColorBrush x:Key="NormalBorderBrush" Color="#ffffff" />
<Style TargetType="RadioButton" x:Key="RadioButtonStyle">
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
<Setter Property="BorderBrush" Value="Transparent"></Setter>
<Setter Property="BorderThickness" Value="2"></Setter>
<Setter Property="KeyboardNavigation.AcceptsReturn" Value="true"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Grid Width="32" Height="32" VerticalAlignment="Center">
<Ellipse x:Name="Border" Fill="{StaticResource NormalBackgroundBrush}" StrokeThickness="3" Stroke="{StaticResource NormalBorderBrush}" />
<Ellipse x:Name="CheckMark" Margin="8" Fill="{StaticResource GlyphBrush}" />
</Grid>
</BulletDecorator.Bullet>
<ContentPresenter Margin="20,0,0,0" HorizontalAlignment="Left" RecognizesAccessKey="True"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Border" Property="Fill" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Fill" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter TargetName="Border" Property="Fill" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Fill" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="false">
<Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Fill" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Fill" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="Fill" Value="{StaticResource PressedBrush}" />
<Setter TargetName="Border" Property="Stroke" Value="{StaticResource GlyphBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Border" Property="Fill" Value="#eeeeee" />
<Setter TargetName="Border" Property="Stroke" Value="#40000000" />
<Setter Property="Foreground" Value="#80000000"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton" x:Key="ViewMenuRadioButton" BasedOn="{StaticResource RadioButtonStyle}">
<Setter Property="Margin" Value="0 25 0 0"></Setter>
</Style>
<LinearGradientBrush x:Key="PressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#888" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
<Style TargetType="CheckBox" x:Key="CheckBoxStyle">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="KeyboardNavigation.AcceptsReturn" Value="true"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Border x:Name="Border" Width="32" Height="32" CornerRadius="0" Background="{StaticResource NormalBackgroundBrush}" BorderThickness="3" BorderBrush="{StaticResource NormalBorderBrush}">
<Path Width="15" Height="15" VerticalAlignment="Center" HorizontalAlignment="Center" x:Name="CheckMark" SnapsToDevicePixels="False" Stroke="{StaticResource GlyphBrush}" StrokeThickness="10" Data="M 0 0 L 7 7 M 0 7 L 7 0" />
</Border>
</BulletDecorator.Bullet>
<ContentPresenter Margin="20,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" RecognizesAccessKey="True"/>
</BulletDecorator>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="false">
<Setter TargetName="CheckMark" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Stroke" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsFocused" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Stroke" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="CheckMark" Property="Data" Value="M 0 7 L 7 0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource FocusBackgroundBrush}" />
<Setter TargetName="CheckMark" Property="Stroke" Value="{StaticResource FocusGlyphBrush}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource PressedBorderBrush}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 943 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,81 +0,0 @@
using MediaBrowser.Model.Dto;
using MediaBrowser.Plugins.DefaultTheme.Pages;
using MediaBrowser.Plugins.DefaultTheme.Resources;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace MediaBrowser.Plugins.DefaultTheme
{
/// <summary>
/// Class Theme
/// </summary>
class Theme : BaseTheme
{
/// <summary>
/// Gets the detail page.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>Page.</returns>
public override Page GetDetailPage(BaseItemDto item)
{
return new DetailPage(item.Id);
}
/// <summary>
/// Gets the list page.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>Page.</returns>
public override Page GetListPage(BaseItemDto item)
{
return new ListPage(item.Id);
}
/// <summary>
/// Gets the home page.
/// </summary>
/// <returns>Page.</returns>
public override Page GetHomePage()
{
return new HomePage();
}
/// <summary>
/// Displays the weather.
/// </summary>
public override void DisplayWeather()
{
App.Instance.Navigate(new WeatherPage());
}
/// <summary>
/// Gets the login page.
/// </summary>
/// <returns>Page.</returns>
public override Page GetLoginPage()
{
return new LoginPage();
}
/// <summary>
/// Gets the internal player page.
/// </summary>
/// <returns>Page.</returns>
public override Page GetInternalPlayerPage()
{
return new InternalPlayerPage();
}
/// <summary>
/// Gets the global resources.
/// </summary>
/// <returns>IEnumerable{ResourceDictionary}.</returns>
public override IEnumerable<ResourceDictionary> GetGlobalResources()
{
return new[] { new AppResources() };
}
}
}

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@ -1,62 +0,0 @@
using System;
using System.Windows;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Class BaseModalWindow
/// </summary>
public class BaseModalWindow : BaseWindow
{
/// <summary>
/// Shows the modal.
/// </summary>
/// <param name="owner">The owner.</param>
public void ShowModal(Window owner)
{
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
ShowInTaskbar = false;
WindowStartupLocation = WindowStartupLocation.Manual;
AllowsTransparency = true;
Width = owner.Width;
Height = owner.Height;
Top = owner.Top;
Left = owner.Left;
WindowState = owner.WindowState;
Owner = owner;
ShowDialog();
}
/// <summary>
/// Called when [browser back].
/// </summary>
protected override void OnBrowserBack()
{
base.OnBrowserBack();
CloseModal();
}
/// <summary>
/// Raises the <see cref="E:System.Windows.FrameworkElement.Initialized" /> event. This method is invoked whenever <see cref="P:System.Windows.FrameworkElement.IsInitialized" /> is set to true internally.
/// </summary>
/// <param name="e">The <see cref="T:System.Windows.RoutedEventArgs" /> that contains the event data.</param>
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
DataContext = this;
}
/// <summary>
/// Closes the modal.
/// </summary>
protected virtual void CloseModal()
{
Close();
}
}
}

View File

@ -1,21 +0,0 @@
using System.ComponentModel;
using System.Windows.Controls;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Provides a base class for all user controls
/// </summary>
public abstract class BaseUserControl : UserControl
{
public event PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string name)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
}

View File

@ -1,175 +0,0 @@
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Input;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Provides a base class for all Windows
/// </summary>
public abstract class BaseWindow : Window, INotifyPropertyChanged
{
/// <summary>
/// Occurs when [property changed].
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Called when [property changed].
/// </summary>
/// <param name="info">The info.</param>
public void OnPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
/// <summary>
/// The _content scale
/// </summary>
private double _contentScale = 1;
/// <summary>
/// Gets the content scale.
/// </summary>
/// <value>The content scale.</value>
public double ContentScale
{
get { return _contentScale; }
private set
{
_contentScale = value;
OnPropertyChanged("ContentScale");
}
}
/// <summary>
/// Initializes a new instance of the <see cref="BaseWindow" /> class.
/// </summary>
protected BaseWindow()
: base()
{
SizeChanged += MainWindow_SizeChanged;
Loaded += BaseWindowLoaded;
}
/// <summary>
/// Bases the window loaded.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
void BaseWindowLoaded(object sender, RoutedEventArgs e)
{
OnLoaded();
}
/// <summary>
/// Called when [loaded].
/// </summary>
protected virtual void OnLoaded()
{
MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
}
/// <summary>
/// Handles the SizeChanged event of the MainWindow control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="SizeChangedEventArgs" /> instance containing the event data.</param>
void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
{
ContentScale = e.NewSize.Height / 1080;
}
/// <summary>
/// Called when [browser back].
/// </summary>
protected virtual void OnBrowserBack()
{
}
/// <summary>
/// Called when [browser forward].
/// </summary>
protected virtual void OnBrowserForward()
{
}
/// <summary>
/// Invoked when an unhandled <see cref="E:System.Windows.Input.Keyboard.PreviewKeyDown" /> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
/// </summary>
/// <param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> that contains the event data.</param>
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
if (IsBackPress(e))
{
e.Handled = true;
if (!e.IsRepeat)
{
OnBrowserBack();
}
}
else if (IsForwardPress(e))
{
e.Handled = true;
if (!e.IsRepeat)
{
OnBrowserForward();
}
}
base.OnPreviewKeyDown(e);
}
/// <summary>
/// Determines if a keypress should be treated as a backward press
/// </summary>
/// <param name="e">The <see cref="KeyEventArgs" /> instance containing the event data.</param>
/// <returns><c>true</c> if [is back press] [the specified e]; otherwise, <c>false</c>.</returns>
private bool IsBackPress(KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
return true;
}
if (e.Key == Key.BrowserBack || e.Key == Key.Back)
{
return true;
}
if (e.SystemKey == Key.Left && e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Alt))
{
return true;
}
return false;
}
/// <summary>
/// Determines if a keypress should be treated as a forward press
/// </summary>
/// <param name="e">The <see cref="KeyEventArgs" /> instance containing the event data.</param>
/// <returns><c>true</c> if [is forward press] [the specified e]; otherwise, <c>false</c>.</returns>
private bool IsForwardPress(KeyEventArgs e)
{
if (e.Key == Key.BrowserForward)
{
return true;
}
if (e.SystemKey == Key.RightAlt && e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Alt))
{
return true;
}
return false;
}
}
}

View File

@ -1,49 +0,0 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// This subclass simply autofocuses itself when the mouse moves over it
/// </summary>
public class ExtendedButton : Button
{
private Point? _lastMouseMovePoint;
/// <summary>
/// Handles OnMouseMove to auto-select the item that's being moused over
/// </summary>
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
var window = this.GetWindow();
// If the cursor is currently hidden, don't bother reacting to it
if (Cursor == Cursors.None || window.Cursor == Cursors.None)
{
return;
}
// Store the last position for comparison purposes
// Even if the mouse is not moving this event will fire as elements are showing and hiding
var pos = e.GetPosition(window);
if (!_lastMouseMovePoint.HasValue)
{
_lastMouseMovePoint = pos;
return;
}
if (pos == _lastMouseMovePoint)
{
return;
}
_lastMouseMovePoint = pos;
Focus();
}
}
}

View File

@ -1,49 +0,0 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Extends Checkbox to provide focus on mouse over
/// </summary>
public class ExtendedCheckbox : CheckBox
{
private Point? _lastMouseMovePoint;
/// <summary>
/// Handles OnMouseMove to auto-select the item that's being moused over
/// </summary>
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
var window = this.GetWindow();
// If the cursor is currently hidden, don't bother reacting to it
if (Cursor == Cursors.None || window.Cursor == Cursors.None)
{
return;
}
// Store the last position for comparison purposes
// Even if the mouse is not moving this event will fire as elements are showing and hiding
var pos = e.GetPosition(window);
if (!_lastMouseMovePoint.HasValue)
{
_lastMouseMovePoint = pos;
return;
}
if (pos == _lastMouseMovePoint)
{
return;
}
_lastMouseMovePoint = pos;
Focus();
}
}
}

View File

@ -1,260 +0,0 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Extends the ListBox to provide auto-focus behavior when items are moused over
/// This also adds an ItemInvoked event that is fired when an item is clicked or invoked using the enter key
/// </summary>
public class ExtendedListBox : ListBox
{
/// <summary>
/// Fired when an item is clicked or invoked using the enter key
/// </summary>
public event EventHandler<ItemEventArgs<object>> ItemInvoked;
/// <summary>
/// Called when [item invoked].
/// </summary>
/// <param name="boundObject">The bound object.</param>
protected virtual void OnItemInvoked(object boundObject)
{
if (ItemInvoked != null)
{
ItemInvoked(this, new ItemEventArgs<object> { Argument = boundObject });
}
}
/// <summary>
/// The _auto focus
/// </summary>
private bool _autoFocus = true;
/// <summary>
/// Gets or sets a value indicating if the first list item should be auto-focused on load
/// </summary>
/// <value><c>true</c> if [auto focus]; otherwise, <c>false</c>.</value>
public bool AutoFocus
{
get { return _autoFocus; }
set
{
_autoFocus = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="ExtendedListBox" /> class.
/// </summary>
public ExtendedListBox()
: base()
{
ItemContainerGenerator.StatusChanged += ItemContainerGeneratorStatusChanged;
}
/// <summary>
/// The mouse down object
/// </summary>
private object mouseDownObject;
/// <summary>
/// Invoked when an unhandled <see cref="E:System.Windows.Input.Mouse.PreviewMouseDown" /> attached routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
/// </summary>
/// <param name="e">The <see cref="T:System.Windows.Input.MouseButtonEventArgs" /> that contains the event data. The event data reports that one or more mouse buttons were pressed.</param>
protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
{
base.OnPreviewMouseDown(e);
// Get the item that the mouse down event occurred on
mouseDownObject = GetBoundListItemObject((DependencyObject)e.OriginalSource);
}
/// <summary>
/// Invoked when an unhandled <see cref="E:System.Windows.UIElement.MouseLeftButtonUp" /> routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
/// </summary>
/// <param name="e">The <see cref="T:System.Windows.Input.MouseButtonEventArgs" /> that contains the event data. The event data reports that the left mouse button was released.</param>
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonUp(e);
// If the mouse up event occurred on the same item as the mousedown event, then fire ItemInvoked
if (mouseDownObject != null)
{
var boundObject = GetBoundListItemObject((DependencyObject)e.OriginalSource);
if (mouseDownObject == boundObject)
{
mouseDownObject = null;
OnItemInvoked(boundObject);
}
}
}
/// <summary>
/// The key down object
/// </summary>
private object keyDownObject;
/// <summary>
/// Responds to the <see cref="E:System.Windows.UIElement.KeyDown" /> event.
/// </summary>
/// <param name="e">Provides data for <see cref="T:System.Windows.Input.KeyEventArgs" />.</param>
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
if (!e.IsRepeat)
{
// Get the item that the keydown event occurred on
keyDownObject = GetBoundListItemObject((DependencyObject)e.OriginalSource);
}
e.Handled = true;
}
base.OnKeyDown(e);
}
/// <summary>
/// Invoked when an unhandled <see cref="E:System.Windows.Input.Keyboard.KeyUp" /> attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
/// </summary>
/// <param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> that contains the event data.</param>
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
// Fire ItemInvoked when enter is pressed on an item
if (e.Key == Key.Enter)
{
if (!e.IsRepeat)
{
// If the keyup event occurred on the same item as the keydown event, then fire ItemInvoked
if (keyDownObject != null)
{
var boundObject = GetBoundListItemObject((DependencyObject)e.OriginalSource);
if (keyDownObject == boundObject)
{
keyDownObject = null;
OnItemInvoked(boundObject);
}
}
}
e.Handled = true;
}
}
/// <summary>
/// The _last mouse move point
/// </summary>
private Point? _lastMouseMovePoint;
/// <summary>
/// Handles OnMouseMove to auto-select the item that's being moused over
/// </summary>
/// <param name="e">Provides data for <see cref="T:System.Windows.Input.MouseEventArgs" />.</param>
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
var window = this.GetWindow();
// If the cursor is currently hidden, don't bother reacting to it
if (Cursor == Cursors.None || window.Cursor == Cursors.None)
{
return;
}
// Store the last position for comparison purposes
// Even if the mouse is not moving this event will fire as elements are showing and hiding
var pos = e.GetPosition(window);
if (!_lastMouseMovePoint.HasValue)
{
_lastMouseMovePoint = pos;
return;
}
if (pos == _lastMouseMovePoint)
{
return;
}
_lastMouseMovePoint = pos;
var dep = (DependencyObject)e.OriginalSource;
while ((dep != null) && !(dep is ListBoxItem))
{
dep = VisualTreeHelper.GetParent(dep);
}
if (dep != null)
{
var listBoxItem = dep as ListBoxItem;
if (!listBoxItem.IsFocused)
{
listBoxItem.Focus();
}
}
}
/// <summary>
/// Gets the datacontext for a given ListBoxItem
/// </summary>
/// <param name="dep">The dep.</param>
/// <returns>System.Object.</returns>
private object GetBoundListItemObject(DependencyObject dep)
{
while ((dep != null) && !(dep is ListBoxItem))
{
dep = VisualTreeHelper.GetParent(dep);
}
if (dep == null)
{
return null;
}
return ItemContainerGenerator.ItemFromContainer(dep);
}
/// <summary>
/// Autofocuses the first list item when the list is loaded
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
void ItemContainerGeneratorStatusChanged(object sender, EventArgs e)
{
if (ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated && AutoFocus)
{
Dispatcher.InvokeAsync(OnContainersGenerated);
}
}
/// <summary>
/// Called when [containers generated].
/// </summary>
void OnContainersGenerated()
{
var index = 0;
if (index >= 0)
{
var item = ItemContainerGenerator.ContainerFromIndex(index) as ListBoxItem;
if (item != null)
{
item.Focus();
ItemContainerGenerator.StatusChanged -= ItemContainerGeneratorStatusChanged;
}
}
}
}
}

View File

@ -1,49 +0,0 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Extends RadioButton to provide focus on mouse over, and invoke on enter press
/// </summary>
public class ExtendedRadioButton : RadioButton
{
private Point? _lastMouseMovePoint;
/// <summary>
/// Handles OnMouseMove to auto-select the item that's being moused over
/// </summary>
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
var window = this.GetWindow();
// If the cursor is currently hidden, don't bother reacting to it
if (Cursor == Cursors.None || window.Cursor == Cursors.None)
{
return;
}
// Store the last position for comparison purposes
// Even if the mouse is not moving this event will fire as elements are showing and hiding
var pos = e.GetPosition(window);
if (!_lastMouseMovePoint.HasValue)
{
_lastMouseMovePoint = pos;
return;
}
if (pos == _lastMouseMovePoint)
{
return;
}
_lastMouseMovePoint = pos;
Focus();
}
}
}

View File

@ -1,41 +0,0 @@
using System.Windows.Controls;
using System.Windows.Input;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// This subclass solves the problem of ScrollViewers eating KeyDown for all arrow keys
/// </summary>
public class ExtendedScrollViewer : ScrollViewer
{
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Handled || e.OriginalSource == this)
{
base.OnKeyDown(e);
return;
}
// Don't eat left/right if horizontal scrolling is disabled
if (e.Key == Key.Left || e.Key == Key.Right)
{
if (HorizontalScrollBarVisibility == ScrollBarVisibility.Disabled)
{
return;
}
}
// Don't eat up/down if vertical scrolling is disabled
if (e.Key == Key.Up || e.Key == Key.Down)
{
if (VerticalScrollBarVisibility == ScrollBarVisibility.Disabled)
{
return;
}
}
// Let the base class do it's thing
base.OnKeyDown(e);
}
}
}

View File

@ -1,17 +0,0 @@
using System;
namespace MediaBrowser.UI.Controls
{
/// <summary>
/// Provides a generic EventArgs subclass that can hold any kind of object
/// </summary>
/// <typeparam name="T"></typeparam>
public class ItemEventArgs<T> : EventArgs
{
/// <summary>
/// Gets or sets the argument.
/// </summary>
/// <value>The argument.</value>
public T Argument { get; set; }
}
}

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1ADFE460-FD95-46FA-8871-CCCB4B62E2E8}</ProjectGuid>
<OutputType>library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MediaBrowser.UI.Controls</RootNamespace>
<AssemblyName>MediaBrowser.UI.Controls</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Expression.Effects">
<HintPath>..\ThirdParty\Expression\Microsoft.Expression.Effects.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Expression.Interactions">
<HintPath>..\ThirdParty\Expression\Microsoft.Expression.Interactions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="BaseModalWindow.cs" />
<Compile Include="BaseUserControl.cs" />
<Compile Include="BaseWindow.cs" />
<Compile Include="ExtendedButton.cs" />
<Compile Include="ExtendedCheckbox.cs" />
<Compile Include="ExtendedListBox.cs" />
<Compile Include="ExtendedRadioButton.cs" />
<Compile Include="ExtendedScrollViewer.cs" />
<Compile Include="ItemEventArgs.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="ScrollingPanel.cs" />
<Compile Include="TransitionControl.cs" />
<Compile Include="TransitionFrame.cs" />
<Compile Include="TreeHelper.cs" />
<Compile Include="VirtualizingWrapPanel.cs" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Page Include="Themes\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\Nuget\dlls\" /y /d /r /i</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,55 +0,0 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MediaBrowser.UI.Controls")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MediaBrowser.UI.Controls")]
[assembly: AssemblyCopyright("Copyright © 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly:ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Some files were not shown because too many files have changed in this diff Show More