Skip to main content

Microsoft Silverlight

Answered Question Accessing .xaml files from server and displaying hem in a user controlRSS Feed

(0)

vijayvvk
vijayvvk

Member

Member

0 points

5 Posts

Accessing .xaml files from server and displaying hem in a user control

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 nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Answered Question

Re: Accessing .xaml files from server and displaying hem in a user control

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

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

nirav_2052003
nirav_20...

Member

Member

274 points

105 Posts

Re: Accessing .xaml files from server and displaying hem in a user control

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.

BrianGenisio
BrianGen...

Member

Member

26 points

23 Posts

Answered Question

Re: Accessing .xaml files from server and displaying hem in a user control

 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; 
 It is that easy.  Really.  I was shocked when I realized how easy it was to load templates from the server.

vijayvvk
vijayvvk

Member

Member

0 points

5 Posts

Re: Re: Accessing .xaml files from server and displaying hem in a user control

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.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities