Welcome to WindowsClient.net | Sign in | Join

Rob Relyea - Xamlified

WPF, Silverlight and Xaml

Syndication

Sponsors





  • advertise here
Rudi Grobler: Keeping track of open windows in WPF via an Attached Property

Rudi and his Attached Property

Rudi considered the following options:

  1. binding to a collection, Application.Windows (but it was not an ObservableCollection)
  2. building a special subclass of Window, but that requires people to use a different item template in VS to create new windows.
  3. finally, attached properties...which allow decorating a normal WPF window to make it work...

Check out the cool feature he was trying to implement that Lawson Smart Client had done...and how he did it: http://dotnet.org.za/rudi/archive/2008/03/27/keeping-track-of-open-windows-in-wpf.aspx 

John's Favorite Feature?

In a meeting this week, John Gossman, an Architect for Blend v1 and now WPF/Silverlight, had said that Attached Properties are one of his favorite features in WPF. (I love working with John because his experience building Blend brings great experience to the table.  I know a ton about WPF, having lived it since 2001, but working inside WPF vs working with WPF give you different sets of knowledge.)

Attached or Attachable

In the [MS-XAML] and [MS-WPFXV] specs we just published, we started calling this attachable properties. That is because the perspective has changed when we are talking about what a type provides (attachable properties) vs what an instance has had set on it (attached properties). 

  • So I say, Canvas provides several attachable properties: Top, Left, etc. 
  • I also say that the button has the Canvas.Top attached property set on it.

Thoughts?

Published Saturday, April 05, 2008 3:19 AM by Rob_Relyea

Comments

# re: Rudi Grobler: Keeping track of open windows in WPF via an Attached Property@ Monday, April 07, 2008 2:08 AM

Hi Rob,

Tnx for the mention... Attached properties are really something special!!! I can be used in so many scenarios! It makes WPF just so flexiable!!!

Rudi Grobler

Leave a Comment

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