CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Is MVVM still the preferred way with WinRT/Xaml apps?

rated by 0 users
Not Answered This post has 0 verified answers | 2 Replies | 2 Followers

Top 50 Contributor
178 Posts
Tim posted on Sat, Jul 7 2012 8:48 PM

I'm slowly working my way through my first go at a Xaml-based WinRT app.  For the most part, I think I've correctly got the Bxf framework compiled and usable within the WinRT.

One of the things I'm seeing in the defalt code when creating a new page in the project is that it assumes you're going to wire up the data and manually bind it to the collection view source via code.  The comments provided in the LoadState method in the code-behind even speaks to that.  Is this the preferred route now?  Or is Microsoft just providing one possible way of doing it to get someone started?  Can I follow a normal MVVM path to hooking up the view and viewmodel?  Any differences that I need be aware of? 

One other quick question:  the page templates that are provided (like the "Items Page" template) all seem to use a static resource for a grid's ItemSource that assumes the elements are binding to properties like "Title," "SubTitle," etc.  Is this also just a MS-example?  Or are we supposed to force our objects' properties into this mold?

Thanks.

Tim

All Replies

Top 10 Contributor
9,270 Posts

I don't know the answer to this question yet.

Thus far I have been using the Microsoft templates, viewmodel objects, and a little code-behind to handle things like navigation and setting each form's datacontext. Not "pure" MVVM by any means, but very workable.

I have been focused on getting CSLA itself working with async/await and WinRT, and haven't spent any real time thinking about UI framework issues.

I know the MVVM Light and Caliburn Micro projects have put effort into the UI issues, and I think there's already an MVVM Light for WinRT.

What I don't know is whether their approaches are compatible with Microsoft's item templates. I'd sure hate to lose the ability to use those templates, because they do a lot of the basic work necessary to get standard transitions and animations set up correctly.

Rocky

Top 50 Contributor
178 Posts
Tim replied on Mon, Jul 9 2012 4:42 PM

Thanks for the info.  So in the way that you're currently doing it, do you have one main view/page with a content control, in which you inject the sub-views when navigating?  Or are you doing it like what their templates show, where each page is unto itself?

Tim

Page 1 of 1 (3 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems