|
|
Hi
When I was looking at MVVM toolkits I found this toolkit and Light MVVM toolkit. One feature I liked about Light was the feature of "blendablility" where you can have a design mode and a live mode.
This allows you to load up blend and style up your data using this design mode data. I see that MVVM uses mocks what I thought would be the same thing but after watching the video I did not see any indication that the mocked data would be displayed in design view.
Did I just miss it or something?
|
|
Coordinator
Feb 11 at 8:19 PM
|
<div><font face="Verdana"><span style="font-size:15px">As far as I can tell, Simple MVVM Toolkit supports blendability in much the same way as MVVM Light, which is via a IsInDesignMode property on the base ViewModel class. To show design-time data, just check
the property and return mock data if it is true.</span></font></div>
<blockquote type="cite">
<div></div>
</blockquote>
|
|
|
|
tonysneed wrote:
<div><font face="Verdana"><span style="font-size:15px">As far as I can tell, Simple MVVM Toolkit supports blendability in much the same way as MVVM Light, which is via a IsInDesignMode property on the base ViewModel class. To show design-time data, just check
the property and return mock data if it is true.</span></font></div>
<blockquote type="cite">
<div></div>
</blockquote>
Where would I do this check. From the video I seen you only hook up a mock object but now switching between mock and real.
Would you put it in here?
// STEP 2a: Add CustomerViewModel using mvvmlocator code snippet
public CustomerViewModel CustomerViewModel
{
get
{
//check here?
ICustomerServiceAgent serviceAgent = new MockCustomerServiceAgent();
return new CustomerViewModel(serviceAgent);
}
}
|
|
Coordinator
Feb 25 at 1:04 AM
|
Yes, perform the check in the property getter.
|
|