<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.windows-now.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Nathan Dunlap : Resources</title><link>http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx</link><description>Tags: Resources</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP2 (Build: 31104.93)</generator><item><title>Hooray for WinHEC bits!</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/07/3413.aspx</link><pubDate>Fri, 07 May 2004 19:07:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:3413</guid><dc:creator>ndunlap</dc:creator><slash:comments>28</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=3413</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/07/3413.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Now that the SDK has been updated I can finally start posting on some of the really cool features that I have been playing with for the last couple of months. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've got an article in the works that is an updated version of my GelButton that I posted earlier. Its not finished yet, but if you want to get a sneak peek you can see the source code and screen shots here. &lt;A href="http://www.longhornblogs.com/ndunlap/articles/3392.aspx"&gt;http://www.longhornblogs.com/ndunlap/articles/3392.aspx&lt;/A&gt;&amp;nbsp; It isn't a straight port of the original GelButton demo, but I have drastically reduced the complexity of how it was created using Grid. Also I have made the drop shadow and the shines on the button much more aesthetically pleasing using the Blur&amp;nbsp;ImageEffect.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Now that the SDK is live here are some links I think are pretty exciting and interesting...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;Grid &lt;BR&gt;&lt;/STRONG&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.windows.controls/c/grid/grid.aspx"&gt;&lt;STRONG&gt;http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.windows.controls/c/grid/grid.aspx&lt;/STRONG&gt;&lt;/A&gt;&lt;BR&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/layout/overviews/grid_ovw.aspx"&gt;&lt;STRONG&gt;http://longhorn.msdn.microsoft.com/lhsdk/layout/overviews/grid_ovw.aspx&lt;/STRONG&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;BR&gt;This panel is awesome. I will admit I havent been using it enough to really feel like I have mastered its use but it really fixes the issues I blogged on earlier about not being able to do margin effects easily without doing the DockPanel.Dock=&amp;#8220;fill&amp;#8220; workaround. Grid allows you to apply NineGrid like slice and dice control on layouts that contain things other than image data. When I started using shape elements to create the visuals for my controls and applications layouts I immediately found myself wanting to have the same kind of control like I had with NineGrid. With the Grid panel I get that kind of control but I am not limited to a&amp;nbsp;nine cell configuration.&amp;nbsp;This is very cool and powerful and there are going to be some really exciting and creative designs enabled using this. I can't wait to see the different way people use this. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;ImageEffects&lt;BR&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.windows.media/c/imageeffect/imageeffect.aspx"&gt;http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/system.windows.media/c/imageeffect/imageeffect.aspx&lt;/A&gt;&lt;BR&gt;&lt;/STRONG&gt;So far the one I am using a lot is Blur. With blur&amp;nbsp;I can create some gorgeous drop shadows, on any kind of elment, text, shape, button, etc. My GelButton example is using it a lot. I've also got some cool laser effects I am doing with blur that I will be posting on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;OpacityMasks&lt;BR&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/graphicsmm/overviews/opacitymasking.aspx"&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;http://longhorn.msdn.microsoft.com/lhsdk/graphicsmm/overviews/opacitymasking.aspx&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=Arial size=2&gt;Another great toy for pulling off some sweet effects. You can use gradients, images, DrawingBrushes, etc to create your masks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=2&gt;3D&lt;BR&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/graphicsmm/overviews/basic3d.aspx"&gt;&lt;STRONG&gt;&lt;FONT face=Arial size=2&gt;http://longhorn.msdn.microsoft.com/lhsdk/graphicsmm/overviews/basic3d.aspx&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;BR&gt;&lt;FONT face=Arial size=2&gt;Need I say more? Ok I will.... This changes everything. No more hard line between creating 3D content and mixing it with 2D content. I had been asking for 2D perspective transform so I could pull off pseudo 3D effects...Real 3D is so much better! Try this sometime... create an app that has 3D elements that composite on top of 2D elements like a complex layout with text flowing in it. Then composite that on top of another 3D element and hey while your at it throw a video element at the very bottom of the stack so it has to render through all that stuff. Hmm maybe throw a video element on top and set some opacity on it. Maybe even put an opacity mask on the topmost video element. Then animate a bunch of stuff. Run it full screen.&amp;nbsp;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;Its definitely&amp;nbsp;a new world we are living in! I will get some posts with cool 3D samples up soon.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;DrawingBrush in resources...&lt;/STRONG&gt;&lt;BR&gt;One note for people that have read my earlier blogs about using DrawingBrush... There are some changes with how DrawingBrush works when it is used as a resource. If your app has DrawingBrushes defined as a resource you will need to do a work around for the app to still work. I will try to post simple code soon. In the meantime you can see how I got my DrawingBrush resources working in the LoginScreen Demo &lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/sampledocs/sampleapplications/wcpsamp_demosample_loginscreen.aspx"&gt;http://longhorn.msdn.microsoft.com/lhsdk/sampledocs/sampleapplications/wcpsamp_demosample_loginscreen.aspx&lt;/A&gt;. Check out default.xaml.cs and look at the Init event. &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You can still &lt;FONT color=#000000&gt;use a DrawingBrush as a resource, just not as a resource before the application has loaded. Basically the first access to a DrawingBrush needs to happen before the DrawingBrush is used to render, so accessing it in the start up event causes the first access to occur before layout and render has happened. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=3413" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx">Resources</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/DrawingBrush/default.aspx">DrawingBrush</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Vectors/default.aspx">Vectors</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Styles/default.aspx">Styles</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Layout/default.aspx">Layout</category></item><item><title>Global styles and resources using application level resources</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/18/1891.aspx</link><pubDate>Fri, 19 Dec 2003 00:00:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1891</guid><dc:creator>ndunlap</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=1891</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/18/1891.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;In DHTML you can create global CSS stylesheets that allow you to access your styles across multiple web pages. You can do the same thing&amp;nbsp;by storing your&amp;nbsp;resources in the application object. This is much more powerful with XAML because you can store more than just styles. For example, for my visual style I would store all my themed icons created using DrawingBrushes, my custom control modifications&amp;nbsp;and defined metrics using styles, and all my colors as named resources. I can even resource text strings at the application level. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The SDK has a simple&amp;nbsp;&lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/Samples/core/app_levelresources/wcpsamp_prog_model_app_levelresources.aspx"&gt;&lt;FONT face=Arial size=2&gt;Application Level Resources demo here.&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;This is a good doc on understanding the &lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/appcore/overviews/appmodel_appobject2.aspx"&gt;&lt;FONT face=Arial size=2&gt;Application Object.&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The quick summary on how this works is that you create your resource block in your application definition page.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;lt;Application xmlns="http://schemas.microsoft.com/2003/xaml/"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:def="Definition"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def:CodeBehind="App.xaml.cs"&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;def:Class="WCSample.App"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartupUri="Default.xaml"&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#ff0000&gt;&amp;nbsp; &amp;lt;Application.Resources&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Color def:Name=&amp;#8220;CustomColor1&amp;#8220; ...&amp;nbsp;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Image def:Name=&amp;#8220;CustomLogo1&amp;#8220;&amp;nbsp; ...&amp;nbsp;/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Style def:Name=&amp;#8220;CustomStyle1&amp;#8220; ...&amp;nbsp;/&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp; &lt;FONT color=#ff0000&gt;&amp;lt;Application.Resources&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;/Application&amp;gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT face=Arial&gt;Now every page in you application will be able to access these three resources. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT face=Arial&gt;Where this gets really cool is when you start to use &lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/msavalon.windows/c/style/p/basedon.aspx"&gt;BasedOn styles&lt;/A&gt;&amp;nbsp;to modify application level defined styles at the page level.&amp;nbsp;I will&amp;nbsp;post&amp;nbsp;some good uses for BasedOn styles later. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1891" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx">Resources</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Styles/default.aspx">Styles</category></item><item><title>Reusing Vectors with Styles and def:Includes</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/16/1875.aspx</link><pubDate>Wed, 17 Dec 2003 00:30:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1875</guid><dc:creator>ndunlap</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=1875</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/16/1875.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;In my last post I mentioned that drawing brush is good when you don't want your vectors to intelligently resize and layout. So what do I do when I want to reuse vectors that I do want to dynamically resize? Well the obvious solution is to build my vector elements directly inline. The only problem is that this becomes really difficult to manage. So here are some tricks I use to avoid XAML bloat using def:include resources or styles. This allows me to use vectors as I would inline to get the benefit of layout, but I can reuse common designed elements. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I have posted an example &lt;B&gt;&lt;A href="http://www.dunlap.cc/lhblog/Vectors/ReusableVectors.zip"&gt;here&lt;/A&gt;&lt;/B&gt; that demonstrates creating a panel with a "cutout" effect.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;First, def:include resources are the most intuitive way to go, but in the PDC builds you can only use one instance of a def:include. (Don't worry, this will be fixed so that you can use it as you would expect...) &lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT face=Arial size=2&gt;Here is how you define it:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;Canvas Width="10%" Height="10%" def:Name="MyCustomCanvas" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;lt;/Canvas&amp;gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Arial size=2&gt;Here is how you use it:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT face="Courier New" size=2&gt;&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#000080&gt;&amp;lt;def:Include def:Content="{MyCustomCanvas}"/&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Another way of doing this is by using Style resources. ( I will be going into way more depth on how to use Styles soon. )&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT face=Arial size=2&gt;Here is how you define it:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;Style def:Name="MyCustomCanvas" &amp;gt;&lt;BR&gt;&amp;lt;Canvas Width="100%" Height="100%" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;Style.VisualTree&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Canvas Width="10%" Height="10%"&amp;nbsp; &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Canvas&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;lt;/Style.VisualTree&amp;gt;&lt;BR&gt;&amp;lt;/Style&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Arial size=2&gt;Here is how you use it:&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;Canvas Style="{MyCustomCanvas}" Width="80%" Height="100" Margin="10" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1875" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx">Resources</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Vectors/default.aspx">Vectors</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Styles/default.aspx">Styles</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Layout/default.aspx">Layout</category></item><item><title>Creating vector icons with DrawingBrush</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/15/1862.aspx</link><pubDate>Tue, 16 Dec 2003 00:13:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1862</guid><dc:creator>ndunlap</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=1862</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/15/1862.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;OK, creating icons in today's world sucks... First I have to create multiple sizes of icons 16x, 24x, 32x 48x, 64x, etc.&amp;nbsp; Even when I go through all the&amp;nbsp;trouble of making sure I have all the different dimensions of the icons I need, I still run the risk of my icons being mangled when they show up on a monitor running a different DPI (with high dpi monitors on their way, this is becoming more and more of an issue).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Creating vector icons with DrawingBrush is a way that I get around the problems of needing multiple resolution and multiple dimension icons. DrawingBrush allows me to basically combine a bunch of vector shapes and then define them as a brush resource that I can paint the Fill, Background properties on elements. This is really convenient when I want to get the benefit of using vectors if I want my strokes and shapes to always proportionally scale and I don't mind if the vectors don't intelligently resize or if the strokes become distorted when stretching and scaling. This is typically the&amp;nbsp;behavior I expect&amp;nbsp;when I am using graphical elements like clipart and icons.&lt;/FONT&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Here is what it looks like:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;Canvas&amp;gt;&lt;BR&gt;&amp;lt;Canvas.Resources&amp;gt;&lt;BR&gt;&amp;nbsp;&lt;FONT color=#006400&gt;&lt;STRONG&gt;&amp;lt;!-- Define the vector icon with a drawing brush --&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;DrawingBrush ViewBox="-5,-5,265,265" def:Name="Blue_Ball_Icon"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Drawing&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PATH ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Ellipse .. /&amp;gt; &lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle ... /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Drawing&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/DrawingBrush&amp;gt;&lt;BR&gt;&amp;lt;/Canvas.Resources&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" color=#006400 size=2&gt;&amp;lt;!--&amp;nbsp;Use the vector icon&amp;nbsp;--&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;Button Background="{Blue_Ball_Icon}" Width="16px" Height="16px" /&amp;gt;&lt;BR&gt;&amp;lt;Button Background="{Blue_Ball_Icon}" Width="160px" Height="160px" /&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;CANVAS&gt;&lt;FONT face=Arial color=#006400 size=2&gt;&lt;A href="http://www.dunlap.cc/lhblog/DrawingBrush/DrawingBrush.zip"&gt;&lt;STRONG&gt;Working example posted&amp;nbsp;here.&lt;/STRONG&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The image below show is a snap shot of a DrawingBrush that is used for various sized icons. I kept the jpg low res for the web, but if you run the app linked below you will see that the fidelity on every one of the icons is excellent. The stretched image shows that you will distort your shapes and strokes, but you wont ever show any pixelation.&lt;BR&gt;&lt;/FONT&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/drawingbrush/db.jpg"&gt; &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1862" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx">Resources</category><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/DrawingBrush/default.aspx">DrawingBrush</category></item><item><title>Defining resources in markup</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/10/1793.aspx</link><pubDate>Thu, 11 Dec 2003 02:22:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1793</guid><dc:creator>ndunlap</dc:creator><slash:comments>32</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=1793</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/10/1793.aspx#comments</comments><description>&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;In the SDK is a demo where I completely change the look and feel of an app by swapping out resources on the fly based on user interaction. This demo is located &lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/Samples/demos/loginscreen/wcpsamp_demosample_LoginScreen.aspx"&gt;&lt;FONT face=Verdana&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;if you want to try it out. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;I've got another demo&amp;nbsp;where I&amp;nbsp;have&amp;nbsp;one set of resources defined on a page level that references application level resources. In the app level resources all that I define are some color and brush resources. Doing this made it super easy to just replace the app level resources to update the colors throughout the application, but I was able to maintain all the crazy styling that I had done on the other pages. At some point I will clean that demo up and post it.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;I have posted a sample that I think is a really useful reference for using resources in markup &lt;/FONT&gt;&lt;A href="http://www.dunlap.cc/lhblog/Resources/resources.zip"&gt;&lt;FONT face=Verdana&gt;here.&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The types of resources I have in this sample include how to define and use bytes, strings, colors, brushes, styles, XMLDataSources, and more.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;The demo doesn't do anything interesting other than just defines the different types of resources and then uses them. It's pretty cool though because I chain the resources off of each other. For example: I define a def:include that creates a button that uses a brush resource. That brush resource uses a color resource. The color resource uses a byte resource. All of this&amp;nbsp;using markup only!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1793" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Resources/default.aspx">Resources</category></item></channel></rss>