2

I am currently using caliburn.micro in my WP7 project and I am quite happy with it. My application is very data-heavy, so I took a look at Agfx (http://agfx.codeplex.com), seems it can save me a lot of time on data requesting and caching.

But the problem here is that agfx also provide a base view model, while I've already had one which inherits Screen of caliburn.micro. Of course I can encapsulate a new view model base which inherits ModelItemBase from agfx, and implements IScreen. But I kinda don't like this, is there any better soultion or best practice you can share with me about how to integrate the 2 great frameworks?

Best Regards,

-Peng

Peng Wang
  • 227
  • 3
  • 13

1 Answers1

3

I am actually using AgFx with another UI framework which has its own ViewModelBase. My own understanding is, the ModelItemBase that's provided by AgFx is a model base rather than a viewmodel base. It basically takes care of the data.

My viewmodel which inherits from my ViewModelBase, does a lot more stuff like Tombstoning, application bar bindings, etc. It's designed for displaying the data on the view.

I think it fits in mvvm and works out really well. Hope this helps. :)

Justin XL
  • 38,763
  • 7
  • 88
  • 133
  • I got what you mean, but ModelItemBase inherits from INotifyPropertyChange, does that mean it is designed for VM? and doing so might blur the boundary of domain models and VMs, right? – Peng Wang Oct 18 '11 at 15:20
  • Nope, INotifyPropertyChanged is not UI specific, what if a property his changed in the model? In this case you need to have it on your model to notify your vm about this change. – Justin XL Oct 18 '11 at 21:29
  • Xin, are you using it with MVVM Light? If so, could you give a small overview on how you combine it with Agfx? – Depechie Dec 12 '11 at 08:58
  • @Depechie Sorry I am using Jeremy Likness' UltraLight Mvvm framework http://www.wintellect.com/CS/blogs/jlikness/archive/2011/02/25/building-a-windows-phone-7-application-with-ultralight-mvvm.aspx not sure about MvvmLight though. :( – Justin XL Dec 12 '11 at 09:19
  • Xin any way I could contact you for a bit more detail on your implementation? I'm Depechie on twitter... – Depechie Dec 12 '11 at 20:50