protected override async Task NavigatedToAsync(CancellationToken cancelToken, NavigatedToEventArgs e, Dictionary <string, object> viewModelState) { if (e.Parameter is string) { var payload = MylistPagePayload.FromParameterString <MylistPagePayload>(e.Parameter as string); var playableList = await MylistHelper.FindMylist(payload.Id, payload.Origin); Mylist.Value = playableList; MylistOrigin.Value = playableList.ToMylistOrigin().Value; } if (Mylist.Value != null) { MylistBookmark = Database.BookmarkDb.Get(Database.BookmarkType.Mylist, Mylist.Value.Id) ?? new Database.Bookmark() { Label = Mylist.Value.Label, Content = Mylist.Value.Id, BookmarkType = Database.BookmarkType.Mylist, }; FollowToggleButtonService.SetFollowTarget(Mylist.Value as Interfaces.IFollowable); RaisePropertyChanged(nameof(MylistBookmark)); } await Reset(); await base.NavigatedToAsync(cancelToken, e, viewModelState); }
protected override void Execute(object parameter) { if (parameter is Models.Subscription.SubscriptionSource source) { switch (source.SourceType) { case Models.Subscription.SubscriptionSourceType.User: PageManager.OpenPage(HohoemaPageType.UserVideo, source.Parameter); break; case Models.Subscription.SubscriptionSourceType.Channel: PageManager.OpenPage(HohoemaPageType.ChannelVideo, source.Parameter); break; case Models.Subscription.SubscriptionSourceType.Mylist: var mylistPagePayload = new MylistPagePayload(source.Parameter) { Origin = Services.PlaylistOrigin.OtherUser }; PageManager.OpenPage(HohoemaPageType.Mylist, mylistPagePayload.ToParameterString()); break; case Models.Subscription.SubscriptionSourceType.TagSearch: PageManager.SearchTag(source.Parameter, Mntone.Nico2.Order.Descending, Mntone.Nico2.Sort.FirstRetrieve); break; case Models.Subscription.SubscriptionSourceType.KeywordSearch: PageManager.SearchKeyword(source.Parameter, Mntone.Nico2.Order.Descending, Mntone.Nico2.Sort.FirstRetrieve); break; default: break; } } }
protected override void Execute(object parameter) { if (parameter is Models.Subscription.SubscriptionDestination dest) { var mylistPagePayload = new MylistPagePayload(dest.PlaylistId) { Origin = dest.Target == Models.Subscription.SubscriptionDestinationTarget.LocalPlaylist ? Services.PlaylistOrigin.Local : Services.PlaylistOrigin.LoginUser }; PageManager.OpenPage(HohoemaPageType.Mylist, mylistPagePayload.ToParameterString()); } }
protected override async Task NavigatedToAsync(CancellationToken cancelToken, NavigatedToEventArgs e, Dictionary <string, object> viewModelState) { if (e.Parameter is string) { var payload = MylistPagePayload.FromParameterString <MylistPagePayload>(e.Parameter as string); var playableList = await HohoemaApp.GetPlayableList(payload.Id, payload.Origin); PlayableList.Value = playableList; MylistOrigin.Value = playableList.Origin; } await base.NavigatedToAsync(cancelToken, e, viewModelState); }
protected override void Execute(object parameter) { if (parameter is Models.Subscription.SubscriptionDestination dest) { if (dest.Target == Models.Subscription.SubscriptionDestinationTarget.LoginUserMylist) { var mylistPagePayload = new MylistPagePayload(dest.PlaylistId); PageManager.OpenPage(HohoemaPageType.Mylist, mylistPagePayload.ToParameterString()); } else if (dest.Target == Models.Subscription.SubscriptionDestinationTarget.LocalPlaylist) { PageManager.OpenPage(HohoemaPageType.LocalPlaylist, "id=" + dest.PlaylistId); } } }