Hi,
I'm trying out this control because I like the potential it has, however I'm struggling to get the items in my dropdown.
In my ViewModel constructor I have this :
LanguageList = new ObservableCollection<Language>(Static_Functions.GetLanguageList()); OnPropertyChanged(nameof(LanguageList));
if (Static_Functions.CurrentLocalSettings != null && !String.IsNullOrWhiteSpace(Static_Functions.CurrentLocalSettings.LanguageCode))
{
SelectedLanguage = LanguageList.Where(l => l.Code == Static_Functions.CurrentLocalSettings.LanguageCode).FirstOrDefault();
}
if (SelectedLanguage == null)
SelectedLanguage = LanguageList.Where(l => l.Code == "us").FirstOrDefault();
OnPropertyChanged(nameof(SelectedLanguage));
My Language class is very simple
public class Language
{
public String Code { get; set; }
public String Name { get; set; }
}
And this is my declaration :
<StackLayout VerticalOptions="Start" HorizontalOptions="Start" Padding="10" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4">
<Label Text="Language" Style="{StaticResource labelStyle}"/>
<combobox:SfComboBox x:Name="cboLanguage" ShowBorder="False" HeightRequest="40"
DataSource="{Binding LanguageList}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedLanguage,Mode=TwoWay}" TextColor="White"/>
</StackLayout>
Whatever I try, my combobox does not show any items in the list to select from.
I just wanted to use this control to have a Language Selector in my app.