Esempio n. 1
0
    public static PayDialog ShowPayDialog(int countDown, Action <int> afterHideCallback)
    {
        PayViewModel viewModel = new PayViewModel(afterHideCallback);
        ///viewModel.DrawCount = 20;

        ApplicationContext context = Context.GetApplicationContext();
        IUIViewLocator     locator = context.GetService <IUIViewLocator>();

        if (locator == null)
        {
            if (log.IsWarnEnabled)
            {
                log.Warn("Not found the \"IUIViewLocator\".");
            }

            throw new NotFoundException("Not found the \"IUIViewLocator\".");
        }
        PayWindow window = locator.LoadView <PayWindow>(ViewName);

        if (window == null)
        {
            if (log.IsWarnEnabled)
            {
                log.WarnFormat("Not found the dialog window named \"{0}\".", viewName);
            }

            throw new NotFoundException(string.Format("Not found the dialog window named \"{0}\".", viewName));
        }
        PayDialog payDialog = new PayDialog(window, viewModel);

        payDialog.Show();

        viewModel.CountDown = countDown;
        return(payDialog);
    }
Esempio n. 2
0
    private void OnShowPayDialog(object sender, InteractionEventArgs args)
    {
        PayDialogNotification notification = args.Context as PayDialogNotification;
        var callback = args.Callback;

        PayDialog.ShowPayDialog(notification.CountDown, (result) => {
            notification.DialogResult = result;
            if (callback != null)
            {
                callback();
            }
        });
    }