我的疑問是,有什麼辦法可以在循環選擇器到達列表末尾時停止循環。假設列表有10個項目可能是1,2,3,4 ... 10,所以當滾動一次後,你到達列表的末尾,即10,那麼它不應該讓你循環..它應該改變方向循環選擇器的流程。是否有可能..停止WP7循環選擇器中的選擇器列表末尾處的循環
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] };
相應的XAML:?(本人用的是水平的循環選擇)
<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>
你能否更新鏈接?這正是我正在尋找的!謝謝! – Quincy 2013-04-24 02:02:56
它完成了!請檢查更新後的答案 – Apoorva 2013-05-07 04:40:34