Dear Telerik or anyone knowledgeable,
I am presently building my first real life application using RadControls for SL. So far I pretty much like it and controls from Telerik are really powerful. This particular application is essentially a video player built around RadMediaPlayer.
I have two external XML files. First one contains configuration information like width and height of video player. Here is how it looks like in present form.
<?xml version="1.0" encoding="utf-8" ?>
The second one contains data for media items in the following structure:
Now I have written a static class named “SichulaVideoPlayerConfig” that opens XML configuration file using WebClient and then parses it using LINQ to XML. This works fine on its own. The trouble is that when I call SichulaVideoPlayerConfig.LoadConfigFile during Application_Startup in app.xaml.cs, the data from XML configuration file are not yet there and the player UI initializes as empty.
It seems to me that the problem is related to the asynchronous nature of WebClient.OpenReadAsync method. I understand that it runs on different thread than UI. Because of that my UI initializes and yet data from XML file are still not available.
I kindly ask for help in how to overcome this unwanted situation. A working code example would be most welcome and I have already read much theory but to no avail.
Kindly please, please, help me.
http://sichula.temelios.sk/ (English website for friends – family photos, videos and newsletter archive)