binding-context

How to Refresh the Bindings on HomePageViewModel when some data has been changed in Navigated Page2

眉间皱痕 提交于 2021-01-29 11:29:47
问题 I have some property which I am using from Page2 in HomePageViewModel, When I navigate to Page2 I have changed that property and on coming back by doing NavigiationPop. HomePage is not re-loaded/ refreshed at all as I have set the BindingContext in the constructor of HomePage, which is loaded only once. The solution which is working for me is Setting the BindingContext to the ViewModel on "onAppearing()", usually its not consider the best practice. But I also need to refresh the values which

Xamarin forms - Passing data between pages & views

邮差的信 提交于 2021-01-28 07:31:46
问题 I have a xamarin forms app. There are 2 classes with data, one of the pages is filling the data. The problem is: I'm creating new view, that should use data from both classes. The only way i'm familiar with is to set a class as a bindingContext to pass data between pages, and it's working fine with ONE class, because apparently there couldn't be 2 bindingContext at the same time. EXAMPLE: 1st class (all the classes are filled on the previous page. just accept that they are filled) public

Xamarin.Forms Strange Behavior when Implementing BindingContextChanged Event

孤者浪人 提交于 2019-12-13 18:48:17
问题 I have a list that has icon to most right of cell row when I implementing BindingContextChanged to control context action (enable and disable according to certain condition ) <customRender:ExtViewCell BindingContextChanged="FlightDetialCell_OnBindingContextChanged"> private void FlightDetialCell_OnBindingContextChanged(object sender, EventArgs e) { var deleteAction = new MenuItem { Text="Delete" , IsDestructive=true}; deleteAction.SetBinding(MenuItem.CommandParameterProperty, new Binding(".")

Set BindingContext to ViewModel in XAML on Xamarin.Forms

感情迁移 提交于 2019-11-26 18:25:45
问题 I want to develop a simple project with Xamarin.Form and MVVM. In my solution (named XamarinPOC) i have (in addition to standard Xamarin.Forms projects) one separate project for the model (XamarinPOC.Model) and one separate project for the ViewModel (XamarinPOC.ViewModel). I defined in a XamarinPOC.ViewModel project an abstract class for a BaseViewModel class (that implements the INotifyPropertyChanged Interface) and after I've created a SummaryViewModel class that extend BaseViewModel class