Thanks for your interest. I think your knowledge experience will be very usefull.

I started this project not so long ago. I originally started it because our company was contemplating on using new technologies for its product. I want this project to be proof of concept. But I think it can be interesting on its own.

there are several projects in the solution

MVVM part:

Views are in the MoneyManagerNET project (default project) . classes derive interface IView<TViewModel>
ViewModels are in MoneyManagerNET.Presentation project. classes derive from ViewModelBase<TModel>
Model is just a namespace with interfaces , in the MoneyManagerNET.Model project

Because viewModel should not access view directly I created some utilities for example when you need to show another window and get the input from the user. In MainViewModel class PromptCategory method creates CategoryViewModel and calls categoryViewModel.ShowDialog(). ViewModels dont have ShowDialog method , this is an extension method that finds View class associated with the ViewModel , creates its instance, sets Views datacontext to ViewModel and calls Views ShowDialog. As a result I dont have to reference the window classes directly.

this is my MVVM usage , may be it is not the best but I think we can refactor it to make better when needed. I think of using a MVVM framework(there are good ones out there) but for know I have hand coded utility classes ViewModelBase.

I try to use good architecture and design as far as I can.

ViewModel has all the screen logic when they need a to access data from the storage they use facade AppService.Storage static class which have Select(where),Save,New,Delete methods.

if you download and run the project it will run without a database because I used a mock storage implementation in AppService.Storage. U ca set Storage.Implementation static property to use another Storage like Entity Framework.

I think I have covered all. Feel free to ask anytime (theres not much to ask yet :)

good luck

Associating View with ViewModel




Website counter

Last edited Sep 21, 2011 at 5:08 PM by tsadigov, version 10


No comments yet.