Esempio n. 1
0
        private async Task SubmitMylistContentSuggestion(string mylistId)
        {
            var hohoemaApp = App.Current.Container.Resolve <HohoemaApp>();

            Mntone.Nico2.Mylist.MylistGroup.MylistGroupDetailResponse mylistDetail = null;
            try
            {
                mylistDetail = await hohoemaApp.ContentProvider.GetMylistGroupDetail(mylistId);
            }
            catch { }

            if (mylistDetail == null || !mylistDetail.IsOK)
            {
                return;
            }

            var mylistGroup = mylistDetail.MylistGroup;

            PublishInAppNotification(new InAppNotificationPayload()
            {
                Content             = $"{mylistGroup.Name} をお探しですか?",
                ShowDuration        = DefaultNotificationShowDuration,
                SymbolIcon          = Symbol.Video,
                IsShowDismissButton = true,
                Commands            =
                {
                    new InAppNotificationCommand()
                    {
                        Label   = "マイリストを開く",
                        Command = new DelegateCommand(() =>
                        {
                            var pageManager = App.Current.Container.Resolve <PageManager>();
                            pageManager.OpenPage(HohoemaPageType.Mylist, new MylistPagePayload(mylistId).ToParameterString());

                            DismissInAppNotification();
                        })
                    },
                }
            });
        }
Esempio n. 2
0
        private async Task <InAppNotificationPayload> SubmitMylistContentSuggestion(string mylistId)
        {
            Mntone.Nico2.Mylist.MylistGroup.MylistGroupDetailResponse mylistDetail = null;
            try
            {
                mylistDetail = await MylistProvider.GetMylistGroupDetail(mylistId);
            }
            catch { }

            if (mylistDetail == null || !mylistDetail.IsOK)
            {
                return(null);
            }

            var mylistGroup = mylistDetail.MylistGroup;

            return(new InAppNotificationPayload()
            {
                Content = $"{mylistGroup.Name} をお探しですか?",
                ShowDuration = DefaultNotificationShowDuration,
                SymbolIcon = Symbol.Video,
                IsShowDismissButton = true,
                Commands =
                {
                    new InAppNotificationCommand()
                    {
                        Label = "マイリストを開く",
                        Command = new DelegateCommand(() =>
                        {
                            PageManager.OpenPageWithId(HohoemaPageType.Mylist, mylistId);

                            NotificationService.DismissInAppNotification();
                        })
                    },
                }
            });
        }