Hello,
Welcome to our Microsoft Q&A platform!
I see that the collection is filling (54 elements)
Hi @Dmitry Barabash , do you mean you have got the list value for MakeUpList ,right?
Then have you set the BindingContext
for your page(e.g. YourPage
)? For example:
public YourPage()
{
InitializeComponent();
BindingContext = new MainPageViewModel();
}
Update:
I found you used Prism.Mvvm
in your app. In this condition, you don't need to set the BindingContext
explicitly, because your app have done this when your app
RegisterForNavigation
for your page.
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<SignInPage, SignInPageViewModel>();
containerRegistry.RegisterForNavigation<SignUpPage, SignUpPageViewModel>();
containerRegistry.RegisterForNavigation<MainPage, MainPageViewModel>();
// other code
}
And in your xaml
, you defined an Image
with height 250
, and you don't set property HasUnevenRows="True"
for your listview , just as follows:
<Image
WidthRequest="300"
HeightRequest="250"/>
So, your listview item will not show the other labels.
You can try to set the property HasUnevenRows="True"
for your listview. And remove the Image
if you don't need it.
<ListView
x:Name="CosmeticList"
ItemsSource="{Binding MakeUpList }" HasUnevenRows="True">
<ListView.ItemTemplate >
<DataTemplate>
<ViewCell >
<ViewCell.View>
<StackLayout>
<!--<Image
WidthRequest="300"
HeightRequest="250"/>-->
<StackLayout >
<Label
Text="{Binding Brand}"
FontAttributes="Bold"
/>
<Label
Text="{Binding Category}"
/>
<Label
Text="{Binding Name}"
/>
<Label
Text="{Binding Price}"
FontAttributes="Bold"
/>
</StackLayout>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.