<StackLayout>
<combobox:SfComboBox IsEditableMode="True" DataSource="{Binding EmployeeCollection}" DisplayMemberPath="Name">
<combobox:SfComboBox.Behaviors>
<local:SelectionChangedBehavior/>
</combobox:SfComboBox.Behaviors>
</combobox:SfComboBox>
</StackLayout>
public class SelectionChangedBehavior : Behavior<SfComboBox>
{
public ICommand SelectBySelection_Behavior
{
get
{
return new Command(() => CallForSelectionCriteria());
}
}
public void CallForSelectionCriteria()
{
// This method called while select the item from suggestion box in SfComboBox. You can open the SfPopupView whenever SelectedItem changes.
}
protected override void OnAttachedTo(SfComboBox bindable)
{
bindable.SelectionChanged += Bindable_SelectionChanged;
base.OnAttachedTo(bindable);
}
private void Bindable_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SelectBySelection_Behavior.CanExecute(true);
SelectBySelection_Behavior.Execute(true);
}
protected override void OnDetachingFrom(SfComboBox bindable)
{
bindable.SelectionChanged -= Bindable_SelectionChanged;
base.OnDetachingFrom(bindable);
}
} |