I am facing a major issue while binding a control.. It was working fine previously. the set property is never fired when i change the state of control (like changing Editor text) This is a complete hard stop for us. our project completely relies on Binding.
Here is the sample
public class TestPage:ContentPage
{
public TestPage()
{
this.BindingContext = new TestPageViewModel();
var lbl = new Label();
lbl.SetBinding<TestPageViewModel>(Label.TextProperty, vm => vm.Name);
var txt = new Editor() {WidthRequest=100 };
txt.SetBinding<TestPageViewModel>(Editor.TextProperty, vm => vm.Name, BindingMode.TwoWay);
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.Center,
Children = { lbl, txt}
};
}
}
public class TestPageViewModel:BaseViewModel
{
public TestPageViewModel()
{
this._Name = "Jason";
}
private string _Name;
public string Name
{
get { return this._Name;}
set { this._Name = value; this.OnPropertyChanged("Name"); }
}
}
Guys please let me know any solutions as soon as possible. @TheRealJasonSmith
Thanks in advance.