Esempio n. 1
0
 private void OnPromptRequested(PromptRequestedEventArgs args)
 {
     ThreadUtils.RunInUiAsync(() =>
     {
         IModelIndependentPresenter <InputPromptViewModel> presenter = InputPromptModelPresenterFactory.GetPresenter();
         presenter.SetModel(new InputPromptViewModel(new Action <string>(args.Callback))
         {
             Id          = args.Id,
             Description = args.Description,
             Text        = args.Text
         });
         presenter.Show();
     });
 }
        public T GetPresenter <T>() where T : IModelIndependentPresenter
        {
            IModelIndependentPresenter presenter = null;

            if (typeof(T) == typeof(IModelIndependentPresenter <HttpResendRequestViewModel>))
            {
                presenter = new HttpResendRequestWindow();
            }
            else if (typeof(T) == typeof(IModelIndependentPresenter <TextResendMessageViewModel>))
            {
                presenter = new TextResendMessageWindow();
            }
            return((T)presenter);
        }