Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Problem binding data across content pages on iOS Forms app.

$
0
0

I have a problem with binding across pages. (simplified) A project has a view model consisting of a static class with a single string property Name. Content Page1 is set as the BindingContext for the model. A label on Page1 has SetBinding set for Label.TextProperty in "one-way" mode in the hope that a change to the underlying string will cause the label text to be updated automatically. The handler for a button on Page1 instantiates content Page2 and sets the BindingContext to the same model before displaying the Page2 using navigation. In the constructor for Page2, an Entry field has SetBinding set for Entry.TextProperty in "one way to source" mode so that a text changed event handler (or similar) would update the view model. The "Back" button would return the user to Page1 with the newly entered value displayed on the label. Only it doesn't work. The label remains blank. Am I missing or overlooking something? Any known pitfalls I could check? Or is there a better way to implement there required cross-page functionality?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>