I am having a problem with sfautocomplete under Xamarin Forms UWP. In my case the suggestions disappear after I type the second character in my string
Please look at the following screens when I search for a license plate
I get a suggestion for the first letter 'a' but not after I type a second letter 's' ..there are 2 records that should still appear as a suggestion
Is this a bug? My bindings seem to work..
My DataSource contains a collection of VehicleRecords.. Each VehicleRecord contains an Object Vehicle.
public class VehicleRecord
{
public Vehicle Vehicle { get; set; }
}
public class Vehicle
{
public string LicensePlate { get { return _LicenseNumber; } set { _LicenseNumber = value; NotifyPropertyChanged(); } }
}
AssignedVehicleRecordsDataSource is a collection of VehicleRecord
Here is the xaml code
<autocomplete:SfAutoComplete x:Name="autoComplete" IsVisible="{Binding IsVehicleListVisible}"
MaximumDropDownHeight="150" WidthRequest="300"
AutoCompleteMode="Suggest"
DisplayMemberPath="Vehicle.LicensePlate"
DataSource="{Binding AssignedVehicleRecordsDataSource}"
Text="{Binding SelectedItem,Mode=TwoWay}"
SuggestionMode="Contains"
IsFocused="{Binding IsFocused,Mode=TwoWay}"
Watermark="Search Here"
DropDownItemHeight="100" DropDownCornerRadius="0"
DropDownHeaderViewHeight="50" DropDownFooterViewHeight="50"
NoResultsFoundText="No Results Found" HeightRequest="45">
<autocomplete:SfAutoComplete.ItemTemplate>
<DataTemplate>
<StackLayout WidthRequest="300" Orientation="Horizontal">
<Image Margin="7" HeightRequest="45" WidthRequest="45" VerticalOptions="CenterAndExpand"
Source="{Binding Vehicle.BodyType, Converter={StaticResource BodyTypeToImageConverter}}" />
<StackLayout Margin="4" Orientation="Vertical">
<Label Text="{Binding Vehicle.LicensePlate}" TextColor="Black" FontSize="15" VerticalOptions="Center"/>
<Label Text="{Binding Vehicle.VIN}" FontSize="14" VerticalOptions="Center"/>
</StackLayout>
</StackLayout>
</DataTemplate>
</autocomplete:SfAutoComplete.ItemTemplate>
<autocomplete:SfAutoComplete.DropDownHeaderView>
<StackLayout BackgroundColor="#FFFAFAFA" Orientation="Horizontal">
<Label Margin="15,0,0,0" TextColor="Black" VerticalTextAlignment="Center" HorizontalTextAlignment="Center" FontSize="20">
<Label.Text>
<OnPlatform x:TypeArguments="x:String" iOS="A" Android="A" WinPhone="" />
</Label.Text>
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" iOS="icon" Android="icon.ttf#icon" WinPhone="Segoe MDL2 Assets" />
</Label.FontFamily>
</Label>
<Label Text="{Binding SelectedItemValue}" BackgroundColor="#FFFAFAFA" HorizontalOptions="Fill"
TextColor="Black" VerticalOptions="Center" FontSize="15"/>
</StackLayout>
</autocomplete:SfAutoComplete.DropDownHeaderView>
</autocomplete:SfAutoComplete>
</StackLayout>