Single UserControl that includes:
- TextBox for filter input
- ProgressRing for async/background search
Minimum Supported UWP Build: 15063
Install-Package HoveyTech.SearchableComboBox.UWP
Setup binding for SelectedEntity
, FilterText
and List
.
<uwp:SearchableComboBox SelectedItem="{Binding SelectedEntity, Mode=TwoWay}"
FilterText="{Binding FilterText, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding List}">
</uwp:SearchableComboBox >
NOTE: UserControl does not filter ItemsSource
. The ViewModel must filter ItemsSource
using FilterText
property and update List
property.
Set UseLoadingProgressRing
to True
. Whenever FilterText
changes on ViewModel update IsRefreshingItemsSource
binding.
<uwp:SearchableComboBox SelectedItem="{Binding SelectedEntity, Mode=TwoWay}"
FilterText="{Binding FilterText, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding List}"
UseLoadingProgressRing="True"
IsRefreshingItemsSource="{Binding IsSearching}">
</uwp:SearchableComboBox >
PlaceHolder:
Set PlaceholderText
to custom message (default: empty). Set ItemsSourceEmptyMessage
to custom message (default: "No items..."
).
<uwp:SearchableComboBox SelectedItem="{Binding SelectedEntity, Mode=TwoWay}"
FilterText="{Binding FilterText, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding List}"
PlaceholderText="Tap to select person..."
ItemsSourceEmptyMessage="No-one found by that name...">
</uwp:SearchableComboBox >