コード例 #1
0
        public async Task <bool> ShowAsync()
        {
            _dlgView.SetUp();

            OnceInitializeAction?.Invoke();

            var tcs = new TaskCompletionSource <bool>();

            async void cancel(object sender, EventArgs e)
            {
                _dlgView.RunDismissalAnimation();
                await _viewController.DismissViewControllerAsync(true);

                tcs.SetResult(false);
            }

            async void complete(object sender, EventArgs e)
            {
                _dlgView.RunDismissalAnimation();
                await _viewController.DismissViewControllerAsync(true);

                tcs.SetResult(true);
            };

            _dlgView.DialogNotifierInternal.Canceled  += cancel;
            _dlgView.DialogNotifierInternal.Completed += complete;

            _dlgView.RunPresentationAnimation();
            await _viewController.PresentViewControllerAsync(_contentViewController, true);

            try
            {
                return(await tcs.Task);
            }
            finally
            {
                _dlgView.DialogNotifierInternal.Canceled  -= cancel;
                _dlgView.DialogNotifierInternal.Completed -= complete;
                _dlgView.TearDown();
            }
        }
コード例 #2
0
 public override void OnStart()
 {
     base.OnStart();
     _dialogView.RunPresentationAnimation();
 }