예제 #1
0
        public async Task <MylistGroupInfo> ShowSelectSingleMylistDialog(int count, string hideMylistGroupId = null)
        {
            var mylistManager = _HohoemaApp.UserMylistManager;
            var context       = new MylistRegistrationDialogContext(mylistManager, count, hideMylistGroupId);

            // マイリストコメントは利用しない
            context.IsVisibleMylistComment = false;

            var dialog = new Views.Service.MylistRegistrationDialog()
            {
                DataContext = context
            };

            dialog.PrimaryButtonText = "選択";

            try
            {
                var result = await dialog.ShowAsync();

                if (result == Windows.UI.Xaml.Controls.ContentDialogResult.Primary)
                {
                    var tuple = await context.GetResult();

                    return(tuple.Item1);
                }
            }
            finally
            {
                context.Dispose();
            }

            return(null);
        }
예제 #2
0
        public async Task <Tuple <MylistGroupInfo, string> > ShowDialog(int count)
        {
            var mylistManager = _HohoemaApp.UserMylistManager;
            var context       = new MylistRegistrationDialogContext(mylistManager, count, hideMylistGroupId: null);

            var dialog = new Views.Service.MylistRegistrationDialog()
            {
                DataContext = context
            };

            try
            {
                var result = await dialog.ShowAsync();

                if (result == Windows.UI.Xaml.Controls.ContentDialogResult.Primary)
                {
                    return(await context.GetResult());
                }
            }
            finally
            {
                context.Dispose();
            }

            return(null);
        }