Databinding Coverflow

3 posts, 1 answers
  1. IT Development
    IT Development avatar
    25 posts
    Member since:
    Mar 2009

    Posted 07 Apr 2009 Link to this post

    Hello,

    Hope someone can help me with this problem .

    trying to databind the coverflow.
    The images just won't appear.
    I’m relative new to sllverlight to maybe  just forgetting something

    the xml document loads fine.


    The code:

       void XMLFileLoaded(object sender, DownloadStringCompletedEventArgs e)
            {

                if (e.Error == null)
                {
                    XDocument xdoc = XDocument.Parse(e.Result);
                    var ProductenItems = from b in xdoc.Descendants()
                                    where b.Name == "Product"
                                    select b;
                     
                    List<Product> Producten = new List<Product>();
                    foreach (XElement ProductItem in ProductenItems)
                    {
                         Product P = new Product();
                         P.Afbeelding = ProductItem.Element("Afbeelding").Value;
                         Producten.Add(P);
                    }
                    this.RadCoverFlowProducten.DataContext = Producten;
                    this.RadCoverFlowProducten.DisplayMemberPath = "Afbeelding";
                }

    the xaml:

      <Grid x:Name="LayoutRoot"  Background="White">
            <StackPanel>
             <telerikNavigation:RadCoverFlow x:Name="RadCoverFlowProducten"  >
                </telerikNavigation:RadCoverFlow>
              
            </StackPanel>
            </Grid>


    Greetings,

     Tim van Rooijen
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 07 Apr 2009 Link to this post

    Hello Tim,

    You may want to set the ItemsSource of the coverflow control to be Producten, not the DataContext. If you set the DataContext, you need to set a binding to the ItemsSource to make it get the items from the Producten list.
    Hope this helps.

    Kind regards,
    Miroslav Nedyalkov
  3. DevCraft banner
  4. IT Development
    IT Development avatar
    25 posts
    Member since:
    Mar 2009

    Posted 07 Apr 2009 Link to this post

    Thanks it worked!

    Greetings Tim
Back to Top