question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Selected Index change while IsCyclical false

See original GitHub issue

Hello,

I seem to be having trouble with changing SelectedIndex while IsCyclical is false. I tried with a very simple example of CoverFlowView, put in 3 squares with colors, swiped to the most right and then clicked a button which changes the SelectedIndex to 0.

this is the xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:SnirMobileTest"
             xmlns:panCardView="clr-namespace:PanCardView;assembly=PanCardView"
             x:Class="SnirMobileTest.MainPage">

  <StackLayout>
    <panCardView:CoverFlowView x:Name="MainCarousel"
                               PositionShiftValue="60"
                               IsCyclical="False">
      <panCardView:CoverFlowView.ItemTemplate>
        <DataTemplate>
          <ContentView Padding="40">
            <Frame 
              VerticalOptions="Center"
              HorizontalOptions="Fill"
              HeightRequest="290"
              Padding="0" 
              HasShadow="false"
              IsClippedToBounds="true"
              CornerRadius="10"
              BackgroundColor="{Binding Color}">

            </Frame>
          </ContentView>
        </DataTemplate>
      </panCardView:CoverFlowView.ItemTemplate>
    </panCardView:CoverFlowView>
    <Button x:Name="LeftButton" Text="Left" />
    <Button x:Name="RightButton" Text="Right" />
  </StackLayout>

</ContentPage>

this is my cs:

public MainPage()
    {
      InitializeComponent();
      MainCarousel.ItemsSource = new List<TestObject>()
        {
          new TestObject
          {
            Color = Color.Red
          },
          new TestObject
          {
            Color = Color.Beige
          },
          new TestObject
          {
            Color = Color.Blue
          }
        };

      MainCarousel.ItemSwiped += OnMainCarouselOnItemSwiped;
      LeftButton.Clicked += OnLeftButtonOnClicked;
      RightButton.Clicked += OnRightButtonOnClicked;
    }


private void OnRightButtonOnClicked(object sender, EventArgs e)
    {
      MainCarousel.SelectedIndex = 0;
    }

    private void OnLeftButtonOnClicked(object sender, EventArgs e)
    {
      MainCarousel.SelectedIndex = 2;
    }

thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreiMisiukevichcommented, Mar 4, 2019

@AndreiMisiukevich Sure! Just one thing… I’m not familiar with jira… I shouldn’t add it as a regular github-issue, or? (I’m pretty new to github as well…)

ohhh) sorry, github issue for sure 😃

1reaction
Brostencommented, Mar 4, 2019

@AndreiMisiukevich Sure! Just one thing… I’m not familiar with jira… I shouldn’t add it as a regular github-issue, or? (I’m pretty new to github as well…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - How to return to the previously selected index on ...
Within your SelectedIndexChanged event, check the condition from your Error Provider. If it has an error, return the Item that is saved to...
Read more >
ComboBox.SelectedIndexChanged Event
Occurs when the SelectedIndex property has changed.
Read more >
LIBR-901 Flashcards
True or False : As the research process is cyclical in nature, it is OK to step back and adjust your approach. If...
Read more >
Loosing focus in RadGrid combo selected index change.
I want to change the focus to either the same combo or next control in the grid. How ever as the page refreshes...
Read more >
Chapter 9 - Business Cycles, Unemployment, Inflation
Unemployment, inflation and economic growth tend to change cyclically over time. The four phases of the business cycle: 1. A peak is when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found