{"id":13711024,"url":"https://github.com/LuckyDucko/AwaitablePopups","last_synced_at":"2025-05-06T20:31:34.282Z","repository":{"id":38187734,"uuid":"237113905","full_name":"LuckyDucko/AwaitablePopups","owner":"LuckyDucko","description":"Customisable Popups for Xamarin Forms","archived":false,"fork":false,"pushed_at":"2023-02-14T19:04:03.000Z","size":2450,"stargazers_count":29,"open_issues_count":7,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-04T03:36:54.552Z","etag":null,"topics":["async","await","awaitable-popups","csharp","custom-popup","dialogs","loader","popup","popup-page","popups","userdialogs","xamarin","xamarin-forms","xamarin-library","xamarin-plugin"],"latest_commit_sha":null,"homepage":null,"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/LuckyDucko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-01-30T01:00:43.000Z","updated_at":"2024-05-16T16:41:03.000Z","dependencies_parsed_at":"2024-06-21T16:43:39.910Z","dependency_job_id":"f46d07aa-0b0a-4e6d-876e-ff189a0eb20b","html_url":"https://github.com/LuckyDucko/AwaitablePopups","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyDucko%2FAwaitablePopups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyDucko%2FAwaitablePopups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyDucko%2FAwaitablePopups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuckyDucko%2FAwaitablePopups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuckyDucko","download_url":"https://codeload.github.com/LuckyDucko/AwaitablePopups/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224528330,"owners_count":17326342,"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":["async","await","awaitable-popups","csharp","custom-popup","dialogs","loader","popup","popup-page","popups","userdialogs","xamarin","xamarin-forms","xamarin-library","xamarin-plugin"],"created_at":"2024-08-02T23:01:03.581Z","updated_at":"2024-11-13T21:31:24.492Z","avatar_url":"https://github.com/LuckyDucko.png","language":"C#","funding_links":[],"categories":["UI"],"sub_categories":[],"readme":"\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eAwaitable Popups\u003c/h3\u003e\n  \u003cp align=\"center\"\u003e\n    Customisable Popups for Xamarin Forms\n    \u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\n## Table of Contents\n\n[![NuGet Downloads](https://img.shields.io/nuget/dt/AwaitablePopups.svg)](https://www.nuget.org/packages/AwaitablePopups/)\n[![nuget](https://img.shields.io/nuget/v/AwaitablePopups.svg)](https://www.nuget.org/packages/AwaitablePopups/)\n\nhttps://www.fuget.org/packages/AwaitablePopups/badges\n* [About the Project](#about-the-project)\n  * [Built With](#built-with)\n* [Getting Started](#getting-started)\n  * [Installation](#installation)\n* [Usage](#usage)\n* [Contributing](#contributing)\n* [License](#license)\n* [Contact](#contact)\n* [Acknowledgements](#acknowledgements)\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n\nAwaitable Popups is a neat blend of the Rg.Plugins.Popup and AsyncAwaitBestPractices plugins to bring you a quick way to add popups into your Xamarin Forms App using familiar concepts \n\n\n\n### Built With\n* [Rg.Plugins.Popup](https://github.com/rotorgames/Rg.Plugins.Popup)\n* [AsyncAwaitBestPractices](https://github.com/brminnick/AsyncAwaitBestPractices)\n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nFirst, you must follow the [initialisation](https://github.com/rotorgames/Rg.Plugins.Popup/wiki/Getting-started)\n guide set out by Rg.Plugins.Popup, once you have that, have a look at usage down below\n\n### Installation\n\nYou can install the nuget by looking up 'AwaitablePopups' in your nuget package manager, or by getting it [here](https://www.nuget.org/packages/AwaitablePopups/)\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\nhere is an example of what this plugin makes easy (Looks slow due to giphy)\n\n![Gif Example](https://j.gifs.com/xn4mw9.gif)\n\n\n### New Example\nTo Use the plugin for its inbuilt popup pages in a basic setting (Dual/Single Response, Login, TextInput EntryInput,and loader.) All you need are these one liners\n\n`SingleResponse Popup Page`\n```csharp\nreturn await SingleResponseViewModel.AutoGenerateBasicPopup(Color.HotPink, Color.Black, \"I Accept\", Color.Gray, \"Good Job, enjoy this single response example\", \"thumbsup.png\");\n```\n\n`DualResponse Popup Page`\n```csharp\nreturn await DualResponseViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, \"Okay\", Color.WhiteSmoke, Color.Green, \"Looks Good!\", Color.DimGray, \"This is an example of a dual response popup page\", \"thumbsup.png\");\n```\n\n`Loader Popup Page`\n```csharp\n  await PopupService.WrapTaskInLoader(Task.Delay(10000), Color.Blue, Color.White, LoadingReasons(), Color.Black);\n```\n\n`Text Input PopupPage`\n```csharp\nawait TextInputViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, \"Cancel\", Color.WhiteSmoke, Color.Green, \"Submit\", Color.DimGray, \"Text input Example\", string.Empty);\n```\n`Entry Input PopupPage`\n```csharp\nawait EntryInputViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, \"Cancel\", Color.WhiteSmoke, Color.Green, \"Submit\", Color.DimGray, \"Text input Example\", string.Empty);\n```\n\n`LoginPage PopupPage`\n```csharp\nvar (username, password) = await LoginViewModel.AutoGenerateBasicPopup(Color.WhiteSmoke, Color.Red, \"Cancel\", Color.WhiteSmoke, Color.Green, \"Submit\", Color.DimGray, string.Empty, \"Username Here\", string.Empty, \"Password here\", \"thumbsup.png\", 0, 0);\n```\n\nor, to return from the loader a value\n```csharp\nawait PopupService.WrapReturnableTaskInLoader\u003cbool, LoaderPopupPage\u003e(IndepthCheckAgainstDatabase(), Color.Blue, Color.White, LoadingReasons(), Color.Black);\n```\n\nyou can also add in synchronous functions, however they are wrapped in a task\n```csharp\n\nprivate bool LongRunningFunction(int millisecondDelay)\n{\n    Thread.Sleep(millisecondDelay);\n    return true;\n}\nawait PopupService.WrapReturnableFuncInLoader(LongRunningFunction, 6000, Color.Blue, Color.White, LoadingReasons(), Color.Black);\n\n```\n\n## That's it! for advanced usage read on\n\nIn Version 1.1.0, AwaitablePopups will be starting on a new set of API's\n\nThis set of API's will be used for when the basic API wont cut it, without relying on me making another overload for every situation under the sun.\n\nThis API introduces\n\n `GeneratePopup\u003cTPopupPage\u003e`\nWhich allows you to supply your own popuppage xaml which will then be attached to whatever VM you called it from. \n\n`GeneratePopup(Dictionary\u003cstring, object\u003e propertyDictionary)`\nWhich allows you have a dictionary of values that a popup uses, pass and automatically attach to the appropriate properties on the VM side\n\nThese are both non-static. and require you to have an instance of the ViewModel to work with. Hence\n\n`\u003cViewModelClassNameHere\u003e.GenerateVM()`\nWhich provides you with a new instance of that VM\n\n`\u003cViewModelClassNameHere\u003e.PullViewModelProperties()`\nWhich collects all the properties of a VM, and provides them to you in a dictionary, so you can reuse and also while debugging, check what exists/whats been changed \nReturns this `Dictionary\u003cstring, (object property, Type propertyType)\u003e `\n\nHowever, for initialisation, i internally (and you can use) the following function\n`\u003cViewModelClassNameHere\u003e.InitialiseOptionalProperties(Dictionary\u003cstring, object\u003e optionalProperties)`\nWhich will attempt to set each of the viewmodel properties with the corrosponding value in the dictionary\n\nSo, to fix that, i provide\n`\u003cViewModelClassNameHere\u003e.FinalisePreparedProperties(Dictionary\u003cstring, (object property, Type propertyType)\u003e viewModelProperties)`\nWhich takes in the `Dictionary\u003cstring, (object property, Type propertyType)\u003e ` and creates `Dictionary\u003cstring, object\u003e optionalProperties`\n\n\nHopefully i will add on to make this easier in the future\n\n\n\n\n\n**If you want to make your own Popup Page**\n\nThis is the real power of this Plugin (Thanks in no small amount to Rotorgames amazing plugin). If you look at the source for DualResponsePopupPage, or the SingleResponse version you'll notice that they are just simple Xaml Pages. Nothing fancy. (except for the rg popup spice). \n\nYou can create the full thing yourself\n1. Create Xaml Page with codebehind\n2. Create your ViewModel that is associated with the popup, lets call ours `InformationPopupPage`\n3. Ensure your ViewModel inherits from `PopupViewModel\u003cTReturnable\u003e` where `TReturnable` is what you want the popuppage to return to its caller\n4. Ensure that your xaml page codebehind inherits from `PopupPage` (requirement to use rg plugins popup) and `IGenericViewModel\u003cTViewModel\u003e` where `TViewModel` is your Viewmodel, in our case it will be `IGenericViewModel\u003cInformationPopupPage\u003e`\n5. You're ready to start using it the same as `DualResponsePopupPage`\n\n**New API Usage (1.1.0)**\nor you can provide your own Xaml Page, with a codebehind that inherits from `PopupPage` and `IGenericViewModel\u003cTViewModel\u003e` where `TViewModel` is the plugin provided VM you wish to use.\n\nto use this version, just call `TViewModel.GeneratePopup\u003cYourXamlPopupPage\u003e()`\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nThis project uses the MIT License\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nMy [Github](https://github.com/LuckyDucko),\nor reach me on the [Xamarin Slack](https://xamarinchat.herokuapp.com/),\nor on my [E-mail](tyson@logchecker.com.au)\n\nProject Link: [AwaitablePopups](https://github.com/LuckyDucko/AwaitablePopups)\n\n\n\u003c!-- ACKNOWLEDGEMENTS --\u003e\n## Acknowledgements\n* [Brimmick](https://github.com/brminnick) has been a model to follow\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuckyDucko%2FAwaitablePopups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLuckyDucko%2FAwaitablePopups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLuckyDucko%2FAwaitablePopups/lists"}