Selected Index change while IsCyclical false
See original GitHub issueHello,
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:
- Created 5 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top 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 >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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ohhh) sorry, github issue for sure 😃
@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…)