Issue
I was wondering whether there is a way I could bind two xaml files to one viewmodel in order to allow data binding from one viewmodel to two xaml files.
Solution
That's really easy actually,
SomePage somePage = new SomePage(); //View 1
SomeOtherPage otherPage= new SomeOtherPage(); // View 2
YourCommonViewModel commonVm = new YourCommonViewModel(); //Common VM
somePage.BindingContext = commonVm;
otherPage.BindingContext= commonVm;
Hope this helps
Answered By - FreakyAli
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.