{"id":14966980,"url":"https://github.com/escamoteur/reactiveui.dialogs","last_synced_at":"2025-10-25T17:31:34.126Z","repository":{"id":131016865,"uuid":"86334910","full_name":"escamoteur/ReactiveUI.Dialogs","owner":"escamoteur","description":"ReactiveUI wrapper for Acr.UserDialogs","archived":false,"fork":false,"pushed_at":"2017-03-28T09:32:25.000Z","size":232,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T09:51:13.425Z","etag":null,"topics":["dialogs","reactiveui"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/escamoteur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-27T12:51:35.000Z","updated_at":"2024-09-19T20:28:39.000Z","dependencies_parsed_at":"2023-05-26T20:30:42.470Z","dependency_job_id":null,"html_url":"https://github.com/escamoteur/ReactiveUI.Dialogs","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.33333333333333337","last_synced_commit":"8bb2afafc2675e35c7cfddba575707aa69cc637f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escamoteur%2FReactiveUI.Dialogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escamoteur%2FReactiveUI.Dialogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escamoteur%2FReactiveUI.Dialogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escamoteur%2FReactiveUI.Dialogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escamoteur","download_url":"https://codeload.github.com/escamoteur/ReactiveUI.Dialogs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238191229,"owners_count":19431398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dialogs","reactiveui"],"created_at":"2024-09-24T13:37:14.835Z","updated_at":"2025-10-25T17:31:33.648Z","avatar_url":"https://github.com/escamoteur.png","language":"C#","readme":"# ReactiveUI.Dialogs\n\nAllan Ritchie's [Acr.UserDialogs](https://github.com/aritchie/userdialogs) is an amazing libary that make live for any mobile devloper much easier when it comes to Alerts, Toasts or Spinners.\n\nOne of it big advantages is that you can call it from almost anywhere in your code. This can be in at the same time problematic because it misleads to violate the separation of View and ViewModel.\n\nAnother problem that can occur if you call it to the wrong time in the App lifecycle on Android is that you get an ugly exception.\n\nWhile moving the Dialog code to my View and using RxUI I could solve both problems by writing:\n\n```c#\nthis.WhenAnyValue(x =\u003e x.ViewModel.Message)\n    .Where(message =\u003e !string.IsNullOrWhiteSpace(message))\n    .Subscribe(message =\u003e\n        {\n            UserDialogs.Instance.Alert(message);\n            }\n    );\n```\n\nor\n\n```c#\n\nViewModel.GetReplay.IsExecuting.Subscribe(busy =\u003e\n    {\n        if (busy)\n        {\n            UserDialogs.Instance.ShowLoading();\n        }\n        else\n        {\n            UserDialogs.Instance.HideLoading();\n            }\n\n        });\n```\n\nSo I deciced to start writing an ReactiveUI wrapper around Acr.UserDialogs. So that I now can write:\n\n```c#\nthis.AlertWhen(x =\u003e x.ViewModel.AlertMessage).DisposeWith(d);\nthis.ToastWhen(x =\u003e x.ViewModel.ToastMessage).DisposeWith(d);\n\nthis.ViewModel.ShowLoadingWhen(x=\u003ex.ShowSpinner.IsExecuting).DisposeWith(d);\n``` \n\nAs soon as the observed string properties get a value assigned a Dialog/Toast is shown\n\nOpening a new Dialog outmatically closes any currently open ones.\n\nBefore an Dialog is shown it is checked if the App is not backgrounded (Not sure yes if it would make sense to throw an optional Exception here)\n\n\nCurrently I support this methods:\n\n```c# \npublic static IDisposable AlertWhen\u003cTSender\u003e(this TSender This,\n  Expression\u003cFunc\u003cTSender, string\u003e\u003e property, string title = null, string okText = null)\n\npublic static IDisposable AlertWhen\u003cTSender\u003e(this TSender This,\n    Expression\u003cFunc\u003cTSender, AlertConfig\u003e\u003e property, string title = null, string okText = null)\n\n\npublic static IDisposable ToastWhen\u003cTSender\u003e(this TSender This,\n    Expression\u003cFunc\u003cTSender, string\u003e\u003e property, TimeSpan? dismissTimer = null)\n\npublic static IDisposable ToastWhen\u003cTSender\u003e(this TSender This,\n    Expression\u003cFunc\u003cTSender, ToastConfig\u003e\u003e property, TimeSpan? dismissTimer = null)\n\n\n// Disposing the returned Disposable ensures that the Spinner \n// is hidden when the subscription is disposed\n\npublic static LoadingDisposable ShowLoadingWhen\u003cTSender\u003e(this TSender This,\n    Expression\u003cFunc\u003cTSender, bool\u003e\u003e property, string title = null, MaskType? maskType = null)\n\n\npublic static LoadingDisposable ShowLoadingWhen\u003cTSender\u003e(this TSender This,\n    Func\u003cTSender,IObservable\u003cbool\u003e\u003e busy, string title = null, MaskType? maskType = null)\n```\n\n\n### Nuget\n\u003eInstall-Package ReactiveUI.Dialogs\n\n\n### Important:\nMake sure to add the NUget to your Platform project too\nCall the UserDialogs Init method in your MainActivity on Android\n\n`UserDialogs.Init(this)`\n\n\n## Contribution\nany PRs to complete this wrapper are very welcome.\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescamoteur%2Freactiveui.dialogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescamoteur%2Freactiveui.dialogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescamoteur%2Freactiveui.dialogs/lists"}