void InitViewInjection() { ViewInjectionManager.Default.Inject(Regions.Content, NavigationKey.Tracks, () => TrackListViewModel.Create(), typeof(TrackListView)); ViewInjectionManager.Default.Inject(Regions.Navigation, NavigationKey.Tracks, () => NavigationItemViewModel.Create("Tracks", NavigationKey.Tracks), typeof(NavigationItemView)); ViewInjectionManager.Default.Inject(Regions.Content, NavigationKey.Artists, () => ArtistListViewModel.Create(), typeof(ArtistListView)); ViewInjectionManager.Default.Inject(Regions.Navigation, NavigationKey.Artists, () => NavigationItemViewModel.Create("Artists", NavigationKey.Artists), typeof(NavigationItemView)); ViewInjectionManager.Default.Inject(Regions.Content, NavigationKey.Albums, () => AlbumTreeViewModel.Create(), typeof(AlbumTreeView)); ViewInjectionManager.Default.Inject(Regions.Navigation, NavigationKey.Albums, () => NavigationItemViewModel.Create("AlbumTree", NavigationKey.Albums), typeof(NavigationItemView)); ViewInjectionManager.Default.Navigate(Regions.Navigation, NavigationKey.Tracks); }
/// <summary> /// Creates a new track list page /// </summary> public TrackListPage() { this.Title = "Track list"; this.InitializeComponent(); this.BindingContext = this.viewModel = new TrackListViewModel(); }
private ActionResult GetPlaylist(string title, string playUrl, List <Track> tracks, Func <int, string> getPageUrl, int page) { var trackList = new TrackListViewModel(tracks, page, _appSettings.TracksPerPage, GetViewModel, getPageUrl, playUrl); var model = new PlayViewModel(title, trackList, playUrl); return(PartialView("_Playlist", model)); }
public IChannelViewModel Make(byte id) { var controller = _controllerSet.ControllerFor(id); var player = MakePlayerViewModel(controller); var trackList = new TrackListViewModel(id, controller); return(new ChannelViewModel(id, _config, player, trackList, controller, _audioWallService)); }
public ActionResult Index(int page = 1) { var tracklist = new TrackListViewModel(Playlist.Tracks, page, _appSettings.TracksPerPage, GetViewModel, p => Url.Action(nameof(Index), new { page = p }), Url.Action(nameof(Restart))); var model = new PlayViewModel(Playlist.PlaylistName, tracklist); return(PartialView("_Index", model)); }
public async Task TestExecuteActions() { // run var viewModel = new TrackListViewModel(); // check ////viewModel.ImportTrackCommand.Execute(null); // don't execute import; it opens a file picker await viewModel.DeleteTrackListCommand.ExecuteAsync(); }
public void TestDefaultCtor() { // set up var viewModel = new TrackListViewModel(); // run viewModel.WaitForPropertyChange(nameof(viewModel.TrackList), TimeSpan.FromSeconds(10)); // check Assert.IsTrue(viewModel.IsListEmpty, "list must be empty"); Assert.IsFalse(viewModel.IsListRefreshActive, "refresh must not be active"); Assert.IsNotNull(viewModel.ImportTrackCommand, "import track command must not be null"); Assert.IsNotNull(viewModel.DeleteTrackListCommand, "delete track list command must not be null"); }
private TrackListViewModel TrackListViewModelInitializer(int page) { TrackListViewModel result = new TrackListViewModel { List = GetTracksDetailsList(page), PagingInfo = new PagingInfo { CurrentPage = page, ItemsPerPage = PageSize, TotalItems = db.Tracks.Count() } }; return(result); }
public void TestDefaultCtor() { // run var viewModel = new TrackListViewModel(); // check Assert.IsTrue(viewModel.IsListEmpty, "list must be empty"); Assert.IsFalse(viewModel.IsListRefreshActive, "refresh must not be active"); Assert.IsNotNull(viewModel.ItemTappedCommand, "item tapped command must not be null"); Assert.IsNotNull(viewModel.ImportTrackCommand, "import track command must not be null"); Assert.IsNotNull(viewModel.DeleteTrackListCommand, "delete track list command must not be null"); viewModel.ItemTappedCommand.Execute(null); ////viewModel.ImportTrackCommand.Execute(null); // don't execute import; it opens a file picker viewModel.DeleteTrackListCommand.Execute(null); }
public void TestDefaultCtor() { // run var parentViewModel = new TrackListViewModel(); var track = UnitTestHelper.GetDefaultTrack(); var viewModel = new TrackListEntryViewModel(parentViewModel, track); // check Assert.IsTrue(viewModel.Name.Any(), "name must contain value"); Assert.IsTrue(viewModel.DetailInfos.Any(), "detail infos must contain value"); Assert.IsNotNull(viewModel.Track, "track must be not null"); Assert.IsNotNull(viewModel.ShowTrackDetailsContextAction, "show track details command must not be null"); Assert.IsNotNull(viewModel.ZoomToTrackContextAction, "zoom to track command must not be null"); Assert.IsNotNull(viewModel.DeleteTrackContextAction, "delete track command must not be null"); Assert.IsNotNull(viewModel.TypeImageSource, "type image source must not be null"); viewModel.ShowTrackDetailsContextAction.Execute(null); viewModel.ZoomToTrackContextAction.Execute(null); viewModel.DeleteTrackContextAction.Execute(null); }