/// <summary> /// View Model for the playlist hosting a list of playlist items /// </summary> /// <param name="playlistView">The playlist View</param> /// <param name="unityContainer">unity container</param> public PlaylistViewModel(IPlaylistView playlistView, IUnityContainer unityContainer) { _unityContainer = unityContainer; _playlistItems = new ObservableCollection <PlaylistItem>(); _historyItems = new ObservableCollection <PlaylistItem>(); View = playlistView; View.ViewModel = this; _playlistItemRefreshTimer = new Timer(RefreshTimeSinceAdd); _playlistItemRefreshTimer.Change(0, 10000); }
public ArtistNetworkNodeViewModel( ArtistViewModel viewModel, AtlasHierarchy hierarchy, IHierarchyNode hierarchyNode, IPlaylistView playlist) : base(viewModel.Name) { ArtistViewModel = viewModel; Debug.Assert(hierarchyNode is ArtistHierarchyNode); _hierarchyNode = (ArtistHierarchyNode) hierarchyNode; _hierarchy = hierarchy; _playlist = playlist; _numTracks = GetArtistTrackCount(); IsHighlighted = SpotifyCacheService.IsArtistFollowed(ArtistViewModel.Artist); }
public ArtistNetworkNodeViewModel( ArtistViewModel viewModel, AtlasHierarchy hierarchy, IHierarchyNode hierarchyNode, IPlaylistView playlist) : base(viewModel.Name) { ArtistViewModel = viewModel; Debug.Assert(hierarchyNode is ArtistHierarchyNode); _hierarchyNode = (ArtistHierarchyNode)hierarchyNode; _hierarchy = hierarchy; _playlist = playlist; _numTracks = GetArtistTrackCount(); IsHighlighted = SpotifyCacheService.IsArtistFollowed(ArtistViewModel.Artist); }
public PlaylistViewModel(IPlaylistsView playlistsView, IPlaylistView playlistView) : base(playlistsView) { this.playlistView = playlistView; this.playlistView.BindingContext = this; playlists = Enumerable.Empty <Playlist>(); }
public virtual void BindPlaylistView(IBaseView sourceView, IPlaylistView view) { _playlistView = view; _playlistView.OnViewDestroy = (view2) => { _playlistPresenter.ViewDestroyed(); _playlistPresenter = null; _playlistView = null; }; _playlistPresenter = Bootstrapper.GetContainer().Resolve<IPlaylistPresenter>(); _playlistPresenter.BindView(view); }
public virtual void CreatePlaylistView(IBaseView sourceView) { if (_playlistView == null) _playlistView = Bootstrapper.GetContainer().Resolve<IPlaylistView>(); PushDialogView(MobileDialogPresentationType.Standard, "Playlist", null, _playlistView); }
public SynchronizedPlaylistView(IPlaylistView playlistView, int workerCount) { PlaylistView = playlistView; WorkerCount = workerCount; NewNextWait(); }
public virtual IPlaylistView CreatePlaylistView() { if(_playlistView != null) { _playlistView.ShowView(true); return _playlistView; } Action<IBaseView> onViewReady = (view) => { _playlistPresenter = Bootstrapper.GetContainer().Resolve<IPlaylistPresenter>(); _playlistPresenter.BindView((IPlaylistView)view); }; // Create view and manage view destruction _playlistView = Bootstrapper.GetContainer().Resolve<IPlaylistView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } }); _playlistView.OnViewDestroy = (view) => { _playlistPresenter.ViewDestroyed(); _playlistPresenter = null; _playlistView = null; }; return _playlistView; }