本文整理汇总了C#中MediaBrowser.Theater.Presentation.ViewModels.ItemListViewModel类的典型用法代码示例。如果您正苦于以下问题:C# ItemListViewModel类的具体用法?C# ItemListViewModel怎么用?C# ItemListViewModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ItemListViewModel类属于MediaBrowser.Theater.Presentation.ViewModels命名空间,在下文中一共展示了ItemListViewModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FolderPage
public FolderPage(BaseItemDto parent, DisplayPreferences displayPreferences, IApiClient apiClient, IImageManager imageManager, IPresentationManager presentation, INavigationService navigationManager, IPlaybackManager playbackManager, ILogger logger, ListPageConfig options)
{
_logger = logger;
_presentationManager = presentation;
_imageManager = imageManager;
_apiClient = apiClient;
_options = options;
_parentItem = parent;
InitializeComponent();
Loaded += FolderPage_Loaded;
SetDefaults(displayPreferences);
var playAllFromHere = parent.IsType("playlist") || parent.IsType("musicalbum");
_viewModel = new ItemListViewModel(vm => options.CustomItemQuery(vm, displayPreferences), _presentationManager, _imageManager, _apiClient, navigationManager, playbackManager, _logger)
{
ImageDisplayHeightGenerator = GetImageDisplayHeight,
DisplayNameGenerator = options.DisplayNameGenerator ?? GetDisplayName,
PreferredImageTypesGenerator = GetPreferredImageTypes,
ShowSidebarGenerator = GetShowSidebar,
ScrollDirectionGenerator = GetScrollDirection,
AutoSelectFirstItem = true,
ShowLoadingAnimation = true,
PlayAllFromHereOnPlayCommand = playAllFromHere,
PlayAllFromHereOnNavigateCommand = playAllFromHere
};
if (options.ShowTitle)
{
_viewModel.OnItemCreated = v =>
{
v.DisplayNameVisibility = Visibility.Visible;
};
}
_viewModel.AddIndexOptions(options.IndexOptions);
_viewModel.PropertyChanged += _viewModel_PropertyChanged;
_viewModel.DisplayPreferences = displayPreferences;
if (!string.IsNullOrEmpty(options.IndexValue))
{
var index = options.IndexOptions.First(i => string.Equals(i.Name, options.IndexValue));
_viewModel.IndexOptionsCollectionView.MoveCurrentTo(index);
}
DataContext = _viewModel;
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:57,代码来源:FolderPage.xaml.cs
示例2: FolderPage
public FolderPage(BaseItemDto parent, DisplayPreferences displayPreferences, IApiClient apiClient, IImageManager imageManager, ISessionManager sessionManager, IPresentationManager presentation, INavigationService navigationManager, IPlaybackManager playbackManager, ILogger logger, IServerEvents serverEvents, ListPageConfig options)
{
_navigationManager = navigationManager;
_playbackManager = playbackManager;
_logger = logger;
_serverEvents = serverEvents;
_presentationManager = presentation;
_sessionManager = sessionManager;
_imageManager = imageManager;
_apiClient = apiClient;
_options = options;
_displayPreferences = displayPreferences;
_parentItem = parent;
InitializeComponent();
Loaded += FolderPage_Loaded;
Unloaded += FolderPage_Unloaded;
SetDefaults(displayPreferences);
_viewModel = new ItemListViewModel(GetItemsAsync, _presentationManager, _imageManager, _apiClient, _navigationManager, _playbackManager, _logger, _serverEvents)
{
ImageDisplayHeightGenerator = GetImageDisplayHeight,
DisplayNameGenerator = GetDisplayName,
PreferredImageTypesGenerator = GetPreferredImageTypes,
ShowSidebarGenerator = GetShowSidebar,
ScrollDirectionGenerator = GetScrollDirection,
AutoSelectFirstItem = true,
ShowLoadingAnimation = true
};
_viewModel.AddIndexOptions(options.IndexOptions);
_viewModel.PropertyChanged += _viewModel_PropertyChanged;
_viewModel.DisplayPreferences = displayPreferences;
DataContext = _viewModel;
UpdateSortTitle();
UpdateSortOrder();
BtnSort.Visibility = _options.SortOptions.Count > 0
? Visibility.Visible
: Visibility.Collapsed;
BtnSort.Click += BtnSort_Click;
}
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:53,代码来源:FolderPage.xaml.cs
示例3: FolderPage
public FolderPage(BaseItemDto parent, DisplayPreferences displayPreferences, IApiClient apiClient, IImageManager imageManager, IPresentationManager presentation, INavigationService navigationManager, IPlaybackManager playbackManager, ILogger logger, IServerEvents serverEvents, ListPageConfig options)
{
_logger = logger;
_presentationManager = presentation;
_imageManager = imageManager;
_apiClient = apiClient;
_options = options;
_parentItem = parent;
InitializeComponent();
Loaded += FolderPage_Loaded;
SetDefaults(displayPreferences);
_viewModel = new ItemListViewModel(vm => options.CustomItemQuery(vm, displayPreferences), _presentationManager, _imageManager, _apiClient, navigationManager, playbackManager, _logger, serverEvents)
{
ImageDisplayHeightGenerator = GetImageDisplayHeight,
DisplayNameGenerator = options.DisplayNameGenerator ?? GetDisplayName,
PreferredImageTypesGenerator = GetPreferredImageTypes,
ShowSidebarGenerator = GetShowSidebar,
ScrollDirectionGenerator = GetScrollDirection,
AutoSelectFirstItem = true,
ShowLoadingAnimation = true
};
_viewModel.AddIndexOptions(options.IndexOptions);
_viewModel.PropertyChanged += _viewModel_PropertyChanged;
_viewModel.DisplayPreferences = displayPreferences;
if (!string.IsNullOrEmpty(options.IndexValue))
{
var index = options.IndexOptions.First(i => string.Equals(i.Name, options.IndexValue));
_viewModel.IndexOptionsCollectionView.MoveCurrentTo(index);
}
DataContext = _viewModel;
}
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:44,代码来源:FolderPage.xaml.cs
示例4: LoadMatchedItemsViewModel
private void LoadMatchedItemsViewModel()
{
MatchedItemsViewModel = new ItemListViewModel(s => Task.FromResult(_searchedItemsResult), _presentationManager, _imageManager, _apiClient, _navService, _playbackManager, _logger, _serverEvents)
{
ImageDisplayWidth = TileWidth,
ImageDisplayHeightGenerator = vm => TileHeight,
DisplayNameGenerator = GetDisplayName,
PreferredImageTypesGenerator = vm => new[] { ImageType.Thumb, ImageType.Primary }, // vm => _preferredImageTypes,
ScrollDirection = ScrollDirection.Horizontal,
EnableBackdropsForCurrentItem = false,
ShowSidebar = false,
AutoSelectFirstItem = false,
ShowLoadingAnimation = true,
IsVirtualizationRequired= false,
};
MatchedItemsViewModel.ItemContainerWidth = TileWidth + 5;
MatchedItemsViewModel.ItemContainerHeight = TileHeight + 5;
OnPropertyChanged("MatchedItemsViewModel");
}
开发者ID:amoisis,项目名称:MediaBrowser.Theater,代码行数:20,代码来源:SearchViewModel.cs
示例5: GetSeriesByGenre
private Task<ItemsResult> GetSeriesByGenre(ItemListViewModel viewModel, DisplayPreferences displayPreferences)
{
var query = new ItemQuery
{
Fields = FolderPage.QueryFields,
UserId = _sessionManager.LocalUserId,
IncludeItemTypes = new[] { "Series" },
SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy)
? new[] { displayPreferences.SortBy }
: new[] { ItemSortBy.SortName },
SortOrder = displayPreferences.SortOrder,
Recursive = true,
ParentId = ParentId
};
var indexOption = viewModel.CurrentIndexOption;
if (indexOption != null)
{
query.Genres = new[] { indexOption.Name };
}
return ApiClient.GetItemsAsync(query, CancellationToken.None);
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:30,代码来源:TvViewModel.cs
示例6: LoadNextUpViewModel
private void LoadNextUpViewModel(TvView view)
{
NextUpViewModel = new ItemListViewModel(GetNextUpAsync, PresentationManager, _imageManager, ApiClient, _navService, _playbackManager, _logger)
{
ImageDisplayWidth = TileWidth,
ImageDisplayHeightGenerator = v => TileHeight,
DisplayNameGenerator = i => i.SeriesName,
EnableBackdropsForCurrentItem = false,
EnableServerImageEnhancers = false,
OnItemCreated = vm =>
{
vm.DisplayNameVisibility = Visibility.Visible;
}
};
OnPropertyChanged("NextUpViewModel");
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:18,代码来源:TvViewModel.cs
示例7: LoadLatestEpisodesViewModel
private void LoadLatestEpisodesViewModel(TvView view)
{
LatestEpisodesViewModel = new ItemListViewModel(GetLatestEpisodes, PresentationManager, _imageManager, ApiClient, _navService, _playbackManager, _logger, _serverEvents)
{
ImageDisplayWidth = TileWidth,
ImageDisplayHeightGenerator = v => TileHeight,
DisplayNameGenerator = HomePageViewModel.GetDisplayName,
EnableBackdropsForCurrentItem = false,
EnableServerImageEnhancers = false,
OnItemCreated = vm =>
{
vm.DisplayNameVisibility = Visibility.Visible;
}
};
OnPropertyChanged("LatestEpisodesViewModel");
}
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:18,代码来源:TvViewModel.cs
示例8: GetAlbumSongs
private Task<ItemsResult> GetAlbumSongs(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new ItemQuery
{
UserId = _sessionManager.LocalUserId,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated,
ItemFields.Overview
},
ParentId = item.Id,
SortBy = new[] { ItemSortBy.SortName },
Recursive = true,
IncludeItemTypes = new[] { "Audio" }
};
return _apiClient.GetItemsAsync(query, CancellationToken.None);
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:23,代码来源:DetailPageViewModel.cs
示例9: GetSeasons
private Task<ItemsResult> GetSeasons(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new SeasonQuery
{
UserId = _sessionManager.LocalUserId,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated,
ItemFields.Overview
},
SeriesId = item.Id
};
return _apiClient.GetSeasonsAsync(query, CancellationToken.None);
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:18,代码来源:DetailPageViewModel.cs
示例10: GetSoundtracks
private Task<ItemsResult> GetSoundtracks(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new ItemQuery
{
UserId = _sessionManager.LocalUserId,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated
},
Ids = item.SoundtrackIds,
SortBy = new[] { ItemSortBy.SortName }
};
return _apiClient.GetItemsAsync(query, CancellationToken.None);
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:18,代码来源:DetailPageViewModel.cs
示例11: GetMovies
private Task<ItemsResult> GetMovies(ItemListViewModel viewModel, DisplayPreferences displayPreferences)
{
var query = new ItemQuery
{
Fields = FolderPage.QueryFields,
UserId = _sessionManager.CurrentUser.Id,
IncludeItemTypes = new[] { "Movie" },
SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy)
? new[] { displayPreferences.SortBy }
: new[] { ItemSortBy.SortName },
SortOrder = displayPreferences.SortOrder,
Recursive = true
};
var indexOption = viewModel.CurrentIndexOption == null ? string.Empty : viewModel.CurrentIndexOption.Name;
if (string.Equals(indexOption, "TopRated"))
{
query.MinCommunityRating = ApiClientExtensions.TopMovieCommunityRating;
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "Unwatched"))
{
query.Filters = new[] { ItemFilter.IsUnplayed };
}
else if (string.Equals(indexOption, "NewReleases"))
{
query.SortBy = new[] { ItemSortBy.ProductionYear, ItemSortBy.PremiereDate };
query.SortOrder = SortOrder.Descending;
query.Limit = 100;
}
else if (string.Equals(indexOption, "HDMovies"))
{
query.IsHD = true;
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "3DMovies"))
{
query.Is3D = true;
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "Trailers"))
{
query.IncludeItemTypes = new[] { "Trailer" };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "BoxSets"))
{
query.IncludeItemTypes = new[] { "BoxSet" };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "FavoriteMovies"))
{
query.Filters = new[] { ItemFilter.IsFavorite };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "TopCriticRated"))
{
query.MinCriticRating = 95;
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (string.Equals(indexOption, "Family"))
{
query.Genres = new[] { "Family" };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (indexOption.StartsWith("Genre:"))
{
query.Genres = new[] { indexOption.Split(':').Last() };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
}
else if (indexOption.StartsWith("Studio:"))
{
query.Studios = new[] { indexOption.Split(':').Last() };
query.SortBy = new[] { ItemSortBy.SortName };
query.SortOrder = SortOrder.Ascending;
//.........这里部分代码省略.........
开发者ID:pjrollo2000,项目名称:MediaBrowser.Theater,代码行数:101,代码来源:MoviesViewModel.cs
示例12: GetLatestMoviesAsync
private Task<ItemsResult> GetLatestMoviesAsync(ItemListViewModel viewModel)
{
var result = new ItemsResult
{
Items = _moviesView.LatestMovies.ToArray(),
TotalRecordCount = _moviesView.LatestMovies.Count
};
return Task.FromResult(result);
}
开发者ID:pjrollo2000,项目名称:MediaBrowser.Theater,代码行数:10,代码来源:MoviesViewModel.cs
示例13: LoadLatestTrailersViewModel
private void LoadLatestTrailersViewModel(MoviesView view)
{
LatestTrailersViewModel = new ItemListViewModel(GetLatestTrailersAsync, PresentationManager, _imageManager, ApiClient, _navService, _playbackManager, _logger, _serverEvents)
{
ImageDisplayWidth = _posterTileWidth,
ImageDisplayHeightGenerator = v => _posterTileHeight,
DisplayNameGenerator = HomePageViewModel.GetDisplayName,
PreferredImageTypesGenerator = vm => new[] { ImageType.Primary },
EnableBackdropsForCurrentItem = false
};
OnPropertyChanged("LatestTrailersViewModel");
LatestTrailersVisibility = view.TrailerItems.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
}
开发者ID:pjrollo2000,项目名称:MediaBrowser.Theater,代码行数:15,代码来源:MoviesViewModel.cs
示例14: GetChildren
private Task<ItemsResult> GetChildren(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new ItemQuery
{
UserId = _sessionManager.CurrentUser.Id,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated,
ItemFields.Overview
},
ParentId = item.Id,
SortBy = new[] { ItemSortBy.SortName }
};
return _apiClient.GetItemsAsync(query, CancellationToken.None);
}
开发者ID:Rainking720,项目名称:MediaBrowser.Theater,代码行数:19,代码来源:DetailPageViewModel.cs
示例15: GetSeasons
private Task<ItemsResult> GetSeasons(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new SeasonQuery
{
UserId = _sessionManager.CurrentUser.Id,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated,
ItemFields.Overview
},
SeriesId = item.Id,
IsSpecialSeason = false
};
return _apiClient.GetSeasonsAsync(query);
}
开发者ID:pjrollo2000,项目名称:MediaBrowser.Theater,代码行数:19,代码来源:DetailPageViewModel.cs
示例16: GetConvertedThemeMediaResult
private async Task<ItemsResult> GetConvertedThemeMediaResult(ItemListViewModel viewModel)
{
var allThemeMedia = await GetThemeMedia(ItemViewModel.Item);
return new ItemsResult
{
TotalRecordCount = allThemeMedia.ThemeSongsResult.TotalRecordCount + allThemeMedia.ThemeVideosResult.TotalRecordCount,
Items = allThemeMedia.ThemeVideosResult.Items.Concat(allThemeMedia.ThemeSongsResult.Items).ToArray()
};
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:10,代码来源:DetailPageViewModel.cs
示例17: GetSimilarItemsAsync
private Task<ItemsResult> GetSimilarItemsAsync(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var query = new SimilarItemsQuery
{
UserId = _sessionManager.LocalUserId,
Limit = item.IsGame || item.IsType("musicalbum") ? 6 : 12,
Fields = new[]
{
ItemFields.PrimaryImageAspectRatio,
ItemFields.DateCreated,
ItemFields.Overview,
ItemFields.MediaStreams
},
Id = item.Id
};
if (item.IsType("trailer"))
{
return _apiClient.GetSimilarTrailersAsync(query, CancellationToken.None);
}
if (item.IsGame)
{
return _apiClient.GetSimilarGamesAsync(query, CancellationToken.None);
}
if (item.IsType("musicalbum"))
{
return _apiClient.GetSimilarAlbumsAsync(query, CancellationToken.None);
}
if (item.IsType("series"))
{
return _apiClient.GetSimilarSeriesAsync(query, CancellationToken.None);
}
return _apiClient.GetSimilarMoviesAsync(query, CancellationToken.None);
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:37,代码来源:DetailPageViewModel.cs
示例18: GetMoviesByYear
private Task<ItemsResult> GetMoviesByYear(ItemListViewModel viewModel, DisplayPreferences displayPreferences)
{
var query = new ItemQuery
{
Fields = FolderPage.QueryFields,
UserId = _sessionManager.CurrentUser.Id,
IncludeItemTypes = new[] { "Movie" },
SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy)
? new[] { displayPreferences.SortBy }
: new[] { ItemSortBy.SortName },
SortOrder = displayPreferences.SortOrder,
Recursive = true
};
var indexOption = viewModel.CurrentIndexOption;
if (indexOption != null)
{
query.Years = new[] { int.Parse(indexOption.Name) };
}
return ApiClient.GetItemsAsync(query);
}
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:28,代码来源:MoviesViewModel.cs
示例19: GetTrailers
private async Task<ItemsResult> GetTrailers(ItemListViewModel viewModel)
{
var item = ItemViewModel.Item;
var items = await _apiClient.GetLocalTrailersAsync(_sessionManager.LocalUserId, item.Id);
return new ItemsResult
{
Items = items,
TotalRecordCount = items.Length
};
}
开发者ID:chandum2,项目名称:Emby.Theater,代码行数:12,代码来源:DetailPageViewModel.cs
示例20: GetAllActors
private Task<ItemsResult> GetAllActors(ItemListViewModel viewModel, DisplayPreferences displayPreferences)
{
var fields = FolderPage.QueryFields.ToList();
fields.Remove(ItemFields.Overview);
fields.Remove(ItemFields.DisplayPreferencesId);
fields.Remove(ItemFields.DateCreated);
var query = new PersonsQuery
{
Fields = fields.ToArray(),
IncludeItemTypes = new[] { "Movie", "Trailer" },
SortBy = !String.IsNullOrEmpty(displayPreferences.SortBy)
? new[] { displayPreferences.SortBy }
: new[] { ItemSortBy.SortName },
SortOrder = displayPreferences.SortOrder,
UserId = _sessionManager.CurrentUser.Id,
Recursive = true
};
var indexOption = viewModel.CurrentIndexOption;
if (indexOption != null)
{
if (string.Equals(indexOption.Name, "#", StringComparison.OrdinalIgnoreCase))
{
query.NameLessThan = "A";
}
else
{
query.NameStartsWithOrGreater = indexOption.Name;
query.NameLessThan = indexOption.Name + "zz";
}
}
return ApiClient.GetPeopleAsync(query);
}
开发者ID:jfrankelp,项目名称:MediaBrowser.Theater,代码行数:41,代码来源:MoviesViewModel.cs
注:本文中的MediaBrowser.Theater.Presentation.ViewModels.ItemListViewModel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论