Cardview: IndicatorsControl overflow

Created on 14 Aug 2018  路  2Comments  路  Source: AndreiMisiukevich/CardView

First, thanks for the tool!

I want to put the Indicators Control between the cards and the colored button group, but when I try to TranslateY it is being cut by the end of the CarouselView.

screenshot_20180814-172527

I tried making the CarouselView bigger and the Card smaller, so there would be a spare space to the Controls, but this way I was not able to set the sizes according to the screen size (I use Grids to achieve it right now).

Any help?

Thanks!

question resolved

Most helpful comment

I too needed to control the location of the IndicatorsControl. I defined an IndicatorsControl outside of the Carousel/Cardview which allowed me to move it wherever I needed to in a layout. Then the IndicatorsControl properties need to be bound to the Carousel/CardView.

    <panIndicators:IndicatorsControl 
                UseParentAsBindingContext="False"
                HorizontalOptions="Center"
                BindingContext="{x:Reference PanCardView}"
                Margin="5"
                SelectedIndex="{Binding SelectedIndex}"
                ItemsCount="{Binding ItemsCount}"
                IndicatorsContexts="{Binding ItemsSource}"
                IsUserInteractionRunning="{Binding IsUserInteractionRunning}"
                IsAutoInteractionRunning="{Binding IsAutoInteractionRunning}"/>

Its important to assign false to the UseParentAsBindingContext property. The current implementation of the control assumes you're using it as a child of Carousel/Cardview and then sets the BindingContext to the parent.

All 2 comments

I too needed to control the location of the IndicatorsControl. I defined an IndicatorsControl outside of the Carousel/Cardview which allowed me to move it wherever I needed to in a layout. Then the IndicatorsControl properties need to be bound to the Carousel/CardView.

    <panIndicators:IndicatorsControl 
                UseParentAsBindingContext="False"
                HorizontalOptions="Center"
                BindingContext="{x:Reference PanCardView}"
                Margin="5"
                SelectedIndex="{Binding SelectedIndex}"
                ItemsCount="{Binding ItemsCount}"
                IndicatorsContexts="{Binding ItemsSource}"
                IsUserInteractionRunning="{Binding IsUserInteractionRunning}"
                IsAutoInteractionRunning="{Binding IsAutoInteractionRunning}"/>

Its important to assign false to the UseParentAsBindingContext property. The current implementation of the control assumes you're using it as a child of Carousel/Cardview and then sets the BindingContext to the parent.

Hi all
@ronaldosena yes, as @eamreyes said, it's possible.

But as I remember, you needn't have to bind every property, next lines would be enough:

<StackLayout>
    <cards:CarouselView x:Name="Carousel" />
    <panIndicators:IndicatorsControl 
                UseParentAsBindingContext="False"
                BindingContext="{x:Reference PanCardView}" />
</StackLayout>

Because all bindings are defined at constructor. Indeed, as @eamreyes noted, you should set UseParentAsBindingContext to False and bind indicators bindingContext to your Carousel/Cards control.
__
Btw, if you like this plugin, you may set star on this repo =)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stealthcold picture stealthcold  路  6Comments

baranpirincal picture baranpirincal  路  4Comments

jungjanos picture jungjanos  路  8Comments

JTOne123 picture JTOne123  路  5Comments

LuisM000 picture LuisM000  路  3Comments