MVVM compatible

Sep 7, 2014 at 2:17 AM
First, this is an extremely awesome project. Thank you!

Second, since you've made this compatible with Universal Apps, I was wondering if you had considered adding an ItemsSource to your PhysicsCanvas and making it bindable for MVVM applications.

It's very possible that I'm going in the wrong direction with this, but on my local copy, I have added an ItemsSource and ItemsTemplateSelector dependency properties. This way, I can create ViewModels/Models for all of the game objects and keep only the UI portion within the UserControl. The ItemsTemplateSelector matches up the ViewModel with the UserControl.

In any case, it seems to be working for me so far, but I haven't really started doing much with it so I don't know what roadblocks I will run into.

Thanks again
Sep 8, 2014 at 5:05 PM

Yes, you could certainly make it bindable which is great for maintainability of your code - but it will have some performance consequences which you may want to consider.

I always figured, for a game, you probably want to keep things as lean as possible. But if you're just doing basic physics effects then maybe your approach works best for your project.