My doubt is, is there any way to stop the looping selector from looping when it reaches the end of the list. Suppose the List has 10 items may be 1,2,3,4…10, so when after scrolling once u reach the end of the list i.e, 10 then it shouldn’t let u loop.. it should change the direction of flow of the looping selector. Is it possible?..
public void DisplayCatalog(string[] ServiceDisplayName, string[] WheelDisplayName, BitmapImage[] ServiceIcons, WidgetBean[] ServiceBeanList, WidgetBean[] WheelBeanList)
{
updateUI();
DisplayNames.Clear();
int idIndex = 0;
for (int j = 0; j < WheelDisplayName.Length; j++)
{
string disp1 = WheelDisplayName[j];
if (!Utils.isNullString(disp1))
{
DisplayNames.Add(new ItemList() { WidgetName = disp1, ID = (idIndex + 1) });
idIndex += 1;
}
}
this.selectorLeft.DataSource = new ListLoopingDataSource<ItemList>() { Items = DisplayNames, selectedItem = DisplayNames[Index] };
corresponding xaml:(am using a horizontal looping selector)
<loop:LoopingSelector
x:Name="selectorLeft" VerticalAlignment="Center" ItemSize="200,68" Height="63"
d:LayoutOverrides="Height" Width="450">
<loop:LoopingSelector.ItemTemplate>
<DataTemplate>
<StackPanel Background="#FF48BA1C" Height="75">
<TextBlock Margin="2,12,2,2" Width="Auto" TextTrimming="WordEllipsis" TextAlignment="Center" x:Name="scrollingTextBlock"
Text="{Binding WidgetName}" FontSize="26" Foreground="White" VerticalAlignment="Bottom" HorizontalAlignment="Stretch"/>
</StackPanel>
</DataTemplate>
</loop:LoopingSelector.ItemTemplate>
</loop:LoopingSelector>
I was struggling to find a solution for this problem since a year. Today I found this. I had to just make one change. and that is…
The looping selector will loop only if the total number of items are greater than WheelDisplayName+1 if not it will stop looping at the end of the last item.