I was wondering if it was possible to bind some filenames in a given directory of the ClientBin folder to a ComboBox.
I'm working on this application that has a video Tutorials section. I've got a comobox that lets the user select which tutorial video they wish to see.
Right now not all the videos are completed (it's a bit time consuming) and I would like to deploy the application. It would be great if I could work on the videos later on and just upload them to my ClientBin/Videos directory and have my Silverlight App pick them up automatically without me having to go into the XAML and add the new videos to the ComboBox.
Anyone know if this is feasible?
You bet. You'll need directory browsing turned on in IIS, though. Once you've done that,
Use the WebClient's DownloadString functionality and issue a request to /Videos.
Parse the result, and you have a list of files
Related
I am building a WPF application and while im not a newbie, I am not an expert either. My WPF application streams images from a website when connected to the internet. If a user selects the image, I would like to save it to the hard drive. The user would then reuse the image later on when loading the application if it isn't connected to the internet. I will be querying a folder to see if its there in a saved location as well.
I question where the best location is to save it? I think it might be document settings and then application data, but Im not too sure.
Thank you in advance.
For behind the scenes data i usually use the local app data, you can get the directory like this (in case you did not know):
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
I create some root folder there for the application to store the data in, cleanup can then just be done by getting rid of the whole folder.
I am developing a Silverlight 4 application which displays items in a carousel control. The items are parsed form an XML file and then loaded as an image which can be double clicked to open a website, file, image etc.
I am already running in higher privileges mode (out of browser) to access the Xml file which sits in a subfolder of the application.
I can load the images fine when they are added to the project as they are included as resources. However, I need to be able to load images which aren't individually added to the project. Instead, I would like to add all images in a particular folder as resources.
Is this possible?
Thanks in advance
From Advanced Silverlight Out of Browser- Introduction
When running in a trusted environment,
you can access only files in user
folders, specifically the MyDocuments,
MyMusic, MyPictures, and MyVideos
folders
So, if you want to access folders other than this, you would probably need to run some sort of service, which has the proper rights. What kind of service depends on where this app is running. Could be a WCF service, or a simple WebService, if you can run a webserver on the machine. Otherwise, you'd need a windows service of some sort.
I want to store a image in to a folder which I have selected from a list in silverlight
In Silverlight you have only limited access to the file system for security reason.
So everything what you want to save would end up in IsolatedStorage...
Check out this Quickstart Video and let me know if it helps
http://www.silverlight.net/learn/quickstarts/isolatedstorage/
In Silverlight, You have limited access to the client file system. If you are running Out Of Browser application with elevated permission, you can access User folders (My documents in windows).
But you can try some workarounds like using JavaScript u can try to download file. For reference Download a picture OnClick
I'm working on a Silverlight PivotViewer app and using the Excel Pivot Collection tool to generate my image files. Everything works perfectly except some images are not being published by the tool. As a result, when the app launches, everything looks great except there are blank spaces where the unpublished images are supposed to be. All of their data/facets are available if I click on a "blank" image.
When I dig a little deeper and look at the files that are generated, the missing images are not there. What's more interesting, if I look a the cxml file. The images information is all there only the missing images are missing their "img" attribute. For some reason, the Pivot Collection tool recognizes that there are images but chooses not to publish them. I've tried re-creating the images as both PNGs and JPGs to no success.
Does anyone know why this is happening and how I can fix it?
Delete the entire collection_files folder and the cxml file. Republish the images and then add the newly published collection_files folder and cxml file to your project.
I am implementing a silverlight application in that I need to read a folder which has images in it. That folder is in my local machine. I want to access that folder to my silverlight code behind.After that i want to load all those images into Listbox control( or any other control to display images one by one. ) to display them one by one. Here I have next and previous buttons to move images.
You can access local files in Silverlight 4 if running as a trusted application, but not in Silverlight 3 without user interaction.
Note also "you can access only files in user folders, specifically the MyDocuments, MyMusic, MyPictures, and MyVideos folders. "
Nope you can't do this, you would need SL4 OOB with Elevated Trust to be able to this.