{"id":525,"date":"2013-12-24T15:42:40","date_gmt":"2013-12-24T20:42:40","guid":{"rendered":"http:\/\/binaryworld.net\/blogs\/?p=525"},"modified":"2014-02-18T09:12:35","modified_gmt":"2014-02-18T14:12:35","slug":"xaml-tips-how-to-generate-sample-data-from-viewmodel-class","status":"publish","type":"post","link":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/","title":{"rendered":"XAML Tips: How to generate Sample Data from ViewModel Class"},"content":{"rendered":"<p>I recently tried to create sample data by hand for XAML Designer. If you don&#8217;t know what is sample data used for then <a title=\"XAML Sample Data for DesignTime\" href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ff602279(v=vs.95).aspx\" target=\"_blank\">read this article <\/a><\/p>\n<p>Its really pain to type all properties of ViewModel class specially if you have lots of nested objects from different namespaces. You can easily make mistake and scratch your head for hours.<\/p>\n<p>Here is very simple tip (This assume you have Expression Blend 4 Installed along with VS2012. I don&#8217;t know if Sample Data Generation feature available for Blend 3 so please don&#8217;t assume this will work for older version)<\/p>\n<p>1. Right Click anywhere in your VS2012 solution explorer and Open any file with Blend<\/p>\n<p><a href=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0054.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"Screen_0054\" src=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0054.jpg\" alt=\"\" width=\"420\" height=\"149\" \/><\/a><\/p>\n<p>2. Once Blend is loaded click Data Tab (Usually found on Right Hand Side along with Properties Tab). If you don&#8217;t see Data tab next to properties then Reset WorkSpace.. this bring back to default window layout.<\/p>\n<p><a href=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0055.jpg\"><br \/>\n<img decoding=\"async\" title=\"Screen_0055\" src=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0055.jpg\" alt=\"\" \/><\/a><\/p>\n<p>3. Click small Database with Plus icon. And select generate Sample Data from Class<\/p>\n<p><a href=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0056.jpg\"><br \/>\n<img decoding=\"async\" title=\"Screen_0056\" src=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0056.jpg\" alt=\"\" \/><\/a><\/p>\n<p>4. On popup list select your class which needs to be used to generate sample data. Hit OK.<\/p>\n<p><a href=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0057.jpg\"><br \/>\n<img decoding=\"async\" title=\"Screen_0057\" src=\"http:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/12\/Screen_0057.jpg\" alt=\"\" \/><\/a><\/p>\n<p>5. Now if you switch back to VS2012 solution you will see project reload message and after that you should find XAML file with sample data (usually located inside \\SampleData folder)<\/p>\n<p>&nbsp;<\/p>\n<p>I was inspired for this tip from this link<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently tried to create sample data by hand for XAML Designer. If you don&#8217;t know what is sample data used for then read this article Its really pain to type all properties of ViewModel class specially if you have &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\"> <span class=\"screen-reader-text\">XAML Tips: How to generate Sample Data from ViewModel Class<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,74],"tags":[82],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog\" \/>\r\n<meta property=\"og:description\" content=\"I recently tried to create sample data by hand for XAML Designer. If you don&#8217;t know what is sample data used for then read this article Its really pain to type all properties of ViewModel class specially if you have &hellip; XAML Tips: How to generate Sample Data from ViewModel Class Read More &raquo;\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\" \/>\r\n<meta property=\"og:site_name\" content=\"BinaryWorld Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2013-12-24T20:42:40+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2014-02-18T14:12:35+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"167\" \/>\r\n\t<meta property=\"og:image:height\" content=\"167\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"Binary World\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Binary World\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\",\"url\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\",\"name\":\"XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog\",\"isPartOf\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"datePublished\":\"2013-12-24T20:42:40+00:00\",\"dateModified\":\"2014-02-18T14:12:35+00:00\",\"author\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\"},\"breadcrumb\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage\",\"url\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"contentUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"width\":\"167\",\"height\":\"167\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryworld.net\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"XAML Tips: How to generate Sample Data from ViewModel Class\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\",\"url\":\"https:\/\/binaryworld.net\/blogs\/\",\"name\":\"BinaryWorld Blog\",\"description\":\"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\",\"name\":\"Binary World\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"caption\":\"Binary World\"},\"description\":\"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.\",\"url\":\"https:\/\/binaryworld.net\/blogs\/author\/admin\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/","og_locale":"en_US","og_type":"article","og_title":"XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog","og_description":"I recently tried to create sample data by hand for XAML Designer. If you don&#8217;t know what is sample data used for then read this article Its really pain to type all properties of ViewModel class specially if you have &hellip; XAML Tips: How to generate Sample Data from ViewModel Class Read More &raquo;","og_url":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/","og_site_name":"BinaryWorld Blog","article_published_time":"2013-12-24T20:42:40+00:00","article_modified_time":"2014-02-18T14:12:35+00:00","og_image":[{"width":"167","height":"167","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","type":"image\/png"}],"author":"Binary World","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Binary World","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/","url":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/","name":"XAML Tips: How to generate Sample Data from ViewModel Class - BinaryWorld Blog","isPartOf":{"@id":"https:\/\/binaryworld.net\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage"},"image":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage"},"thumbnailUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","datePublished":"2013-12-24T20:42:40+00:00","dateModified":"2014-02-18T14:12:35+00:00","author":{"@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0"},"breadcrumb":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#primaryimage","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","contentUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","width":"167","height":"167"},{"@type":"BreadcrumbList","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-how-to-generate-sample-data-from-viewmodel-class\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryworld.net\/blogs\/"},{"@type":"ListItem","position":2,"name":"XAML Tips: How to generate Sample Data from ViewModel Class"}]},{"@type":"WebSite","@id":"https:\/\/binaryworld.net\/blogs\/#website","url":"https:\/\/binaryworld.net\/blogs\/","name":"BinaryWorld Blog","description":"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0","name":"Binary World","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","caption":"Binary World"},"description":"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.","url":"https:\/\/binaryworld.net\/blogs\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/525"}],"collection":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/comments?post=525"}],"version-history":[{"count":0,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/525\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media\/488"}],"wp:attachment":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media?parent=525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/categories?post=525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/tags?post=525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}