Re: Why viewmodel class doesn't has a reference to the view?

Re: Why viewmodel class doesn't has a reference to the view?

Old forum URL: forums.lhotka.net/forums/t/8163.aspx


CyclingFoodmanPA posted on Tuesday, December 15, 2009

If you want a full UI framework, there are several MVVM frameworks out there. CSLA is not a UI framework, it just has the minimum set of functionality to build a decent UI.

But you will find that the MVVM pattern itself says that the viewmodel doesn't reference the view. Such a reference would violate the pattern - so no reputable framework will support that concept, because it is not allowed by the pattern.

The idea is for the viewmodel to expose properties and methods, and to have the view bind to those properties and methods.

If the viewmodel has data that changes frequently, and the data should appear in the view, then the viewmodel should expose that data through properties and raise PropertyChanged when the data has changed.

Copyright (c) Marimer LLC