names changed, layer of abstraction added
This commit is contained in:
@@ -24,7 +24,7 @@ using VDownload.Services.Data.Application;
|
||||
|
||||
namespace VDownload.Core.ViewModels.Home
|
||||
{
|
||||
public partial class HomePlaylistViewModel : ObservableObject
|
||||
public partial class HomeVideoCollectionViewModel : ObservableObject
|
||||
{
|
||||
#region SERVICES
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
|
||||
#region FIELDS
|
||||
|
||||
protected Playlist _playlist;
|
||||
protected VideoCollection _collection;
|
||||
|
||||
protected List<VideoViewModel> _removedVideos;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public HomePlaylistViewModel(IDownloadTaskManager tasksManager, ISettingsService settingsService, IStoragePickerService storagePickerService, IFilenameService filenameService, IDialogsService dialogsService, IStringResourcesService stringResourcesService, IApplicationDataService applicationDataService)
|
||||
public HomeVideoCollectionViewModel(IDownloadTaskManager tasksManager, ISettingsService settingsService, IStoragePickerService storagePickerService, IFilenameService filenameService, IDialogsService dialogsService, IStringResourcesService stringResourcesService, IApplicationDataService applicationDataService)
|
||||
{
|
||||
_tasksManager = tasksManager;
|
||||
_settingsService = settingsService;
|
||||
@@ -202,10 +202,10 @@ namespace VDownload.Core.ViewModels.Home
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public void LoadPlaylist(Playlist playlist)
|
||||
public void LoadPlaylist(VideoCollection collection)
|
||||
{
|
||||
_playlist = playlist;
|
||||
ParallelQuery<Video> playlistQuery = playlist.AsParallel();
|
||||
_collection = collection;
|
||||
ParallelQuery<Video> playlistQuery = _collection.AsParallel();
|
||||
|
||||
_removedVideos.Clear();
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
_minViewsFilter = MinViews;
|
||||
_maxViewsFilter = MaxViews;
|
||||
|
||||
IEnumerable<DateTimeOffset> date = playlist.Select(x => new DateTimeOffset(x.PublishDate));
|
||||
IEnumerable<DateTimeOffset> date = _collection.Select(x => new DateTimeOffset(x.PublishDate));
|
||||
MinDate = date.Min();
|
||||
MaxDate = date.Max();
|
||||
_minDateFilter = MinDate;
|
||||
@@ -230,9 +230,9 @@ namespace VDownload.Core.ViewModels.Home
|
||||
_minDurationFilter = MinDuration;
|
||||
_maxDurationFilter = MaxDuration;
|
||||
|
||||
Name = _playlist.Name;
|
||||
Name = _collection.Name;
|
||||
Videos.Clear();
|
||||
foreach (Video video in playlist)
|
||||
foreach (Video video in _collection)
|
||||
{
|
||||
Videos.Add(new VideoViewModel(video, _settingsService, _storagePickerService, _filenameService, _applicationDataService), true);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
protected readonly IDownloadTaskManager _downloadTaskManager;
|
||||
|
||||
protected readonly HomeVideoViewModel _videoViewModel;
|
||||
protected readonly HomePlaylistViewModel _playlistViewModel;
|
||||
protected readonly HomeVideoCollectionViewModel _playlistViewModel;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
|
||||
protected readonly Type _downloadsView = typeof(HomeDownloadsViewModel);
|
||||
protected readonly Type _videoView = typeof(HomeVideoViewModel);
|
||||
protected readonly Type _playlistView = typeof(HomePlaylistViewModel);
|
||||
protected readonly Type _playlistView = typeof(HomeVideoCollectionViewModel);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace VDownload.Core.ViewModels.Home
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public HomeViewModel(IConfigurationService configurationService, ISettingsService settingsService, IStringResourcesService stringResourcesService, ISearchService searchService, IDialogsService dialogsService, IDownloadTaskManager downloadTaskManager, HomeVideoViewModel videoViewModel, HomePlaylistViewModel playlistViewModel)
|
||||
public HomeViewModel(IConfigurationService configurationService, ISettingsService settingsService, IStringResourcesService stringResourcesService, ISearchService searchService, IDialogsService dialogsService, IDownloadTaskManager downloadTaskManager, HomeVideoViewModel videoViewModel, HomeVideoCollectionViewModel playlistViewModel)
|
||||
{
|
||||
_configurationService = configurationService;
|
||||
_settingsService = settingsService;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Page
|
||||
x:Class="VDownload.Core.Views.Home.HomePlaylistView"
|
||||
x:Class="VDownload.Core.Views.Home.HomeVideoCollectionView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:VDownload.Core.Views.Home"
|
||||
@@ -16,11 +16,11 @@ using Windows.Foundation.Collections;
|
||||
|
||||
namespace VDownload.Core.Views.Home
|
||||
{
|
||||
public sealed partial class HomePlaylistView : Page
|
||||
public sealed partial class HomeVideoCollectionView : Page
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
public HomePlaylistView(HomePlaylistViewModel viewModel)
|
||||
public HomeVideoCollectionView(HomeVideoCollectionViewModel viewModel)
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.DataContext = viewModel;
|
||||
@@ -10,7 +10,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="About\AboutView.xaml" />
|
||||
<None Remove="Home\HomePlaylistView.xaml" />
|
||||
<None Remove="Home\HomeVideoCollectionView.xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -44,7 +44,7 @@
|
||||
<None Update="Home\HomeDownloadsView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</None>
|
||||
<Page Update="Home\HomePlaylistView.xaml">
|
||||
<Page Update="Home\HomeVideoCollectionView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<None Update="Home\HomeVideoView.xaml">
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace VDownload.Core.Views
|
||||
{ typeof(HomeViewModel), typeof(HomeView) },
|
||||
{ typeof(HomeDownloadsViewModel), typeof(HomeDownloadsView) },
|
||||
{ typeof(HomeVideoViewModel), typeof(HomeVideoView) },
|
||||
{ typeof(HomePlaylistViewModel), typeof(HomePlaylistView) },
|
||||
{ typeof(HomeVideoCollectionViewModel), typeof(HomeVideoCollectionView) },
|
||||
{ typeof(SettingsViewModel), typeof(SettingsView) },
|
||||
{ typeof(AboutViewModel), typeof(AboutView) },
|
||||
{ typeof(AuthenticationViewModel), typeof(AuthenticationView) }
|
||||
|
||||
Reference in New Issue
Block a user