Home
Search D&P Ireland Group Blogs
Bookmark on MSDN
Welcome to MSDN Blogs Sign in | Join | Help

Nip & Tuck for GUIs (2) : Windows Forms and a self-contained WPF user control

I figure the most logical follow-on from my last post is to show how simple it is to start using WPF within an existing Windows Forms application. I set myself the goal for this post of doing this with zero code behind whatsover to avoid clouding the issue. I had no choice but to incorporate Flickr into it, no self-respecting sample being flickr-less these days.

With that in mind, for my user control I tweaked a sample that ships with the really handy Kaxaml (below) tool, just adding a larger preview image on the right along with 2 sliders, one to rotate the previewed image and one to enlarge/shrink it. No code-behind needed in any of this, just data templates and data binding. Incredibly easy.

 

image

 

Next up I just added a WPF user control project to my VS solution:

 

image

 

Dropped an element host onto my existing Windows Form app's main form:

 

image

 

and set its contents to an instance of my user control.

 

image

 

And that's it!

 

image image

 

10 minutes! (I did some email as well).

Published Friday, November 21, 2008 4:40 PM by ronang
Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# infoblog » Nip & Tuck for GUIs (2) : Windows Forms and a self-contained WPF user control

# Nip & Tuck for GUIs (3) : manipulating a hosted WPF user control from a Windows Forms ap

In my last post in this series I showed how easy it is to host a WPF user control within a Windows Forms

Tuesday, December 02, 2008 12:37 PM by Ronan Geraghty's Blog

# Nip & Tuck for GUIs (3) : manipulating a hosted WPF user control from a Windows Forms ap

In my last post in this series I showed how easy it is to host a WPF user control within a Windows Forms

Tuesday, December 02, 2008 12:37 PM by Microsoft Ireland Blog

# Recap: User Experience Day

Thanks to everyone who attended our User Experience day here in Sandyford last week.  Guest speaker

Thursday, December 18, 2008 6:21 AM by Microsoft Ireland Blog

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker