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

Defining item source on page load not working.

1 Answer 59 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Saad
Top achievements
Rank 1
Saad asked on 17 Dec 2008, 03:33 PM
I have few images at path "C:\Images\", and m loading my images at Page_Load event of silverlight page. But its not working....please help!
Here`s my code:

ObservableCollection<string> imagesCollection = new ObservableCollection<string>();
string[] arr = Directory.GetFiles(@"C:\Images\");
for (int a = 0; a < arr.Length; a++ )
{
    imagesCollection.Add(arr[a]);
}                
CoverFlow.DataContext = imagesCollection;

Everything is fine with the code but still not getting any positive signs....please help me!

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 19 Dec 2008, 12:03 PM
Hi saadi,

The problem is that the Silverlight application cannot get the list of files on C:\Images\, because its working in a sandbox and doesn't have permission to read the local file system. You should create a WebSite and make it give you the images. I'm attaching an example how to achieve this.
Hope that helps.

All the best,
Miroslav Nedyalkov
Tags
CoverFlow
Asked by
Saad
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or