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); }
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(); } }); }