3 Design Time Data

<Incomplete ----- this is a draft ... do not read> 
Sample application

This is the sample application from Handling Events in design time in Visual Studio: 

Which at runtime came to be: 

Notice that at design time we could not see the list box or the two textBlocks. Lets change that. 

Services at the core

The first and foremost thing you need for design time data is to modify your ViewModel to use a service for data access rather than having logic embedded in the ViewModel. This is just better code design in general as well. So, a short mention of services that are at the heart of MEFedMVVM which is used by CinchV2.

Service Design 101: 

Service needs a service contract. In .NET we will use an interface to define the contract. The data you want belongs to a service. e.g. List box items, the counts. Lets call this service IMainWindowDataProvider:






A Note on Design time Services:
These are simply resolved by MEFedMVVM by looking at assembly that reference the MEFedMVVM library. So you can have your design time services in a different assembly as long as it references the MEFedMVVM library.


Comments