How to create sample data collection from my own class in expression blend 4?
Can anyone help me? it seems no way to do this in blend 4 开发者_开发技巧
With Blend 4 open, go to Data tab.. hit the second icon from right("Create sample data").. select "Create sample data from class.." and select your class. This will generate sample data source. You can bind your controls to this data source to see the controls filled with sample in Blend designer. HTH.
The method I'm using now - although really less than perfect - is by creating a dummy class which contains a list of items of the original class. I.e.:
class We_Want_Items_Of {}
class Dummy_Class { List<We_Want_Items_Of> Test {get;set;}}
Then you can create a sample datum for the Dummy_Class, which will contain a list of We_Want_Items_Of's. You can then use that list as a data source for, for instance, a ListBox.
精彩评论