public static void Init() { if (Instance == null) { Instance = new UserDialogService(); } }
public static void Init(Activity activity) { if (Instance != null) return; var app = Application.Context.ApplicationContext as Application; if (app == null) throw new Exception("Application Context is not an application"); ActivityMonitor.CurrentTopActivity = activity; app.RegisterActivityLifecycleCallbacks(new ActivityMonitor()); Instance = new UserDialogService(() => ActivityMonitor.CurrentTopActivity); }
/// <summary> /// Initializes a new instance of the <see cref="TerminologyVocabularyViewModel"/> class. /// </summary> /// <param name="proxy">The proxy.</param> /// <param name="userDialogService">The user dialog service.</param> /// <param name="accessControlManager">The access control manager.</param> /// <param name="commandFactory">The command factory.</param> public TerminologyVocabularyViewModel( ITerminologyProxy proxy, UserDialogService userDialogService, IAccessControlManager accessControlManager, ICommandFactory commandFactory) : base(accessControlManager, commandFactory) { _proxy = proxy; _userDialogService = userDialogService; _proxy.GetVocabularyListCompleted += GetVocabularyListCompleted; _proxy.FindConceptsWithNameMatchingCompleted += FindConceptsWithNameMatchingCompleted; var commandFactoryHelper = CommandFactoryHelper.CreateHelper(this, commandFactory); NamespaceChangedCommand = commandFactoryHelper.BuildDelegateCommand <TerminologyVocabulary> ( () => NamespaceChangedCommand, ExecuteNamespaceChanged); PerformSearchCommand = commandFactoryHelper.BuildDelegateCommand <string> (() => PerformSearchCommand, ExecutePerformSearch); }
public static void Init(Func<Activity> getActivity) { if (Instance == null) Instance = new UserDialogService(getActivity); }
protected virtual async Task HandleException(Exception ex) { var baseException = ex.GetBaseException(); await UserDialogService.AlertAsync(baseException.Message); }