Пример #1
0
        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);
        }
Пример #2
0
        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);
        }