Michael Schwarz - AjaxPro

Hi,

is it possible to import WPF/E XAML files in the Expression Designer I didn't find any way to do this.

Michael




Re: Silverlight (formerly WPF/E) Designer Issues Import WPF/E XAML files

Bryant Likes

I can't figure out how to do it. If you want to see something really strange, uncheck the binary format for file type in the preferences. I was thinking you could hack the xaml in the design file, but the design file doesn't appear to use Xaml at all!

Strange stuff in there...

I'd try the expression forums since they are the ones who own this.





Re: Silverlight (formerly WPF/E) Designer Issues Import WPF/E XAML files

Michael Schwarz - MVP

Ok, if you got a answer please post a short notice here, thanks!

Michael






Re: Silverlight (formerly WPF/E) Designer Issues Import WPF/E XAML files

nooneimportant

not in beta 1, you can't



Re: Silverlight (formerly WPF/E) Designer Issues Import WPF/E XAML files

Kevgor

Here's what I am doing to overcome this.

A WPF/E XAML is is of the form:

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml">
... Stuff inside ...
</Canvas>

Expression Blend won't accept a Canvas as a root object (seems to only accept Page or Window).

So I wrap my WPF/E file in a <Page>

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas>
.. stuff inside...
</Canvas>
</Page>

The red is the original WPF/E content. This is now editable in Blend. Be careful not to add constructs that WPF/E doesn't support. you are on your own there.

When you are finished, strip off the <Page> an add the namespace decl's back to the Canvas object.

Note you can use the full WPF namespace (2006) as opposed to the 2007 namespace (see my post in the developer section).

I wrote a small C# console program to do this automatically (I'll post if you like).

You can continually edit this in Blend - edit, save, deconvert, test, edit, save, deconvert, test etc as much as you like.

This also works for xamlpad, kaxaml, etc.

Kevgor