how i used createFromXaml method parametre as xaml file


I know that we can create a xaml controls dynamically by using CreateFromXaml method.

But

The CreateFromXaml method takes a parameter as xaml control syntax but is it possible to send parameter as a xaml file name.

or if any other way how i cretae dynamic controls by using xaml file .

Here i will Explain my problem in detail:

I have one Main.xaml file in this file i creted a one canvas in which i want to show different xaml files and two buttons say first and second .

When i clicked on first button then myfirst.xaml file is loaded in canvas ,and when i clicked on second button thensecond.xamlis loaded in canvas

If any solution for this please let me know.

[2461 byte] By [DINESHCHAUDHARI] at [2008-2-20]
# 1

Third reply is a charm. :)

You don't pass that method a file name, you have to use the downloader object. I created a simple example of this here:

http://blogs.sqlxml.org/wpfe/downloadxaml/

Xaml: http://blogs.sqlxml.org/wpfe/downloadxaml/download.xaml

JS: http://blogs.sqlxml.org/wpfe/downloadxaml/eventhandlers.js

Take a look at that. It uses the downloader object to load the techy.xaml file which is part of the WPFEPad example (which also uses the downloader object). I didn't add the progress bar because I didn't have time.

If you want I'll try to write up another sample that wraps all this so that you can have a call that looks like:

var xamlFrag = myObject.createXamlFromFile([filename])

That should be pretty easy to do,but you don't need it since the above example works.

BryantLikes at 2007-9-5 > top of Msdn Tech,Silverlight (formerly WPF/E),Silverlight (formerly WPF/E) Designer Issues...