Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Accessing .xaml files from server and displaying hem in a user control
4 replies. Latest Post by vijayvvk on July 9, 2009.
(0)
vijayvvk
Member
0 points
5 Posts
07-01-2009 1:50 AM |
Hi
Is it possible to download and display dynamically .xaml files present in the server to a silverlight App.
I Just want to download or at least read the contents in xaml file present in the server, so that i can load them using xamlreader.load method and display the same as a UI Element inside my User control.
Can anyone help me in this regard.
Thank you,
Regards,
Vijay.
jay nana...
Contributor
3388 points
624 Posts
07-01-2009 3:05 AM |
Do check this link:
http://blogs.msdn.com/saurabhd/archive/2008/11/25/dynamic-loading-of-xaml-in-silverlight-interesting-possibilities-for-line-of-business-applications.aspx
nirav_20...
274 points
105 Posts
07-02-2009 3:00 AM |
Hi,
You can download the .xaml files from the server using WebClient. After successful download of the xaml file at the client side, you can convert the filestream to xaml string using string builder and then load that xaml in your user control.
BrianGen...
26 points
23 Posts
07-02-2009 11:09 AM |
You bet! The beauty is that it is REALLY easy...
Start with the shell that you want to display the XAML inside of:
<Border x:Name="DynamicHolder"> <Grid x:Name="TemporaryPlaceholder" Width="640" Height="900" /> </Border>
Then, when you have the XAML from the server, in string form (dynamicXaml), Just assign it as the content:
DynamicHolder.Child = System.Windows.Markup.XamlReader.Load(dynamicXaml) as UserControl;
07-09-2009 5:51 AM |
Is it possible to download a .xap file and read the contents.
Actually i am planning to move all the xaml files to a .xap and make them to download and use them on client.