Esri / arcgis-maps-sdk-dotnet-toolkit

Toolkit for ArcGIS Maps SDK for .NET
https://esri.github.io/arcgis-maps-sdk-dotnet-toolkit/
Apache License 2.0
217 stars 121 forks source link

Setting BookmarksView `DataTemplate` doesn't overwrite default DataTemplate #562

Closed prabhav-mehra closed 8 months ago

prabhav-mehra commented 8 months ago

Setting ItemTemplate with a custom DataTemplate doesn't work unless it is a TextCell.

For example:

<runtimetoolkit:BookmarksView Grid.Row="1" GeoView="{Binding GeoView}">
    <runtimetoolkit:BookmarksView.ItemTemplate>
        <DataTemplate x:DataType="runtime:Bookmark">
            <HorizontalStackLayout Padding="4,16" Spacing="16">
                <Label Text="{Binding Name}" />
            </HorizontalStackLayout>
        </DataTemplate>
    </runtimetoolkit:BookmarksView.ItemTemplate>
</runtimetoolkit:BookmarksView>

This doesn't work and doesn't show the name.

It works if I set it as TextCell tho.

Main reason why I want this is because I want to add more style like an image or something and then the name

prabhav-mehra commented 8 months ago

I got it working. Was missing a "ViewCell" with the template

prabhav-mehra commented 8 months ago

Weird that the TextCell still worked without it