Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

CarouselView with contentView

$
0
0
       <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?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>