<CarouselView> <CarouselView.ItemsSource> <x:Array Type="{x:Type ContentView}"> <ContentView> <StackLayout> <controls:BindableMap ItemsSource="{Binding Pins}" MapSpan="{Binding PlaceMapSpan}" HasScrollEnabled="False" HeightRequest="230"> <controls:BindableMap.ItemTemplate> <DataTemplate> <maps:Pin Position="{Binding Position}" Address="{Binding Address}" Label="{Binding Label}" /> </DataTemplate> </controls:BindableMap.ItemTemplate> <controls:BindableMap.Behaviors> <b:EventToCommandBehavior EventName="MapClicked" Command="{Binding GoToSearchMapCommand}"/> </controls:BindableMap.Behaviors> </controls:BindableMap> </StackLayout> </ContentView> </x:Array> </CarouselView.ItemsSource> <CarouselView.ItemTemplate> <DataTemplate> <ContentView Content="{Binding .}" /> </DataTemplate> </CarouselView.ItemTemplate> </CarouselView>
I can't get it to compile:
XamlC error: Value cannot be null.
XamlC error: Parameter name: fieldType
if i remove this if it works:
<controls:BindableMap.ItemTemplate> <DataTemplate> <maps:Pin Position="{Binding Position}" Address="{Binding Address}" Label="{Binding Label}" /> </DataTemplate> </controls:BindableMap.ItemTemplate>
if I take the map out of the carousel everything works fine
and I think the bindings are wrong .. how can I do it?