views:

37

answers:

2

I am new in WPF and wondering about business properties visualization approach in WPF.

I explain myself:

I am a city architect and draw a city plan. My city is a canvas with rectangles, representing houses. I can drag rectangles on the canvas.

Now, I need to edit house's properties when I select a house.

Is there a WPF way to do it? I mean something like PropertyGrid in Winforms, or sommething similar maybe a "PropertiesPopup" or "propertybar" ) ?

I mean, I select an UI element HouseUserControl, but want to display(edit) the associated Business Object House object properties.

Any articles or ideas are welcome. Thanks.

A: 

Wow - is this ever a wide open question...

There are an infinite number of answers here, but perhaps one thing to suggest is taking a look at MVVM (Model-View-ViewModel), which is "The (Latest) WPF Way" of doing things.

Josh Smith is generally considered one of the best, and even has a book.

Wonko the Sane
Model-View-ViewModel... I know that I need to know .NET, if we are speaking in a more general level... I need perhaps something closer to reality element or way to implement it. Thanks, however, for your suggestion.
serhio
A: 

To answer very specifically, no, there isn't a built-in PropertyGrid-like control in WPF; there are some open-source efforts to provide one (but last time I looked they were woefully underdeveloped... all I looked at anyway... good efforts though! keep going!).

Also, Silverlight has the DataForm which is a neat way of editing generic objects, but that's missing from WPF as well. There have been some efforts to port the Silverlight one, but a lot of functionality went missing and I haven't seen any activity in that direction lately.

So to summarize... there isn't an easy, drag-and-drop way of doing it right now. However, if the business objects are restricted in their design (a very cohesive domain model), it's fairly easy to roll your own, semi-generic editor, using of course MVVM like Wonko suggested.

Alex Paven