Controlling the toolkit:popup using MVVM
See original GitHub issueRecently I found out that when I wanted to display the popup I have to call the popup from code behind file .xaml.cs
and call the extension method ShowPopup/ShowPopupAsync
. It would be a lot easier for us to call that method from ViewModel
instead.
For now I have a work around but introducing the feature on upcoming release would be better than to relay on that workaround. Thanks!
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Xamarin Community Toolkit Popup MVVM Binding Issue
Attempting to utilize Xamarin Community Toolkit Popups in Xamarin Forms MVVM pattern project, target platforms IOS & Android.
Read more >Popup - .NET MAUI Community Toolkit
The Popup view allows developers to build their own custom UI and present it to their users.
Read more >Xamarin Community Toolkit Popup
In this article The Popup control allows developers to create and display popups within their applications. The Popup can be extended to return ......
Read more >Pass Data From and To Popups with Xamarin ... - YouTube
Under my video about the Xamarin Community Toolkit popups I got a lot of questions about passing data to or returning data from...
Read more >NET Community Toolkit 8.0 - MVVM Goodness for .NET MAUI
In this talk we'll introduce you to the .NET Community Toolkit and all the libraries and APIs it includes, and show a live...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I hope you already have created a popup. To actually show the popup from vm you have to reference the MainPage from
await App.Current.MainPage.ShowPopupAync(new YourPopup());
You can create a helper as wellI think this should be re-opened. Ideally under MVVM, you would want the popup itself to have a ViewModel and be able to return a result in a manner entirely driven by the ViewModel.
But currently the Popup’s Close() method is only available inside of the Popup’s codebehind. There is no ICommand interface that can drive the Close event. And the Popup doesn’t even support Behaviors, so you cannot use the EventToCommandBehavior.