tags:

views:

48

answers:

1

Hi,

Does WPF provide a framework for handling documents, similar to how MFC's Document/View?

In my WPF application, I can go and just create File->New/Open/Save elements in the menu and attach them to methods, but I'm wondering if WPF provides anything to manage that in a better way.

Thanks!

+1  A: 

The main published guidelines is to use the Model/View/ViewModel pattern.

I'd recommend watching this Channel 9 video on MVVM.


Edit:

The Patterns and Practices group also published the Composite Application Guideance for WPF and Silverlight, which includes a full library that can be used. It's fairly heavy-weight, though, for many applications.

Reed Copsey
What I'm looking for is more of a framework that handles checking for modified files, asking to save before quitting, transparently handling multiple documents, that sort of thing.While I understand how a MVVM pattern is useful to interface with documents, my question is more about managing those documents. Maybe it's totally different with WPF, but in MFC there was the CDocument class to handle those kinds of things.
Steve the Plant
@Steve the Plant: There's also the Composite App library (I edited my answer). It has many of the building blocks for doing what you've listed, but is more for doing huge, high-level work. WPF does change things, though - things like CDocument really don't fit well into the WPF way of thought, since part of the idea is to be very flexible in presentation, decouple look from action, etc. A structured format is less useful in WPF, especially since many of hte tasks CDocument provides come much more easily in WPF once you learn the basics.
Reed Copsey