Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146822 | Aug 21,2019 04:29 PM UTC | Aug 22,2019 01:22 PM UTC | Xamarin.Forms | 1 |
![]() |
Tags: SfComboBox |
<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);
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.