Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - Xamlified

WPF, Silverlight and Xaml

Syndication

Sponsors





  • advertise here
WPF Master Pages

Got a pointer to Brad Cunningham's writeup on WPF "Master Page" like functionality from Adam Calderon.  This is a popular ASP.NET feature that many like to enable in WPF.  How do you like Brad's approach...please give him comments...

Any other posts on this topic worthy of pointing to?  Please leave in comments...

Published Thursday, February 21, 2008 6:28 AM by Rob_Relyea
Filed under:

Comments

# re: WPF Master Pages@ Friday, February 22, 2008 5:33 AM

The concept of MasterPages is a great one, which could be useful for WPF applications for all the reasons that their a great idea in ASP.NET applications. However, Brad's DataTemplate approach has the drawback of making it harder to manipulate controls in the content areas from the code-behind of the parent Window.

Karin Huber's approach (www.codeproject.com/.../WPFMasterPageControl.aspx), which exposes the content zones as Objects, enables you to do this._myControl.Whatever in the code-behind (rightly or wrongly. I was surprised it worked :o)), and also enables you to handle events in the code-behind, too.

The major drawback (for me at least) with either approach, is that you cannot do element binding between content zones. For example, if you had a Details zone which was intended to display some details for the selected item in the main content zone (kinda master-detail), then you cannot do a "{Binding ElementName=masterControl, Path=SelectedItem}" in the details zone because the binding engine is unable to resolve the element.

If there was a MasterPage solution that simply provided a layout framework, but you could access elements and handle events in the code-behind AND binding between elements in different content zones, then I'd be happy :o)

by Derek Lakin

# Daily Bits - February 22, 2008 | Alvin Ashcraft's Daily Geek Bits@ Friday, February 22, 2008 9:13 AM

Pingback from  Daily Bits - February 22, 2008 | Alvin Ashcraft's Daily Geek Bits

# http://blogs.windowsclient.net/rob_relyea/archive/2008/02/21/wpf-master-pages.aspx@ Friday, March 28, 2008 5:53 AM

Pingback from  blogs.windowsclient.net/.../wpf-master-pages.aspx

# WPF Master Pages (kinda sorta) | Blake on Stuff@ Tuesday, July 01, 2008 4:13 PM

Pingback from  WPF Master Pages (kinda sorta) | Blake on Stuff

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Page view counter