{"id":893,"date":"2013-07-12T09:00:00","date_gmt":"2013-07-12T09:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudio\/2013\/07\/12\/overview-of-related-files-in-blend\/"},"modified":"2021-08-06T07:38:50","modified_gmt":"2021-08-06T14:38:50","slug":"overview-of-related-files-in-blend","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/overview-of-related-files-in-blend\/","title":{"rendered":"Overview of Related Files in Blend"},"content":{"rendered":"<p>Related Files is a feature available in both Blend for Visual Studio 2012 and Blend for Visual Studio 2013 Preview. In this post, I\u2019ll describe how this feature works and how to make the best of it when designing your Windows Store app in HTML.<\/p>\n<p>When you are performing styling-related tasks in an HTML document, it is common (if not, desirable) to view both your HTML and CSS at the same time. With Windows Store apps written in HTML, the same workflow is applicable, with some increased complexity of the styling tasks you are trying to perform.<\/p>\n<p>Windows Store apps are very modular and often structured <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/apps\/Hh761500#hierarchical_system\">hierarchically<\/a>. Under the covers, focusing on just the markup, here is what is actually going on for a typical app:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0285.clip_image001_1ADA6E7B.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222299\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0285.clip_image001_1ADA6E7B.png\" alt=\"related files diagram\" width=\"444\" height=\"296\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0285.clip_image001_1ADA6E7B.png 444w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0285.clip_image001_1ADA6E7B-300x200.png 300w\" sizes=\"(max-width: 444px) 100vw, 444px\" \/><\/a><\/p>\n<p>Because Blend has a live design surface that allows you to edit a running version of your app, what you see in Blend is identical to what you see at runtime. This means an app composed of markup from different locations will still seem like one cohesive structure when viewed in Blend:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3823.clip_image003_65CDDF4A.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222300\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3823.clip_image003_65CDDF4A.jpg\" alt=\"Blend with markup from different locations\" width=\"574\" height=\"363\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3823.clip_image003_65CDDF4A.jpg 574w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/3823.clip_image003_65CDDF4A-300x190.jpg 300w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/a><\/p>\n<p>To reconcile editing your live application while still having access to the individual components that make it up, we have a feature in Blend called Related Files. The goal of this feature is to clearly highlight the markup that you are editing, identify the location the markup is coming from, and allow you to edit your HTML and CSS in the same view without switching contexts.<\/p>\n<h2>Say Hello to Related Files<\/h2>\n<p>By default, when you are editing an HTML document, the Blend workspace will display the Related Files code editors:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2845.clip_image005_0C9BF58B.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222301\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2845.clip_image005_0C9BF58B.png\" alt=\"Related Files\" width=\"585\" height=\"269\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2845.clip_image005_0C9BF58B.png 585w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2845.clip_image005_0C9BF58B-300x138.png 300w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/a><\/p>\n<p>These two code editors, better known as the primary (HTML) and secondary (primarily CSS) code editors, allow you to always see the relevant HTML or CSS for any interaction you perform using our visual tools.<\/p>\n<h3>Primary Code Editor<\/h3>\n<p>The primary code editor will select and bring into view the HTML that represents the selected element in the active document, regardless of which physical file it resides in:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0702.clip_image006_057CB913.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222302\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0702.clip_image006_057CB913.png\" alt=\"Primary Code Editor\" width=\"483\" height=\"146\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0702.clip_image006_057CB913.png 483w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/0702.clip_image006_057CB913-300x91.png 300w\" sizes=\"(max-width: 483px) 100vw, 483px\" \/><\/a><\/p>\n<p>As you move between elements in the open document, the primary code editor will keep pace accordingly, even if it needs to show a different physical file. Besides the actual contents displayed, you can quickly identify where this markup is coming from by looking at the file name displayed in the header.<\/p>\n<h3>Secondary Code Editor<\/h3>\n<p>The secondary code editor provides you easy access to the CSS that is related to what you currently have selected:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4034.clip_image007_6561AC55.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222303\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4034.clip_image007_6561AC55.png\" alt=\"Secondary Code Editor\" width=\"571\" height=\"214\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4034.clip_image007_6561AC55.png 571w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/4034.clip_image007_6561AC55-300x112.png 300w\" sizes=\"(max-width: 571px) 100vw, 571px\" \/><\/a><\/p>\n<p>When you select different elements in your artboard and Live DOM or different style rules in the Style Rules panel and Applied Style Rules list, your secondary code editor will automatically update to show the CSS associated with what you have selected.<\/p>\n<p>Sometimes, you may want to override this automatic update behavior and show something specific in the secondary code editor. For such times, you can manually change the file that you want displayed. To change the file that is displayed, click on the drop-down that shows the file name currently displayed:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/5504.clip_image008_5A38220B.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-233716\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/5504.clip_image008_5A38220B.png\" alt=\"Image 5504 clip image008 5A38220B\" width=\"603\" height=\"207\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/5504.clip_image008_5A38220B.png 603w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/5504.clip_image008_5A38220B-300x103.png 300w\" sizes=\"(max-width: 603px) 100vw, 603px\" \/><\/a><\/p>\n<p>You will see a categorized listing of all of the HTML, CSS, and JavaScript files currently referenced by the HTML document you have open. As you edit in your secondary editor, you can lock the editor so it does not automatically update as you interact with your application. Click the lock icon next to the files drop-down, and Blend will stop automatically switching you away from that currently displayed document.<\/p>\n<h2>Conclusion<\/h2>\n<p>Blend\u2019s Related Files feature helps make styling and modifying the HTML for your Windows Store apps predictable and easy. It doesn\u2019t matter where the markup you are editing is coming from &#8211; the primary and secondary code editors will display the appropriate markup based on what you have selected and what you are currently editing. This allows you to spend more time making the changes that you want to make and less time jumping between many open files and trying to find the relevant markup or code.<\/p>\n<p>Your feedback is always valuable to us, please share it with us as comments here on this post, or suggestions on <a href=\"http:\/\/visualstudio.uservoice.com\/\">UserVoice<\/a> and our <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/windowsapps\/en-US\/home?category=windowsapps\">forums<\/a>.<\/p>\n<p>Thanks!<\/p>\n<table style=\"width: 698px; height: 151px;\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"148\"><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2043.image_thumb_5A2F84C1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-222304\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2013\/07\/2043.image_thumb_5A2F84C1.png\" alt=\"Kirupa Chinnathambi\" width=\"135\" height=\"140\" \/><\/a><\/td>\n<td valign=\"top\" width=\"645\">Kirupa Chinnathambi is a Program Manager on the Visual Studio team focusing on Blend. When he isn\u2019t busy writing short bios of himself for blog posts, he can be found helping files find their long-lost relatives on <a href=\"http:\/\/www.twitter.com\/kirupa\">twitter<\/a>, <a href=\"http:\/\/www.facebook.com\/kirupa\">Facebook<\/a>, and on <a href=\"http:\/\/www.kirupa.com\">kirupa.com<\/a>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Related Files is a feature available in both Blend for Visual Studio 2012 and Blend for Visual Studio 2013 Preview. In this post, I\u2019ll describe how this feature works and how to make the best of it when designing your Windows Store app in HTML. When you are performing styling-related tasks in an HTML document, [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":255385,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4980,155],"tags":[135,136,137,376,124,126],"class_list":["post-893","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-visual-studio","tag-blend","tag-css","tag-html","tag-java","tag-javascript","tag-visual-studio-2013"],"acf":[],"blog_post_summary":"<p>Related Files is a feature available in both Blend for Visual Studio 2012 and Blend for Visual Studio 2013 Preview. In this post, I\u2019ll describe how this feature works and how to make the best of it when designing your Windows Store app in HTML. When you are performing styling-related tasks in an HTML document, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=893"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/893\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/255385"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}