Replies: 1 comment
-
For your latest code example you cannot access the Result property because you are declaring the type as In Windows if you inspect the The error on iOS might be caused by this method: private async void clPickerView_SelectionChanged(object sender,
SelectionChangedEventArgs e)
{
var currentItem = e.CurrentSelection.FirstOrDefault();
await CloseAsync(currentItem);
} I would stick a breakpoint in this method as I suspect it will be called a second time when the popup is closing. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In my .NET 9 MAUI project, I use
Popup
from theCommunity Toolkit
. I have created a generic component to display items in aList
based on aItemTemplate
:In the code behind, I have this code:
To open the
Popup
and get the selection of the user, I have this code:This code is working perfectly with .NET 8 MAUI: when there is a selection in the
CollectionView
, the value is returned to the called view.. With the new version of theCommunity Toolkit
12.1.0,Popup
changed.To open the popup, I use now something similar to this:
But now what it returns is of type
IPopupResult
. If I know exactly what type it returns, I can write:Because this is a generic view, I don't know what type of data I pass and receive back. I attempted to implement the
Popup<T>
as described in the Microsoft documentation.So, I define the popup as:
and in the XAML
Now, the component opens the popup as expected but then I select an item in the
CollectionView
, the functionclPickerView_SelectionChanged
is called.After the line
I get different issues depend on the platform. For example, in iOS I get this error.
In Windows the reason of the error is always a mystery. I get there but I don't know the reason ("Select the type of word" is the popup).
In Android, just this error message
I don't understand how to fix this error or return the value.
Update
If I inspect the result from the
Popup
, I can see theIPopupResult
has aResult
property but I can access it.Beta Was this translation helpful? Give feedback.
All reactions