read the values after spinning the looping list.

2 posts, 0 answers
  1. Jason
    Jason avatar
    3 posts
    Member since:
    Sep 2012

    Posted 28 Jul 2013 Link to this post

    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
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 31 Jul 2013 Link to this post

    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 >>
  3. DevCraft banner
Back to Top