Blend has been following the developers ' comments since the day he was born:
Have vs also use blend to do what, direct code code is good.
Blend will generate a heap of garbage useless code, very uncomfortable.
For this kind of I will only judge in the heart, when you do not really know the same thing, it is very unfair to put labels on this thing.
As a programmer first to understand the importance of time and efficiency, but also understand the various performance tools, blend is one of them, if you still think that learning how to use blend is a waste of time,
So congratulations, the following article can ignore the:-)
"What is described in this article"
Use blend to add design-time data to your program.
"The scenario that this article applies"
Many applications are determined by their own nature, their data source is remote network, so it is very inconvenient to adjust the UI, most of the process is to tune the UI:
1, adjust the UI layout
2. Run the program
3. Waiting for data to load
4, the data after loading to see if there are UI issues, if there are goto 1
So inefficient, the method described in this article can adjust the process to:
1. Add design-time data source
2, adjust the UI layout
3, adjust the UI layout
4, adjust the UI layout
Eliminates the on-line debugging, enhances the efficiency.
Body
First, the realization of ideas
The blend itself provides the Sampledata feature, which automatically generates a Sampledata file based on the definition of model and provides D:datacontext and d:designdata to specify design-time DataContext. The combination of the two can achieve the effect mentioned earlier.
Ii. Specific steps
1, we first create the program model and the main page of the Mainpageviewmodel
Model:
ViewModel: