Hi, How to bind text to entry in xamarin forms my xaml is like
<controls:XfxComboBox Placeholder="Enter Text"
SelectedItem="{Binding SelectedItem}"
ItemsSource="{Binding Suggestions}"
SortingAlgorithm="{Binding SortingAlgorithm}"/>
<Entry Text="{Binding Id}" Placeholder="Id"/>
<Entry Text="{Binding Type}" Placeholder="Type"/>
and in my .cs BindingContext = new ServiceViewModel(); and my service model is like
public class ServiceViewModel : BindableObject
{
public ServiceViewModel ()
{
.....
......
Id = SelectedItem.id;
}
public string Id
{
get { return (string)GetValue(idProperty); }
set { SetValue(idProperty, value); }
}
public static readonly BindableProperty idProperty = BindableProperty.Create(nameof(Id),
typeof(string),
typeof(MainPage),
default(string),
propertyChanged: OnPropertyChanged);
private static void OnPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
{
var model = (ServiceViewModel)bindable;
}
}
Id is not showing in Entry.What I'm doing wrong please help me.Thank you