How To Read XAML content file from an XBAP application

giovedì 13 novembre 2008 - 14.51

sammy1984 Profilo | Newbie

Hi all,
I'm dealing with this problem.

I have an XBAP application that receive some parameters in the QueryString.
With those parameters I can choice the right XAML fragment to display.

Now, my goal is to dinamically load this content via http.
So, for my PoC, I've decided to deploy a loose XAML fragment and to store it in a subfolder of the project.

The application, when needed, executes these instructions

1 Uri u = new Uri("pack://siteoforigin:,,,/resources/fragment.xaml", UriKind.Absolute);
2 StreamResourceInfo info = Application.GetRemoteStream(u);
3 if(info != null)
4 {
5 sw.Write(info.Stream);
6 sw.Flush();
7 }
8 content = XamlReader.Load(info.Stream);

The problem is that info is always null. Why??

The same approach works fine when I run the application within VS


Someone can help?

TIA, Giac.
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5