<?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</title><link>http://www.windows-now.com/blogs/ndunlap/default.aspx</link><description>Nathan Dunlap</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP2 (Build: 31104.93)</generator><item><title>MultiPropertyTrigger in Styles</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/18/3497.aspx</link><pubDate>Tue, 18 May 2004 20:16:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:3497</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=3497</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/18/3497.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Somehow I haven't stumbled on this until. This morning I was browsing through a parser test and I saw MultiPropertyTrigger and decided to try it. This seems like it would be pretty crucial for complex styles. 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;Style.VisualTriggers &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PropertyTrigger Property="Button.IsFocused" Value="True" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target="BackgroundRect" PropertyPath="Fill" Value="#6699CC" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/PropertyTrigger&amp;gt; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MultiPropertyTrigger &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MultiPropertyTrigger.Conditions &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;nbsp; &amp;lt;Condition Property="Button.IsPressed" Value="True" /&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;nbsp; &amp;lt;Condition Property="Button.IsFocused" Value="True" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MultiPropertyTrigger.Conditions&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Set Target="RightEllipse" PropertyPath="Fill" Value="#ffcc00" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/MultiPropertyTrigger&amp;gt;&lt;BR&gt;&amp;lt;/Style.VisualTriggers&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.dunlap.cc/lhblog/styles/multitrigger.xaml"&gt;&lt;FONT face=Arial size=2&gt;I have a sample using this that builds on the WinHEC bits posted here.&lt;/FONT&gt; &lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=3497" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Styles/default.aspx">Styles</category></item><item><title>Creating Clip Art for Avalon</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/17/3493.aspx</link><pubDate>Mon, 17 May 2004 22:44:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:3493</guid><dc:creator>ndunlap</dc:creator><slash:comments>25</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=3493</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/05/17/3493.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've been asked how I created different Clip Art pieces in my demos a lot recently so I figure this is a good topic to blog on. If any of you have taken a look at typical path data, you are aware that its pretty&amp;nbsp;painful to even&amp;nbsp;think about manipulating or creating path content without some sort of tool. One way I have gotten around this is to turn Microsoft Office into a makeshift editor for creating Avalon ready Clip Art using the Windows Client Printer Driver. Here is a simple how-to:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;First make sure you have installed the Windows Client Printer Driver. &lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Open &amp;#8220;Add/Remove Programs&amp;#8221; from the Control Panel.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click on "Add or Remove Windows Components"&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;In the components list click the checkbox for "Windows Client Printer Driver"&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;After install is complete you can access the Printer driver from any application that supports printing. I'm not aware of how well other applications will do when working with the printer driver, but I do know that Office 2003 works great.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Here is how I get clipart from&amp;nbsp;Microsoft Word&amp;nbsp;into my XAML projects.&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Open a document in Microsoft Word.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click Insert &amp;gt; Picture &amp;gt; Clip Art...&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Change dropdown for "Results should be:" to only search on Clip Art. You can even filter it down further based on file type. I have most success searching for .wmf files only.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Perform your Clip Art search.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click on a clip art tile to insert it in your Word document.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click File &amp;gt; Page Setup and set all your Margins to zero. (this is to ensure that the art is drawn starting at a 0,0 reference point for all the resulting paths.)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click File &amp;gt; Print then c&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;hoose the Windows Client Printer Driver&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click the &amp;#8220;Properties&amp;#8220; button.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Change "Output Format" to "Windows Client Markup File" (otherwise the output will be a .container file which wont let you get into the markup. Choosing Markup File will export a .XAML)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Click "OK" to continue on to printing and specify a file name and destination. (c:\foo.xaml)&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Navigate to the file destination and there should be the foo.xaml file and a folder called "foo_files"&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;Open "Page_1.xaml" in this folder with your XAML editor.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Arial size=2&gt;All the Path elements in between the "FixedPage" elements are fair game. Copy and paste those into your app. I find it useful to wrap these elements in Canvas and set the dimensions of the Canvas to the same size as the clip art dimensions that are specified in Word. If you need different dimensions, you can resize the art in Word and export again using the printer driver. I also like to turn clip art into DrawingBrushes for easy reuse at multiple sizes.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=3493" width="1" height="1"&gt;</description><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/Images/default.aspx">Images</category></item><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>Creating resizable panels with splitter bars</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/02/13/2506.aspx</link><pubDate>Sat, 14 Feb 2004 00:22:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:2506</guid><dc:creator>ndunlap</dc:creator><slash:comments>39</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=2506</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/02/13/2506.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Jonathan Russ, a developer on the Avalon Demo team, mentioned that somebody was asking how to do resizable frames on the newsgroups.&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/layout/splitter.jpg"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;This is really easy to do with DockPanel.Dock=&amp;#8220;Fill&amp;#8220; so we put together a sample that allows you to do this.&amp;nbsp;I've posted an article for it at &lt;A href="http://www.longhornblogs.com/ndunlap/articles/2505.aspx"&gt;http://www.longhornblogs.com/ndunlap/articles/2505.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=2506" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Layout/default.aspx">Layout</category></item><item><title>Creating Shapes with CombineMode</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/29/2295.aspx</link><pubDate>Fri, 30 Jan 2004 00:41:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:2295</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=2295</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/29/2295.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;I demonstrated using &lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/msavalon.windows.media/e/combinemode/combinemode.aspx"&gt;CombineMode&lt;/A&gt; in my earlier post about clipping. You can do the same thing on a Path element to create more complex shapes. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I needed a reference app so I&amp;nbsp;could remember what each type of CombineMode does. I've posted that app to &lt;A href="http://www.dunlap.cc/lhblog/vectors/combinemode.zip"&gt;http://www.dunlap.cc/lhblog/vectors/combinemode.zip&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;STRONG&gt;This is what the code looks like:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#0000ff size=2&gt;&amp;nbsp; &amp;lt;Path Fill="#6699CC" Stroke="Black" StrokeThickness="2" DockPanel.Dock="top" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Path.Data&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryCollection &lt;FONT color=#ff0000&gt;&lt;STRONG&gt;CombineMode="Xor"&amp;gt;&lt;/STRONG&gt;&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RectangleGeometry Rect="0 0 50 50" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RectangleGeometry Rect="25 25 50 50" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GeometryCollection&amp;gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Path.Data&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Path&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#000000 size=2&gt;&lt;STRONG&gt;Here is a snapshot for a visual reference:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/vectors/combinemode.gif"&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=2295" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Vectors/default.aspx">Vectors</category></item><item><title>GelButton Article and using DockPanel with Margin</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/22/2229.aspx</link><pubDate>Fri, 23 Jan 2004 03:22:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:2229</guid><dc:creator>ndunlap</dc:creator><slash:comments>47</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=2229</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/22/2229.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial&gt;I am more or less done with the article on creating a gel button using styling.&lt;BR&gt;&lt;BR&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/styles/button_tutorial/pushme.jpg"&gt;&amp;nbsp;&lt;BR&gt;The article is posted here &lt;A href="http://www.longhornblogs.com/ndunlap/articles/2203.aspx"&gt;http://www.longhornblogs.com/ndunlap/articles/2203.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;While I was writing the article I realized that I frivolously use DockPanels wrapped around my shape elements and other layout elements that use the Margin property.&amp;nbsp;I think its a pretty good tip to explain why I do this.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If you put a shape inside of a Canavs&amp;nbsp;and set the width and height to 100% and then give the shape a margin like this:&lt;BR&gt;&lt;BR&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;lt;Canvas Width="100" Height="75" Background="#6699cc" Margin="50"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Rectangle Width="100%" Height="100%" Fill="gold" Margin="5" RadiusX="10" RadiusY="10" /&amp;gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;lt;/Canvas&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;in DHTML, this is what you would expect:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/layout/margingood.jpg"&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;However if you do that in Avalon, this is what you get:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/layout/marginbad.jpg"&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;The reason you get this is because the layout engine figures out the width and then it applies the margin afterwards. So my trick for getting around this is to use a DockPanel and then set&amp;nbsp;&lt;STRONG&gt;DockPanel.Dock=&amp;#8221;fill&amp;#8221; &lt;/STRONG&gt;on the shape and then set the margin. This way the layout engine does what I am used to in DHTML. Here is an example:&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080&gt;&amp;lt;DockPanel Width="100" Height="75" Background="#6699cc" &amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;Rectangle DockPanel.Dock="fill" Fill="gold" Margin="5" RadiusX="10" RadiusY="10" /&amp;gt;&amp;nbsp; &lt;BR&gt;&amp;lt;/DockPanel&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=2229" width="1" height="1"&gt;</description><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 dropshadow text in Avalon using ImageEffectBlur</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/21/2204.aspx</link><pubDate>Wed, 21 Jan 2004 08:10:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:2204</guid><dc:creator>ndunlap</dc:creator><slash:comments>44</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=2204</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2004/01/21/2204.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Whew! its been along time.&amp;nbsp;&amp;nbsp;There is so much to blog about regarding Avalon,&amp;nbsp;I get blogger block. (Doesn't help there are so few hours in the day... I was hoping Bush would address that in the State of the Union tonight. More tax cuts please, more hours in the day please!)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I am working on posting an article about creating a custom styled button that uses aliased properties, styled ContentPresenters, VisualTrees, VisualTriggers, vector shapes among other cool features. Will post that hopefully tonight or tomorrow night. If you want to get to it while I am working on it here it is. &lt;A id=Editor_Edit_hlEntryLink title="view: test" HREF="/ndunlap/articles/2203.aspx" target=_blank&gt;&lt;FONT face="Times New Roman" size=3&gt;http://www.longhornblogs.com/ndunlap/articles/2203.aspx&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;(Articles, cool! I'm still figuring out how all the features in this blog tool work. If I'm doing it all wrong let me know.)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A class=clsSubText id=RecentPosts__ctl6_Hyperlink3 href="http://longhornblogs.com/rwlodarc/"&gt;&lt;FONT face=Arial size=2&gt;Robert Wlodarczyk &lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;posted on 1/15 about using ImageEffectBlur. One cool way that I use this feature is to create very effective dropshadows on text. Here is a screenshot of some&amp;nbsp;text with ImageEffectBlur on a text element set in the background.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG height=267 src="http://www.dunlap.cc/lhblog/styles/dropshadow.gif" width=475&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;As a designer I am pretty excited to be able to create dropshadows that have enough fidelity and control&amp;nbsp;to compete with the shadows I can create in Photoshop. I've worked with some nasty programmatically drawn dropshadows. Usually its so bad that I resort to creating the dropshadow in Photoshop and then exporting a PNG. So far the only thing I can complain about the dropshadows I create with Avalon is that for some reason they are clipping at the top and left. I will try and figure that out soon.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;One cool thing I did too was to create a&amp;nbsp;style with a visual tree that contained two content presenters. The first ContentPresenter is the element that the blur effect gets applied to. The second ContentPresenter is the white text. These are both&amp;nbsp;aliased to the same content. The end result is really quick version of a reusable dropshadow text element. For this I used a button because I dont think we can legally do a visualtree on the text element and I refer to the Button's content property. You need to apply the actual blur effect to a ContentPresenter. I will describe creating a ContentStyle with ContentPresenter styles in the custom button article I referenced above.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&lt;FONT color=#000080&gt;&amp;lt;Style def:Name=&amp;#8220;DropShadowText&amp;#8220;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Button /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Style.VisualTree&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;nbsp; &amp;lt;Canvas&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#008000&gt;&amp;lt;!-- This&amp;nbsp;is the element you apply the ImageBlurEffect on to create the DropShadow Effect.&amp;nbsp;&amp;nbsp;--&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#000080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentPresenter def:StyleId=&amp;#8220;DropShadow&amp;#8220; Canvas.Top=&amp;#8220;1&amp;#8220; Canvas.Top=&amp;#8220;1&amp;#8220;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentControl.Content="*Alias(Target = Content)"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentControl.ContentStyle="{DropShadowContentStyle}"&amp;nbsp;/&amp;gt;&lt;BR&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;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentPresenter def:StyleId=&amp;#8220;DropShadow&amp;#8220; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;ContentControl.Content="*Alias(Target = Content)"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContentControl.ContentStyle="{WhiteTextContentStyle}"&amp;nbsp;/&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT color=#000080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/Canvas&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Style.VisualTree&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;/Style&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Now I can create text with a drop shadow on it wherever I want. &lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;Button Style=&amp;#8220;DropShadowText&amp;#8220;&amp;gt;Text with a dropshadow on it&amp;lt;/Button&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=2204" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Styles/default.aspx">Styles</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><item><title>Clipping video</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/09/1749.aspx</link><pubDate>Tue, 09 Dec 2003 23:14:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1749</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=1749</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/09/1749.aspx#comments</comments><description>&lt;FONT face=Arial&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;There are some great things you can do with Clipping. Most commonly you will use &lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/msavalon.windows/c/uielement/p/cliptobounds.aspx"&gt;&lt;FONT size=2&gt;ClipToBounds&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt; to decide whether an elements children will draw beyond the element's described dimensions. However you can really go crazy with &lt;/FONT&gt;&lt;A href="http://longhorn.msdn.microsoft.com/lhsdk/ref/ns/msavalon.windows/c/uielement/p/clip.aspx"&gt;&lt;FONT size=2&gt;Clip&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;. For example, clipping to a geometry. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This is a really cool&amp;nbsp;effect with video that we used in one of the PDC keynote demos. The following code will let you clip video to any geometric shape you provide. In the case below I clipped the video to an ellipse. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;lt;Video ID="myVideo"&amp;nbsp; Begin="Indefinite" Width="800" Height="600"&amp;nbsp;Source=&amp;#8221;myVideo&amp;#8221;&amp;nbsp; Stretch="Fill" &amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Video.Clip&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryCollection&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;EllipseGeometry Center="300,300" RadiusX="300" RadiusY="300" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GeometryCollection&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#006400 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!--&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;GeometryCollection CombineMode="Xor"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RectangleGeometry Rect="0 0 200 200" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RectangleGeometry Rect="100 100 200 200" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/GeometryCollection&amp;gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#006400 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;--&amp;gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/Video.Clip&amp;gt; &lt;BR&gt;&amp;lt;/Video&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The second geometry provided describes two shapes that are combined similar to path operations in tools like&amp;nbsp;Illustrator and Freehand. Remove the first GeometryCollection and uncomment the second to try it out. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;I've posted a project for this &lt;/FONT&gt;&lt;A href="http://www.dunlap.cc/lhblog/ClippingVideo/ClippingVideo.zip"&gt;&lt;FONT face=Verdana&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;.&amp;nbsp;The video in this&amp;nbsp;is using a hard coded path &amp;#8220;c:\video\video.wmv&amp;#8221; because relative paths on video&amp;nbsp;weren't working for me in&amp;nbsp;4051 build.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;FONT size=2&gt;&lt;STRONG&gt;Here is what it looks like:&lt;BR&gt;&lt;BR&gt;&lt;/STRONG&gt;&lt;IMG src="http://www.dunlap.cc/lhblog/ClippingVideo/ClippingVideo.jpg"&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Verdana size=2&gt;You could use this to provide&amp;nbsp;extremely custom ways&amp;nbsp;of hosting video in your application. Clipping the video to fit into a space age television set, or making video fit into branding elements, etc. &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Verdana size=2&gt;Over my next few post's&amp;nbsp;I'm going to create a highly customized button with clipped video incorporated into it. This should give me a chance to go over a few of my other favorite features like DrawingBrush, multiple timelines, and we can get into a bit of styling in Avalon.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/IMG&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1749" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/ndunlap/archive/tags/Video/default.aspx">Video</category></item><item><title>Design Eye for the Dev Guy</title><link>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/08/1676.aspx</link><pubDate>Tue, 09 Dec 2003 01:15:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:1676</guid><dc:creator>ndunlap</dc:creator><slash:comments>24</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/ndunlap/rsscomments.aspx?PostID=1676</wfw:commentRss><comments>http://www.windows-now.com/blogs/ndunlap/archive/2003/12/08/1676.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;Who I am, what I do and what's it to ya?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I have the luck and good fortune of being a designer on Avalon. Previously I was a designer on the IE SDK team where I picked up a bunch of DHTML skills. Match those skills with some proficiency in designer&amp;nbsp;apps like Photoshop, Illustrator, After Effects, Flash, etc., and I get a job where I get to design UI for the most robust and incredibly powerful platform I have ever seen. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Seriously, I am pretty lucky. I have developers coming into my office asking me to&amp;nbsp;dream up cool ways to show off&amp;nbsp;their features in the platform that I know most designers would wet their pants for (for instance compositing multiple broadcast quality video elements with alpha masking...mmm...yummy). &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I see alot of excitement in the developer community for Avalon, but the people who should be getting really excited about this are the designers. We are the ones who get to see our visions become a reality. Imagine not feeling like your designs were going to be trashed with compromises when it comes time to implement them. No more hacky workarounds to pull off the visual effects that you intend. Rather, with Avalon, designers get the joy of working with elegant solutions that compliment the way that your visuals were dreamed up in your favorite design tool. Of course Im biased, but&amp;nbsp;I'm not afraid to&amp;nbsp;let the technology prove the pudding.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;STRONG&gt;So thats where this blog comes into play...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;My goal with&amp;nbsp;my blog is to get the word out on some of these cool features and showcase cool ways to use them. I'll be posting as many common designer tips and tricks as I can. Feel free to challenge me with some cool ideas that you would like to see pulled off in Longhorn.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Oh yeah, just a warning... I'm a designer. My developer skills are pretty lame. I pride myself in being able to understand the most basic programming skills, but when it comes down to it, I really only shine when I'm working in markup or designer tools (just another testament to the simplicity of the platform).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=1676" width="1" height="1"&gt;</description></item></channel></rss>