Welcome to the Xamarin.Forms feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Forms, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Suppose I have a ViewModel and class like this (get and set are omitted at ViewModel):
public class CodeItem{
public string Value { get; set;}
public string Name { get; set; }
}
public class ViewModel : INotifyPropertyChanged
{
public List<CodeItem> ChipItems;
public CodeItem Item;
}
And this XAML works fine :
<ContentPage ...>
<ContentPage.BindingContext>
<local:ViewModel />
</ContentPage.BindingContext>
<buttons:SfChipGroup Type="Choice"
ItemsSource="{Bindng ChipItems}"
DisplayMemberPath="Name"
SelectedItem="{Binding Item}" />
</ContentPage>
But this XAML does not work fine. Chip displays class name (like Namespace.CodeItem) instead of "Name" :
<ContentPage ... x:Name="Page">
<ContentPage.BindingContext>
<local:ViewModel />
</ContentPage.BindingContext>
<buttons:SfChipGroup Type="Choice"
ItemsSource="{Bindng BindingContext.ChipItems, Source={x:Reference Page}}"
DisplayMemberPath="Name"
SelectedItem="{Binding BindingContext.Item, Source={x:Reference Page}}" />
</ContentPage>
I want to put SfChipGroup in SfPopupLayout.
I write SfPopupLayout in ContentPage.Resources, And I want to use ViewModel set in ContentPage.BindingContext for ItemsSource of SfChipGroup.