Friends who are familiar with Silverlight should know that Silverlight from version 1.0 to today's version 4.0 is becoming more functional, and from the following figure we can see that a transformation of the Silverlight application model From JavaScript to now trusted applications, we have witnessed the ups and downs of the evolution process, although there are still deficiencies, but with more developer support and help, Silverlight will certainly be better and stronger.
In the previous few, we introduced the Silverlight out of browser application Development Foundation with a simple example. To prepare for the next example, in this article, we will add some Silverlight out of browser application development knowledge points,
1. Review Silverlight out of browser access to local directory APIs;
2. Learn Silverlight out of browser application debug debug;
3. Learn the message Notification window API for Silverlight out of browser;
Review Silverlight out of browser access to local directory APIs, remember in the previous article we have described that Silverlight provides off-the-shelf APIs that allow applications to access my in OOB mode ... Series directory, API invocation method is very simple, and OOB mode file access, application can support System.IO reference space in the action class, such as file class, Directory class, Environment class, and so on.
1 private void AddMusicToList()
2 {
3 var path = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);
4 lsMyMusics.Items.Clear();
5 DirectoryInfo myDirectory = new DirectoryInfo (path);
6 foreach (FileInfo file in myDirectory.EnumerateFiles())
7 {
8 lsMyMusics.Items.Add(file);
9 }
10 }