This is a migrated thread and some comments may be shown as answers.

read the values after spinning the looping list.

1 Answer 46 Views
LoopingList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 28 Jul 2013, 03:33 PM
hi
sorry new to c# xaml, so this is probably simple.

Im using the radlooping list sample first look to create a slot machine like experience. but im only using 1 list instead of 3.
after spinning the list all I want to do is string whatever the value if the new image URI is. 
again probably simple, thanks for you time.
Jason

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 31 Jul 2013, 01:38 PM
Hi Jason,

Thank you for your question.

When the looping list from the slot machine experience example starts spinning its SelectedIndex changes to -1, when it stops, the SelectedIndex is changed to the index of the selected item. You can use the SelectedIndexChanged event to observe these changes. Once you have the selected index, you can use it to get the item from the LoopingListDataSource by using the method GetItemAt. Then you can easily obtain any information that you need from that item after you cast it to the correct type. Here's how and event handler could look to display the Uri of the selected picture in the first look example:

private void list1_SelectedIndexChanged(object sender, EventArgs e)
{
    int selectedIndex = this.list1.SelectedIndex;
    if (selectedIndex != -1)
    {
        PictureDataItem selectedItem = this.list1.DataSource.GetItemAt(selectedIndex) as PictureDataItem;
        RadMessageBox.ShowAsync("You selected " + selectedItem.Picture);
    }
}

I hope this information helps. Let us know if you need additional assistance.

Regards,
Todor
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
LoopingList
Asked by
Jason
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or