WPF, Expression Blend and C++
-
I just went to the Microsoft "Heroes Happen Here" launch event and I'm really excited about WPF. However, all of my work is currently in C++ and at least for the next year or so will likely stay there. I've been looking at some of the tutorials about hosting WPF content in a Win32 app, and this seems like kind of a no brainer, but the tutorials never get past the "here's how you do it procedurally". I would very much like to be able to author forms and dialogs in Expression Blend and then load them from my C++ Win32 app. Does anyone have any good tutorials, or have straight forward code snip-its for doing this? Is this even a reasonable thing to try to do? Thanks in advance... Adam
-
I just went to the Microsoft "Heroes Happen Here" launch event and I'm really excited about WPF. However, all of my work is currently in C++ and at least for the next year or so will likely stay there. I've been looking at some of the tutorials about hosting WPF content in a Win32 app, and this seems like kind of a no brainer, but the tutorials never get past the "here's how you do it procedurally". I would very much like to be able to author forms and dialogs in Expression Blend and then load them from my C++ Win32 app. Does anyone have any good tutorials, or have straight forward code snip-its for doing this? Is this even a reasonable thing to try to do? Thanks in advance... Adam
Have a look into ElementHost ... It allows you to host WPF controls in WindowsForms. Not done it myself but there is a chapter in the Adam Nathan WPF Unleashed book that talks about it. http://blog.voidnish.com/?p=119[^] http://msdn2.microsoft.com/en-us/library/system.windows.forms.integration.elementhost.aspx[^]
Jammer Going where everyone here has gone before! :) My Blog
-
I just went to the Microsoft "Heroes Happen Here" launch event and I'm really excited about WPF. However, all of my work is currently in C++ and at least for the next year or so will likely stay there. I've been looking at some of the tutorials about hosting WPF content in a Win32 app, and this seems like kind of a no brainer, but the tutorials never get past the "here's how you do it procedurally". I would very much like to be able to author forms and dialogs in Expression Blend and then load them from my C++ Win32 app. Does anyone have any good tutorials, or have straight forward code snip-its for doing this? Is this even a reasonable thing to try to do? Thanks in advance... Adam
Basically your going to have to make do with intermediate C# / VB / Blend projects. The example looks like it has to be a loose XAML file as well (no class definition using an x:Class="" declaration. In Blend you end up with a partial class code-behind which I'm almost sure would blow up in your scenario.
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Main="clr-namespace:WPFWindows"
xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="WPFWindows.Navigator3"
Width="Auto" Height="Auto">Jammer Going where everyone here has gone before! :) My Blog