Click here to Skip to main content
15,867,771 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys. I'm just trying to create my custom ListView. Beacouse I want make it look nice I'm using DataTemplate. The thing is that I want to have hardcoded dummy data just for design time(no data binding at the moment).
For some reason it's not working despite the fact is very simple:)
Please have a look:
XML
        <Grid x:Name="CategoryPageGrid">
    <ListView>
        <ListView.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="50"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Image Source="ms-appx:///Assets/Pictures/Frozen.jpg"           Stretch="UniformToFill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                    <TextBlock Grid.Column="1" Text="Cartoons"/>
                </Grid>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</Grid>

Even version with only TextBlock is in DataTemplate doesn't display antying at the point when I use DataTemplate. What is it I don't know? Please.
Posted
Updated 19-Jul-15 8:46am
v2
Comments
[no name] 19-Jul-15 15:32pm    
You are not adding anything to the listview to show.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900