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

Databinding Coverflow

2 Answers 117 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
IT Development
Top achievements
Rank 1
IT Development asked on 07 Apr 2009, 12:21 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 07 Apr 2009, 01:29 PM
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
0
IT Development
Top achievements
Rank 1
answered on 07 Apr 2009, 02:42 PM
Thanks it worked!

Greetings Tim
Tags
CoverFlow
Asked by
IT Development
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
IT Development
Top achievements
Rank 1
Share this question
or