Importing/Using XAML ?

Oct 20, 2011 at 3:33 AM

Hello everyone,

I am new to ShowUI and I am really excited about the getting started with it and putting it to use.

I have a few WPF UI's that have already been created using Expression Blend in XAML format. While I can definitely see the value in eventually converting these to ShowUI format it has become apparent to me that this will take a little while. Is there a way I can use these with ShowUI in the meantime?

I have spent the better part of the entire day trying to do this but I don't seem to be getting anywhere. I found a few older posts and tutorials (like this one http://huddledmasses.org/creating-wpf-uis-for-powershell-with-powerboots-and-visual-studio-wpf-designer/) that touch on this but I've not been able to get it to work.

I have also tried "Show-Window -Xaml" but cant seem to get the syntax correct.

Any help/advice/documentation will be greatly appreciated.

Thanks,

Chris

Coordinator
Oct 20, 2011 at 3:58 AM

I honestly don't think this is working right in the current release. We had it on our to-do list and it's still there :-/

Oct 20, 2011 at 4:11 AM

Thanks for the quick reply!

I guess I'll have to learn something new then.. ;)

Cheers,

Oct 28, 2011 at 5:54 AM

Hi,

this worked for me.

[xml]$xaml = Get-Content $xamlFile
$reader = New-Object System.Xml.XmlNodeReader $xaml
$mainWindow = [Windows.Markup.XamlReader]::Load($reader)
Show-UI -Xaml $xaml

or you can use this too:
Show-UI $mainWindow

Regards Peter