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 PayDialog(PayWindow window, PayViewModel viewModel) { this.window = window; this.viewModel = viewModel; }