You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the following scenario when using Prism.Forms: a Page with a Picker that binds the ItemSource and SelectedItem properties. An action calls the IDialogService.ShowDialog() its callback does absolutely nothing with the binded properties. But when it get's called the setter of the SelectedItem property is called with null as value and tho clears its previous value.
Steps to Reproduce
Page with Picker and Binded ItemSource and SelectedItem property
That PageViewModel calls ShowDialog on the injected IDialogService
Expected Behavior
Dialog is shown
Actual Behavior
Dialog is shown, but also the binded SelectedItem property of the picker is set to null.
Basic Information
Version with issue: v7.2.0.1367
Last known good version: -
Xamarin.Forms version: v4.1.0.673156
IDE: VisualStudio 15.9.15
Additional Information
I traced it back to DialogService Line 308 that changes the content of the current page temporary. This seems to update serval Bindings and clear the ItemSource of the picker, due to that the SelectedItem also gets cleared.
I am guessing this has to do with this issue xamarin/Xamarin.Forms#7340, probably adding the page's content to the AbsoluteLayout's children sets/propagates the binding context of the layout down the tree? Maybe set the binding context of the AbsoluteLayout to the binding context of the Page before adding it?
Description
I have the following scenario when using Prism.Forms: a Page with a Picker that binds the ItemSource and SelectedItem properties. An action calls the IDialogService.ShowDialog() its callback does absolutely nothing with the binded properties. But when it get's called the setter of the SelectedItem property is called with null as value and tho clears its previous value.
Steps to Reproduce
Expected Behavior
Dialog is shown
Actual Behavior
Dialog is shown, but also the binded SelectedItem property of the picker is set to null.
Basic Information
Additional Information
I traced it back to DialogService Line 308 that changes the content of the current page temporary. This seems to update serval Bindings and clear the ItemSource of the picker, due to that the SelectedItem also gets cleared.
Reproduction Link
Here is an sample that demonstrates the issue:
PickerDialogIssue.zip
The text was updated successfully, but these errors were encountered: