本文整理汇总了C#中MediaBrowser.Theater.Presentation.ViewModels.ItemListViewModel.AddIndexOptions方法的典型用法代码示例。如果您正苦于以下问题:C# ItemListViewModel.AddIndexOptions方法的具体用法?C# ItemListViewModel.AddIndexOptions怎么用?C# ItemListViewModel.AddIndexOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaBrowser.Theater.Presentation.ViewModels.ItemListViewModel
的用法示例。
在下文中一共展示了ItemListViewModel.AddIndexOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}