<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aimee Gurl... &#187; techfriday</title>
	<atom:link href="http://aimeegurl.com/tag/techfriday/feed/" rel="self" type="application/rss+xml" />
	<link>http://aimeegurl.com</link>
	<description>for as long as i can remember, technology has always fascinated me</description>
	<lastBuildDate>Thu, 29 Jul 2010 03:28:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>TechFriday: Amazon Kindle 2.5 Update!</title>
		<link>http://aimeegurl.com/2010/06/11/techfriday-amazon-kindle-2-5-update/</link>
		<comments>http://aimeegurl.com/2010/06/11/techfriday-amazon-kindle-2-5-update/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 07:50:03 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[techfriday]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/?p=984</guid>
		<description><![CDATA[<p id="top" />So i was quite excited when i was browsing around the Kindle Facebook page and saw some buzz about how the kindle 2.5.2 update was available for international users. It posted a link to the engadget article who in turn links to the forums. I had a bit of difficulty downloading the files [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />So i was quite excited when i was browsing around the <a href="http://www.facebook.com/kindle">Kindle Facebook page</a> and saw some buzz about how the kindle 2.5.2 update was available for international users. It posted a link to the <a href="http://www.engadget.com/2010/06/10/kindle-2-5-2-firmware-available-for-manual-update-but-only-for/">engadget article</a> who in turn links to the forums. I had a bit of difficulty downloading the files listed on <a href="http://www.kindleboards.com/index.php/topic,24554.msg490359.html#msg490359">kindleboards</a> so for those having trouble with the files, I&#8217;ve uploaded them onto my skydrive. You shouldn&#8217;t trust files people put up for you to run on your devices though, it&#8217;s a dangerous habit. <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
DOH i think the skydrive updates are messing with the links.. i guess you&#8217;ll have to try getting the links from the forums. <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedicon.aspx/Blog%20Assets/Kindle%20Updates"></iframe></p>
<p>To update your kindle, copy the files one by one to your kindle, trigger an update through the menu -&gt; settings -&gt; menu &#8211; update your kindle option</p>
<p>Do this for the files in the following order:</p>
<p>Update &#8230;. 2.3.3</p>
<p>Update &#8230; 2.3.4</p>
<p>Update_4311&#8230;490480060</p>
<p>your kindle may already intermediary updates already (mine was fresh at 2.3) so install the appropriate ones. Okay, I&#8217;m off to play with my newly updated kindle!</p>
<p>*For those who want to update, note that this update is for devices with serial numbers starting B003, i.e . the Global Wireless ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2010/06/11/techfriday-amazon-kindle-2-5-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Techfriday: Looping Panorama for Windows Phone 7 Series</title>
		<link>http://aimeegurl.com/2010/03/26/tech-friday-panoramic-looping-exercise/</link>
		<comments>http://aimeegurl.com/2010/03/26/tech-friday-panoramic-looping-exercise/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 16:39:00 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[expressionblend]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2010/03/26/tech-friday-panoramic-looping-exercise/</guid>
		<description><![CDATA[<p id="top" />
<p>Just a quick note:&#160; I’m sure MS will be providing controls to this interface in the future so we don’t have to spend too much time building these controls ourselves  This post, as with the previous one, was meant more as an Expression Blend Exercise for myself to be explore the features [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>Just a quick note:&#160; I’m sure MS will be providing controls to this interface in the future so we don’t have to spend too much time building these controls ourselves <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://aimeegurl.com/wp-content/uploads/2010/03/wlEmoticonsmile2.png" /> This post, as with the previous one, was meant more as an Expression Blend Exercise for myself to be explore the features of Silverlight / Windows Phone 7 and Expression Blend to see how much can be done with what we have today. </p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:8070ac6e-1c02-408e-bf96-370447cfb807" class="wlWriterEditableSmartContent">
<div><object width="482" height="361"><param name="movie" value="http://www.youtube.com/v/3Da1DUf5W-I&amp;hl=en&amp;fs=1&amp;hl=en"></param><embed src="http://www.youtube.com/v/3Da1DUf5W-I&amp;hl=en&amp;fs=1&amp;hl=en" type="application/x-shockwave-flash" width="482" height="361"></embed></object></div>
<div style="width:482;clear:both;font-size:.8em;color:#000000">This is more of an Expression Blend exercise to simulate a looping panoramic interface on Windows Phone 7</div>
</div>
<p>There’s one annoying thing that I can’t figure out though: on the first scroll, you’ll notice from the video that the screen flickers. There’s probably something I’m doing wrong here but I just can’t figure it out yet <img class="wlEmoticon wlEmoticon-sad" alt="Sad" src="http://aimeegurl.com/wp-content/uploads/2010/03/wlEmoticonsad.png" /></p>
<p>So I had set out to accomplish two things: Simulate the looping background and sections in the panoramic interface on windows phone and instead of flicking, let the user touch and drag the controls from left to right before switching. I was able to accomplish the two, but like I mentioned, there’s an annoying thing that happens on the first transition from state one to state two. Another thing that’s wrong with this sample is that, I shouldn’t be switching states right away on a drag to left or drag to right. You should be able to pan a bit and the screen holds to that position till you pan to a certain threshold before the interface snaps to the next section. But yeah, maybe next time.</p>
<p>The first challenge was implementing the drag to next state instead of the flick. I couldn’t really isolate this into either a trigger or an action as it’s actually a combination of both, therefore a behavior. Basically, depending on the sum of the left and right value of the users drag motion, I trigger either GoToNextState() or GoToPreviousState(). Code for these two were modified from <a title="http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack" href="http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack">http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack</a>.</p>
<p> <a href="http://aimeegurl.com/wp-content/uploads/2010/03/image18.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb19.png" width="563" height="262" /></a>
<p>So I built a PanoramicPanningBehavior that has a few properties I can set. </p>
<p>First there are&#160; the <strong>BackgroundElement</strong>, <strong>SectionsElement</strong>, <strong>TitleElement</strong>. I want them to be grouped so when it’s time for me to handle the drags, they don’t necessarily have to move at the same pace. That’s when the <strong>BackgroundMovementFactor</strong> and <strong>TitleMovementFactor </strong>come to play. Intstead of translating the background and title according to the value of the drag, I multiply it by the specified factor first. I’ve also let myself specify the <strong>StateGroup</strong> that has the states of our sections as described in <a href="http://aimeegurl.com/2010/03/18/panoramic-navigation-on-windows-phone-7-with-no-code">my previous post</a>, just in case you have other stategroups in the scene (though I haven’t tested this yet ^_^)</p>
<p> Now that I have the essential parts of my UI identified, I can now define what I want to do with them in my behavior when I start handling the events ManipulationDelta and ManipulationCompleted.   <br /> 
<p>&#160;</p>
<p>&#160;</p>
<p>First for ManipulationDelta, I first check to see whether the parts are not null, and then based on the input factors, I apply them to the Translation.X property of the DeltaManipulation, or basically the change in the touch points and assign the value to the TranslateX properties of the CompositeTransform of the elements that have been identified through the properties. I think it’s better to read the code <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://aimeegurl.com/wp-content/uploads/2010/03/wlEmoticonsmile2.png" />&#160;</p>
<pre class="code"><span style="color: blue">void </span>RootVisual_ManipulationDelta(<span style="color: blue">object </span>sender, <span style="color: #2b91af">ManipulationDeltaEventArgs </span>e)
     {
         <span style="color: blue">if </span>(!e.IsInertial)
         {
             <span style="color: blue">if </span>(BackgroundElement != <span style="color: blue">null</span>) {
                 <span style="color: blue">var </span>BG = getElement(BackgroundElement).RenderTransform <span style="color: blue">as </span><span style="color: #2b91af">CompositeTransform</span>;
                 BG.TranslateX += e.DeltaManipulation.Translation.X * BackgroundMovementFactor;

             }
             <span style="color: blue">if </span>(SectionsElement != <span style="color: blue">null</span>) {
                 <span style="color: blue">var </span>SE = getElement(SectionsElement).RenderTransform <span style="color: blue">as </span><span style="color: #2b91af">CompositeTransform</span>;
                 SE.TranslateX += e.DeltaManipulation.Translation.X;

             }
             <span style="color: blue">if </span>(TitleElement != <span style="color: blue">null</span>) {
                 <span style="color: blue">var </span>TE = getElement(TitleElement).RenderTransform <span style="color: blue">as </span><span style="color: #2b91af">CompositeTransform</span>;
                 TE.TranslateX += e.DeltaManipulation.Translation.X* TitleMovementFactor;
             }

         };
     }</pre>
<p>&#160;</p>
<p>If I wanted to run the project at this point, I’ll have to create a stateGroup and the section states in order for this not to go haywire. When I recreated the project, I actually added the panning behavior last. Next we’ll see the reason why I say this is meant more as an exercise for myself (and maybe for building demo apps) than production code. I think from this screenshot you can more or less figure out what I did.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image19.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb20.png" width="1024" height="591" /></a></p>
<p>Okay, so seeing as how you’re able to, from the leftmost part of your UI, be able to pan even more to the left to peek and even transit into the rightmost section, there had to be something there. And since I didn’t want to duplicate all the controls, I wanted to use WPF’s VisualBrush. Sadly, this isn’t available for Silverlight, however, I did find this: <a href="http://dotneteers.net/blogs/vbandi/archive/2009/03/26/discovering-silverlight-3-poor-man-s-visualbrush-behavior.aspx">http://dotneteers.net/blogs/vbandi/archive/2009/03/26/discovering-silverlight-3-poor-man-s-visualbrush-behavior.aspx</a> When I tested it out, it wasn’t as performant as WPF’s visual brush, but since I only needed to draw the UI once, I thought this would do.If we had the PathListBox in WP7, that would have been a better option too.</p>
<p>If you look at my visual tree, I basically created a brush for the background image(<strong>image</strong>), the <strong>TitleGrid </strong>and the <strong>ContentGrid</strong> (which you won’t see since I collapsed it because there were more stuff inside. Next, you’ll notice that these elements are inside a stack and before and after each of them is a Rectangle. Basically, I created identically sized rectangles that use as brushes the PoorMansVisualBrush.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image20.png"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb21.png" width="304" height="238" /></a>To do this, after adding a reference to the PoorMansVisualBrush (which I’ve made a WP version of ), I select the Rectangle and temporarily choose, TileBrush, click on Advanced Options in the <strong>Fill </strong>property and select <strong>Convert to New Resource… </strong>This will prompt me with a dialog to create a new brush resource and I’ll name it accordingly. In this Case, I have BackgroundBrush.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image21.png"><img style="border-bottom: 0px; border-left: 0px; margin: 0px 20px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb22.png" width="648" height="434" /></a> </p>
<p>Next, with the behavior selected, I set the properties accordingly. Most important to note is to set the UpdateIntervalDuration to 00:00:00 so that the behavior doesn’t waste resources by repainting the brush. Next, you’ll want to go to each of the rectangles and assign their fill properties to the BrushResources you created. Also remember to set the <strong>Stroke </strong>to <strong>No brush </strong>especially if you have background images that are supposed to seamlessly merge the leftmost and rightmost portions. Now the tedious part is doing this for all the rectangles. <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://aimeegurl.com/wp-content/uploads/2010/03/wlEmoticonsmile2.png" />&#160;</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image22.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb23.png" width="856" height="373" /></a></p>
<p>
  <br />The last, and yet another tricky part is setting up the states. What you’re seeing here is pretty much the same as the last post where I have 3 states, to show my 3 sections. Note that when you position the states, you’ll want to position the actual to the middle/actual objects. It’ll probably be too difficult to set up using the rectangles with the brushes anyway since they don’t render at design time ^_^. Here, you’ll notice I’ve added custom transitions for when Section1State goes to Section3State and vice versa.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image23.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb24.png" width="978" height="340" /></a> </p>
<p>To do this, I’ll click on add transition button and select Section1State –&gt; Section3State </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image24.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb25.png" width="473" height="163" /></a> </p>
<p></p>
<p>In order to see what I’m doing better, I’ll switch to the Animation Workspace by pressing the function key [<strong>F6]. </strong>I’ve also minimized the stacks back so it’s easier to manage. With the transition to <strong>Section3State </strong>selected I’ll record a keyframe at the start, and end of the .5s transition.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image25.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb26.png" width="849" height="418" /></a></p>
<p>When I record a key frame at the end, it’ll actually default to moving to the right most part of the actual controls which I changed to the one below. I’ve highlighted the outlines of the rectangles that mimic the actual controls.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/03/image26.png"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb27.png" width="874" height="480" /></a> </p>
<p></p>
<p>Do the same for transitioning Section3State-&gt;Section1State. What will happen here is the application will play this custom transition animation to showing the visual brushes and when the transition is done, it’ll switch to the destination state where the real controls are visible. </p>
<p></p>
<p>Run the app to test and that’s it!</p>
<p>Again, not an ideal solution for production but at least I got to learn a few more useful things in Blend that might be useful in the future.</p>
<p> I’ve uploaded the code here so if you want to test it out, download the zip file, rightclick –&gt; properties –&gt; Unblock to avoid getting those dll not found / inaccessible errors.<a href="http://aimeegurl.com/wp-content/uploads/2010/03/image27.png"><img style="border-bottom: 0px; border-left: 0px; margin: 11px 20px 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://aimeegurl.com/wp-content/uploads/2010/03/image_thumb28.png" width="254" height="350" /></a></p>
<p>&#160;</p>
<p>
  </p>
<p><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedicon.aspx/Projects/TechFriday/Panoramic%20Drag/PanoramaDrag.zip" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2010/03/26/tech-friday-panoramic-looping-exercise/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>TechFriday: iPadding V1 &#8211; The Designer Story</title>
		<link>http://aimeegurl.com/2010/02/05/ipadding-v1-the-designer-story/</link>
		<comments>http://aimeegurl.com/2010/02/05/ipadding-v1-the-designer-story/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 05:52:00 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[expression blend]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/?p=837</guid>
		<description><![CDATA[<p id="top" />With the whole iPad buzz going around last week, I decided to build last friday’s TechFriday app around the theme.</p>
<p>Introducing iPadding v1! It’s basically a WPF application that allows you to drag and drop shortcuts onto the screen and save it for when it’s presentation time. My desktop is constantly cluttered and as [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image.png"><img style="margin: 0px 20px; display: inline; border-width: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb.png" border="0" alt="image" width="389" height="480" align="left" /></a>With the whole iPad buzz going around last week, I decided to build last friday’s TechFriday app around the theme.</p>
<p>Introducing iPadding v1! It’s basically a WPF application that allows you to drag and drop shortcuts onto the screen and save it for when it’s presentation time. My desktop is constantly cluttered and as much as I’d like to use the hide desktop icons features, I do want some shortcuts readily available. Even with the pinning feature of Windows 7, I just end up with a cluttered task bark instead <img class="wlEmoticon wlEmoticon-sad" src="http://aimeegurl.com/wp-content/uploads/2010/02/wlEmoticonsad.png" alt="Sad" /> What I’ve been doing till now is creating a folder with the shortcuts of everything I want to show so i just have that pinned (or open by default) onto my taskbar.</p>
<p>So for TechFriday, I decided to make this little app that will store shortcuts in a window that looks like the iPad (<a href="http://www.benzinga.com/did-apple-copy-the-ipad-from-the-p88-aapl">or should i say P88?)</a>.</p>
<p>Version 1 includes the following features:</p>
<ul>
<li>Drag &amp; Drop items onto the screen</li>
<li>Click and Delete shortcuts that you want removed</li>
<li>Double-clicking to start an application</li>
<li>ClickOnce deployment enabling ease of deployment and distributing updates</li>
<li>and of course, clicking the button formerly know as the start button to save your shortcuts and shut down <img class="wlEmoticon wlEmoticon-smile" src="http://aimeegurl.com/wp-content/uploads/2010/02/wlEmoticonsmile.png" alt="Smile" /></li>
</ul>
<p>You can check out the application at <a title="http://bit.ly/b7893s" href="http://bit.ly/b7893s">http://bit.ly/b7893s</a> and explore the source code here.</p>
<p>How I did it?</p>
<p><strong>iPadding States</strong></p>
<p>If you open up the project you’ll find the following state groups. (The third state is currently not supported in this release <img class="wlEmoticon wlEmoticon-smile" src="http://aimeegurl.com/wp-content/uploads/2010/02/wlEmoticonsmile.png" alt="Smile" />)</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image1.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb1.png" border="0" alt="image" width="308" height="208" /></a></p>
<p>The iPadLoading state simple sets the opacity of a canvas with the “broken window” logo to 100% while the iPadLoaded state does the reverse.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image2.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb2.png" border="0" alt="image" width="822" height="714" /></a></p>
<p><strong>iPadding Components</strong></p>
<p>For this version, we only have two major components to the app: <strong>icApps </strong>and <strong>btnStart</strong></p>
<p>Let’s start with the <strong>btnStart</strong> as it is the easiest. This control is basically a styled button.</p>
<p>1. Start by adding a button onto the screen, then right-clicking, Edit Template –&gt; Edit a Copy</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image3.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb3.png" border="0" alt="image" width="864" height="810" /></a></p>
<p>You’ll then be prompted with a dialog box that will allow you to specify properties of this style. First is the Name, second is where you want to define the style in. The default is set to <strong>This Document</strong> which means the style will only be visible in this screen/page/usercontrol. <strong>Application </strong>will allow the style to be visible to the other pages/windows/usercontrols in the application. You can also select <strong>Resource dictionary </strong>to put the style in a separate file altogether and allow you to import the Resource Dictionary along with all the styles defined in it in other projects and applications.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image4.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb4.png" border="0" alt="image" width="467" height="261" /></a></p>
<p><strong> </strong></p>
<p>For this button style, I made use of images to for 2 of the different button states: MouseOver and Normal.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image5.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb5.png" border="0" alt="image" width="302" height="136" align="left" /></a></p>
<p>The default style of the button contains the chrome and a ContentPresenter. The ContentPresenter is basically where Button.Content will be displayed. If you’ve been playing with WPF/Silverlight, you’ll know that you can not only assign text to as button contents, but images, videos and other controls as well.</p>
<p>In this case, I just want a simple image, so I can go ahead and delete the default contents and replace it with a grid that contains my button images. In this case, I added 2 images, one to depict the button in Normal state, and another on MouseOver state.</p>
<p>When you click on a state, you’ll notice the state recording turns on.Once this is so, you can start changing properties of your design elements to reflect your desired look.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image6.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb6.png" border="0" alt="image" width="590" height="492" /></a><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image7.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb7.png" border="0" alt="image" width="589" height="493" /></a></p>
<p>Now we’re pretty much done with the StartButton design. Let’s put in a stub where our developer can plug in the code to make the app function as it is supposed to. To do this, let’s first return to the Window Scope</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image8.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb8.png" border="0" alt="image" width="320" height="190" /></a></p>
<p>Next, while the button is selected, go to the properties tab an click on events.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image9.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb9.png" border="0" alt="image" width="320" height="98" /></a></p>
<p>Once the tab is activated, you can type in the method name you want called on the Click event</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image10.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb10.png" border="0" alt="image" width="320" height="186" /></a></p>
<blockquote><p>Doing this will activate the XAML editor in Blend and automatically insert the method stub for you or your developer to fill in once you are ready to start filling in the application logic. Let’s leave this for now and go on to the next component.</p></blockquote>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image11.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb11.png" border="0" alt="image" width="844" height="479" /></a></p>
<p>The next control is <strong>icApps </strong>is a styled ItemsControl that will contain all the apps that you drag and drop into the window. Let’s first go to our Asset Library and drop in the ItemsControl onto our Window. You might want to drop it into a Grid to fix the layout.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image12.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb12.png" border="0" alt="image" width="834" height="300" /></a></p>
<p>Next, we need to think about how we want to layout the items in our control. If you look at the iPhone, the apps are actually lined up in a 4 x 5 grid. However, since in the future, I’d like to be able to resize the screen and have the apps line up depending on the space, I’ll use a WrapPanel to manage the layout. To do this, I’ll right-click on the ItemsControl –&gt; Edit Additional Templates –&gt; Edit Layout of Items &#8211; &gt;Edit a Copy. Again this will bring you a dialog box that will allow you to name and specify where you want your style created.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image13.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb13.png" border="0" alt="image" width="968" height="553" /></a></p>
<p>You’ll notice that the default layout is a StackPanel, but we’ll go ahead and change this into a WrapPanel.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image14.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb14.png" border="0" alt="image" width="528" height="474" /></a></p>
<p>You might also want to ensure that the ScrollBarVisibilities are properly set. I’ll be disabling scrolling for this version till I figure out how I want to page / scroll through my items.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image15.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb15.png" border="0" alt="image" width="311" height="222" /></a></p>
<p>Now that we have the layout set, we’ll now take a look at the template for generated items. So same as before, right-click on the ItemsControl -&gt; Edit Additional Templates –&gt; Edit Generated Items –&gt; Edit a Copy. If you’re wondering why it’s “Edit a Copy”, WPF controls come with default templates that developers and designers can easily replace but because Blend needs to have a fall back in cases of new controls, the default templates are stored somewhere and are read-only for us. But we can always create our own style and set it as a default for all the controls in our project by selecting <strong>Apply to All </strong>in the <strong>Create Style Resource</strong> dialog.</p>
<p>I want the Apps to be visualize as buttons that can get focus when clicked so that the users can delete them if he chooses to, and launch the application when double clicked. I don’t want to recreate a control as the Button control can pretty much do what I need it to do. So what I’ll do in my data template is add a 120&#215;120 grid to constrain the button size, and put a button inside and style it as I want and for this I’ve created a style called AppButton style. that has the following:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image16.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb16.png" border="0" alt="image" width="264" height="517" align="left" /></a>You’ll notice that since I’m styling a button, the template already comes with the common button states such as MouseOver and FocusStates. This will make it much easier for me to fix my controls visuals through states instead of having to code it all up myself.</p>
<p>If you look at the object tree, I have an image will I will later on show how I tie up to the Icon of whatever shortcut is dragged into my app. I have a text block that will also display the name of that shortcut, and two rectangles that will basically be my MouseOverVisual and FocusVisual. Both these visuals have an opacity of 0% by default, and I simply edit the corresponding states to set the opacity to 100%.</p>
<p>I mentioned that for the image and text block, I wanted it to be bound to whatever the icon and name was used in the shortcut dragged into the app. Later on we’ll be using the ShellObject defined in the <a title="http://code.msdn.microsoft.com/WindowsAPICodePack" href="http://code.msdn.microsoft.com/WindowsAPICodePack">http://code.msdn.microsoft.com/WindowsAPICodePack</a> The ShellObject data object has quite a number of properties but the one I’m intersted in would be Thumbnail, which is an Icon object which in turn has a MediumBitmapSource (medium because we’re looking at displaying bigger icons than the ones we see in details view of explorer) and Name, which will hold the filename on the shortcut.</p>
<p>As a designer, all I care about would be that those two properties of the data object will be present when the time comes. I can use data binding to link the properties of the data object with properties in my UI.</p>
<p>First off is the TextBlock. With the the TextBlock selected, I’ll head over to the properties panel and look for the text property since this is what I want to bind to the Name property of the data object. I can do so by clicking on the button right beside the Text textbox.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image17.png"><img style="display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb17.png" border="0" alt="image" width="293" height="48" /></a></p>
<p>I’ll then select Data Binding.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image18.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb18.png" border="0" alt="image" width="315" height="320" /></a></p>
<p>You can data bind this the Text property to virtually anything as you’ll see in the dialog box that pops up, from data fields, to other elements properties. In this case, since we don’t have access to our data objects just yet, I’ll go straight to Explicit Data Context and tick the “Use a custom path expression” and put in the Name property. Again as a designer, I don’t have to care where that value comes from but i know that whatever data object is bound to this button, I’ll get access to a property called Name that will hold the name of the application or shortcut of the app I want to run.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image19.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb19.png" border="0" alt="image" width="618" height="583" /></a></p>
<p>I’ll do the same for the img object with the source property. This time, I’m binding it to “Thumbnail.MediumBitmapSource” since my developer tells me, there’s an existing object that we can use and that property is going to give me the filename of the icon i can use in my button.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image20.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb20.png" border="0" alt="image" width="609" height="579" /></a></p>
<p>Now that’s done, let’s help out our developer a little bit.We’ve decided that the behavior of this app is such that if a button is clicked, it’ll bring focus to that button. This is already the default behavior of a button and since we’ve only styled a button and not made our own, we won’t have to worry about building that behavior. The next behavior is that when double clicked, it runs the application associated with it. To do this, let’s exit scope one level up to the AppButton. We can either do as we did previously by clicking on the up arrow <a href="http://aimeegurl.com/wp-content/uploads/2010/02/image21.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb21.png" border="0" alt="image" width="211" height="32" /></a>or by clicking AppButton on the bread crumb bar at the top of the XAML designer page: <a href="http://aimeegurl.com/wp-content/uploads/2010/02/image22.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb22.png" border="0" alt="image" width="320" height="70" /></a> </p>
<p>With the AppButton selected, we’ll go to the events tab <a href="http://aimeegurl.com/wp-content/uploads/2010/02/image23.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb23.png" border="0" alt="image" width="51" height="33" /></a>on the Properties page, go to MouseDoubleClick and type in a name of method that will hold the code to run the shortcut associated to the button. <img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb24.png" border="0" alt="image" width="278" height="31" />Once we press enter, we’ll be brought to the code behind and we can write a little note to our developer to put in that piece of code here. If as a designer, later on you feel that it’ll be better to have the application run at a different event, you can simply move that method name to another event in the events list, and your developer won’t have to change their code.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2010/02/image24.png"><img style="margin: 0px 20px; display: inline; border: 0px;" title="image" src="http://aimeegurl.com/wp-content/uploads/2010/02/image_thumb25.png" border="0" alt="image" width="657" height="112" /></a></p>
<p>Once that’s done, we can exit again till we’re all the way up on the window level. What we have done is basically create an ItemsControl with our custom style that displays a square button and a text block (as well as some visuals for mouse over and focus states). We’ve styled these buttons in such a way that the images and textblocks are bound to properties Name and Thumbnail.MediumBitmapSource. The idea here is that our developer will eventually bind this ItemsControl with a list of ShellObjects which we are told have those properties. Each shell object will be bound to a generated item with the template we defined. We’ve also created a method for our developer to implement that runs the associated application when the button is double clicked.</p>
<p>Next post will cover the developer portion of this application. <img class="wlEmoticon wlEmoticon-smile" src="http://aimeegurl.com/wp-content/uploads/2010/02/wlEmoticonsmile.png" alt="Smile" /> For now, you can download and try out the application on <a href="http://www.badgorilla.net/ipadding">http://www.badgorilla.net/ipadding</a></p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2010/02/05/ipadding-v1-the-designer-story/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Happy Holidays Everyone!</title>
		<link>http://aimeegurl.com/2009/12/22/happy-holidays-everyone/</link>
		<comments>http://aimeegurl.com/2009/12/22/happy-holidays-everyone/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 19:11:15 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[expressionblend]]></category>
		<category><![CDATA[expressiondesign]]></category>
		<category><![CDATA[silverlight4]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[visualstudio2010]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/12/22/happy-holidays-everyone/</guid>
		<description><![CDATA[<p id="top" />
<p>I was listening to some Christmas music today and the holiday spirit got the best of me. I managed to make a customizable e-greeting card using Silverlight 4. Since MS has only released a developer beta and no go-live license, users will have to manually download the Silverlight 4 beta plugin. I modified [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>I was listening to some Christmas music today and the holiday spirit got the best of me. I managed to make a customizable e-greeting card using Silverlight 4. Since MS has only released a developer beta and no go-live license, users will have to manually download the Silverlight 4 beta plugin. I modified the html code that the Silverlight SDK spits out to show this image and redirect it straight to the <a href="http://silverlight.net/getstarted/silverlight-4-beta/#tools">Silverlight Tools Page</a>:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/12/MerryChristmas.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="MerryChristmas" border="0" alt="MerryChristmas" src="http://aimeegurl.com/wp-content/uploads/2009/12/MerryChristmas_thumb.png" width="674" height="527" /></a></p>
<p>I didn’t want to reinvent the wheel so I used some code that was already out there:</p>
<p><a href="http://www.wintellect.com/CS/blogs/jprosise/archive/2009/07/17/fun-with-savefiledialog-and-writeablebitmap.aspx">http://www.wintellect.com/CS/blogs/jprosise/archive/2009/07/17/fun-with-savefiledialog-and-writeablebitmap.aspx</a></p>
<p>- Code to encode an image to PNG and save to local hard drive</p>
<p><a href="http://channel9.msdn.com/learn/courses/Silverlight4/MagicMirror/MagicMirror/">http://channel9.msdn.com/learn/courses/Silverlight4/MagicMirror/MagicMirror/</a></p>
<p>- Silverlight 4 code to capture images from a Web Camera and Print</p>
<p>Tools I used:</p>
<p><a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx">Visual Studio 2010 Beta 2</a>&#160;</p>
<p><a href="http://www.microsoft.com/expression/products/Design_Overview.aspx">Microsoft Expression Design</a></p>
<p><a href="http://www.microsoft.com/expression/products/Blend_Overview.aspx">Microsoft Expression Blend Preview for .NET 4</a></p>
<p>And here’s the app! And yes, this qualifies for a TechFriday cause Christmas is on a&#8212; FRIDAY!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/12/22/happy-holidays-everyone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Your Win7 JumpLists Trigger on the Same Application Instance</title>
		<link>http://aimeegurl.com/2009/11/13/making-your-win7-jumplists-trigger-on-the-same-application-instance/</link>
		<comments>http://aimeegurl.com/2009/11/13/making-your-win7-jumplists-trigger-on-the-same-application-instance/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 08:56:00 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[Windows7]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/11/13/making-your-win7-jumplists-trigger-on-the-same-application-instance/</guid>
		<description><![CDATA[<p id="top" />
<p>As promised in my previous post, I’ll be talking about how to create jumplist integrated single instance applications, much like how Outlook, Windows Media Player. </p>
<p>At first, i thought it would need to involve a bit of windows messaging but then I found this blog post that details how to create single instance [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>As promised in <a href="http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/">my previous post</a>, I’ll be talking about how to create jumplist integrated single instance applications, much like how Outlook, Windows Media Player. </p>
<p>At first, i thought it would need to involve a bit of windows messaging but then I found <a href="http://www.switchonthecode.com/tutorials/wpf-writing-a-single-instance-application">this blog post</a> that details how to create single instance WPF applications. I rewrote our sample from the previous post to adopt this model. I based my code on the post so I recommend reading that post first to have a better understanding of how we are creating this single instance application.</p>
<p>Explaining a bit what is going on here, we basically have 3 major classes:</p>
<p><img style="border-right-width: 0px; margin: 0px 20px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://aimeegurl.com/wp-content/uploads/2009/11/image8.png" width="333" height="425" /> </p>
<p>The <strong>SingleInstanceManager</strong>, as the name implies, manages the instances of your application. If you take a look at the code, basically it creates an instance of your application if it is an initial startup. When a next instance is triggered to start up, it activates the the MainWindow through Win7Application and processes any arguments passed in the triggering of the subsequent instances.</p>
<p><strong>Win7Application </strong>is basically our replacement for App.xaml because we want to be able to control when we activate the MainWindow of our application. We also process any arguments of our application in this class. </p>
<pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">  public void ProcessArgs(string[] args, bool isFirstInstance)
        {
            if (args.Length &gt; 0)
            {
                if (isFirstInstance)
                    AppWindow.initState = args[0];
                else
                    AppWindow.updateState(args[0]);
            }

        }</pre>
<p>If you look at the ProcessArgs method in the sample attached, we’re basically setting an initial state (initState) property to the value of the argument as this is expected from the jumplists we have defined in <a href="http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/">my previous post</a>. If this is not the first instance, we call the updateState() method which I have exposed as a public method in the MainWindow class.&#160; </p>
<p>These are basically the changes I made to MainWindow.xaml.cs:</p>
<pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">        private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {

            WindowJumpList = JumpList.CreateJumpList();
            initializeJumplist();
            if (initState != null)
                updateState(initState);

        }</pre>
<pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">        public  void updateState(string state)
        {
            ExtendedVisualStateManager.GoToElementState(LayoutRoot, state, true);

        }</pre>
<p>You can download the source here:</p>
<p><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedicon.aspx/Projects/TechFriday/SingleInstance.zip" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/11/13/making-your-win7-jumplists-trigger-on-the-same-application-instance/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Managing WPF Screens with Windows 7 Jumplists and the Visual State Manager</title>
		<link>http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/</link>
		<comments>http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 08:59:00 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[Windows7]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/</guid>
		<description><![CDATA[<p id="top" />
<p>We’re having our Singapore launch of Windows 7 this November and in honor of that, I’ll be devoting my upcoming (and long overdue) TechFridays to everything Windows 7. For this post, I&#8217;ll be talking about how you can use the Visual State Manager for WPF to manage the different screen states in your [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>We’re having our Singapore launch of Windows 7 this November and in honor of that, I’ll be devoting my upcoming (and long overdue) TechFridays to everything Windows 7. For this post, I&#8217;ll be talking about how you can use the Visual State Manager for WPF to manage the different screen states in your application in conjunction with your Windows 7 Jumplists.</p>
<p>Before we start, make sure you have the following downloaded:</p>
<p>1. <a href="http://www.codeplex.com/wpf">WPF Toolkit</a> – This enables VSM support in current WPF projects</p>
<p>2. <a href="http://code.msdn.microsoft.com/WindowsAPICodePack">http://code.msdn.microsoft.com/WindowsAPICodePack</a> – provides managed wrappers that allow you to easily incorporate Windows 7 JumpLists into your application</p>
<p>* make sure you add references to the above binaries and your set to go.</p>
<p>If you’re not familiar with the Visual State Manager, you can read <a href="http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-visual-state-manager-overview.aspx">http://windowsclient.net/wpf/wpf35/wpf-35sp1-toolkit-visual-state-manager-overview.aspx</a> for a brief overview.</p>
<p>What I have is an application with several screens grouped into panels. I also have a visual state group “ScreenStates” where i have 3 states, one for each screen.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb.png" width="800" height="600" /></a></p>
<p>This should make for easier screen management. You can make use of Blend behaviors to activate these states on the click of the corresponding navigation button / link. If you open up the Behaviors tab in the asset library, you’ll find the GoToStateAction that you can click and drag onto the appropriate control that you want to trigger the state activation.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb1.png" width="673" height="281" /></a></p>
<p>In the screen below, I added the behavior to my GalleryButton. On the properties panel, you’ll see that you can set the StateName you want to activate on the trigger, in this case, the GalleryButton’s Click event.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb2.png" width="800" height="600" /></a></p>
<p>Next we we want to enable Windows 7 Jumplists in our application. Windows 7 is all about helping users become more efficient and one of the features that enable this is the jumplist. Below is a screenshot of Outlook’s jumplists. The application basically exposes tasks that would normally take a few clicks to get to so instead of having to spend the time starting the app and clicking the appropriate menus/options, you jump straight into the screen you want.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb3.png" width="370" height="349" /></a></p>
<p>Below is one way you can integrate jumplists into the app we are building. First, you’ll need to define and initialize a few variables we will be needing to manage the jumplist: the Jumplist itself, and the folder where the assembly is executing.</p>
<pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;">        private JumpList WindowJumpList;
        string executableFolder;

	private void Window_Loaded(object sender, System.Windows.RoutedEventArgs e)
	{
			// TODO: Add event handler implementation here.
            WindowJumpList = JumpList.CreateJumpList();
            executableFolder = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

            initializeJumplist();
            string[] arguments = Environment.GetCommandLineArgs();
            if (arguments.Length &gt; 1)
            {
                ProcessArguments(arguments[1]);
            }
	}</pre>
<p>The following code then initializes the jumplist. Note that the tasks are shell links to the application executable, with the state names of our screens as the arguments. This will make it easier later on to process the arguments and activate the appropriate screen.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb4.png" width="571" height="480" /></a> </p>
<p>The last method is the ProcessArguments method. There is a slight kink in the VisualStateManager that won’t allow you to “go to state” as you normally would unless the target is a UserControl. In this case, we had to use a work around which i found <a href="http://jack.ukleja.com/workaround-for-visualstatemanager-gotostate-not-working-on-window/">here</a></p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image5.png" width="785" height="90" /></p>
<p>when you compile and run your app, you’ll see the following jumplist tasks and will be able to activate the corresponding screens straight from the jumplist.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb5.png" width="439" height="465" /></a></p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/11/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/11/image_thumb6.png" width="800" height="350" /></a></p>
<p>You can download and try out the code here:</p>
<p><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedicon.aspx/Projects/TechFriday/JumplistScreenManagement.zip" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
<p>This version launches a new instance every time you click on a task on the jumplist. In my next post, I’ll post a sample on how to create jumplist enabled single instance WPF applications. Till next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/11/06/managing-wpf-screens-with-windows-7-jumplists-and-the-visual-state-manager/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TechFriday: Jumping into Jumplists</title>
		<link>http://aimeegurl.com/2009/07/10/techfriday-jumping-into-jumplists/</link>
		<comments>http://aimeegurl.com/2009/07/10/techfriday-jumping-into-jumplists/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 17:48:35 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[jumplist]]></category>
		<category><![CDATA[sample code]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[Windows7]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/07/10/techfriday-jumping-into-jumplists/</guid>
		<description><![CDATA[<p id="top" />
<p>Everybody’s excited about Windows 7 and there might be a few of you guys out there wanting to take advantage of some of the new features of the OS in your applications. In this post, I’ll show you how you can quickly add Jumplist support to your existing application (Yes, even WinForms applications)</p>
<p>In [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>Everybody’s excited about Windows 7 and there might be a few of you guys out there wanting to take advantage of some of the new features of the OS in your applications. In this post, I’ll show you how you can quickly add Jumplist support to your existing application (Yes, even WinForms applications)</p>
<p>In order to keep things simple, let’s just make the assumption that this existing application of mine has 3 very useful screens: Default, Green Mode and Red Mode ( I’m a developer, I’m not very creative ) </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb.png" width="588" height="371" /></a> </p>
<p>Because I want to save my user some additional clicks to get into green / red mode, I can take advantage of a new feature of Windows 7 called Jumplists: when a user right-clicks on my app’s icon on the Windows 7 task bar, this menu pops up and gives him access to tasks that we expect him to frequent. There are a lot of tutorials out there that teach how to add Recent/Frequent documents to this list. The samples included in the library we’ll be using will show you how.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb1.png" width="306" height="229" /></a> .</p>
<p>For this example, we’ll learn how to use our applications existing custom functions (and icons) with Windows 7 jumplists but first, download <a href="http://code.msdn.microsoft.com/Windows7Taskbar">the Windows 7 Taskbar Developer Resource</a></p>
<p>For this example, I have a very simple Hello Windows 7 application. In the application, I have a menu bar that loads up additional screens. In this case, it’s just the same screen and switching the colors, but it could easily be a function that will load up another UserControl with different functions. Productivity is key, so I’d like to allow my user to go straight to these screens on startup. </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb2.png" width="1028" height="550" /></a> </p>
<p>In order to enable this, I’ve made a method that will allow the application to switch between user screens based on command line arguments when launching the application.</p>
<pre class="code"><span style="color: blue">private void </span>ProcessArguments()
{
    <span style="color: blue">string</span>[] args = <span style="color: #2b91af">Environment</span>.GetCommandLineArgs();

    <span style="color: blue">if </span>(args.Length &gt; 1)
    {
        <span style="color: blue">if </span>(args[1].Equals(<span style="color: #a31515">&quot;/r&quot;</span>))
        {
            LoadRedScreen();
        }
        <span style="color: blue">else if </span>(args[1].Equals(<span style="color: #a31515">&quot;/g&quot;</span>))
        {
            LoadGreenScreen();
        }

    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>In this piece of code, I’m basically checking that IF there are arguments passed when running the application, I’ll be calling a method to load the appropriate UserControl (We’ve already seen that this is the same method invoked by the menu item in our Menubar).</p>
<p>Now we start using the libraries provided for us to make it easier to integrate with the Windows 7 Taskbar. But first let’s import the namespace of the library, plus some additional ones we will be using along the way</p>
<pre class="code"><span style="color: blue">using </span>Windows7.DesktopIntegration;
<span style="color: blue">using </span>System.IO;
<span style="color: blue">using </span>System.Reflection;</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Next we add the following properties to the form:</p>
<pre class="code"><span style="color: blue">string </span>appID = <span style="color: #a31515">&quot;Hello Windows 7&quot;</span>;
<span style="color: #2b91af">JumpListManager </span>jlm;
    </pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The key thing here is the JumpListManager but if you want more information on the appID and all the goodness it brings, visit <a title="http://windowsteamblog.com/blogs/developers/archive/2009/06/18/developing-for-the-windows-7-taskbar-application-id.aspx" href="http://windowsteamblog.com/blogs/developers/archive/2009/06/18/developing-for-the-windows-7-taskbar-application-id.aspx">http://windowsteamblog.com/blogs/developers/archive/2009/06/18/developing-for-the-windows-7-taskbar-application-id.aspx</a>. The next thing I have to do is override </p>
<pre class="code"><span style="color: blue">protected override void </span>WndProc(<span style="color: blue">ref </span><span style="color: #2b91af">Message </span>m)
{
    <span style="color: blue">base</span>.WndProc(<span style="color: blue">ref </span>m);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Before we start jumping into adding jumplists, we want to remember that since this is an existing application meant to be run in existing versions of Windows, we’d like to make sure that we’ll only execute the additional code IF the application is running in Windows 7, otherwise, operate as usual. To do this, we check whether the OS version is 6.1 or greater (RC builds still register Major version as 6) with this code:</p>
<pre class="code"><span style="color: #2b91af">OperatingSystem </span>os = <span style="color: #2b91af">Environment</span>.OSVersion;
<span style="color: blue">if </span>((os.Version.Major == 6 &amp;&amp; os.Version.Minor &gt;= 1) || os.Version.Major &gt; 6)
{
    <span style="color: green">//some code
</span>}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Now for the fun part. The OS message that we want to lookout for is the message that tells us that the taskbar button has been created. Then we can start adding the Jumplist items to the button.</p>
<pre class="code"><span style="color: blue">if </span>(m.Msg == <span style="color: #2b91af">Windows7Taskbar</span>.TaskbarButtonCreatedMessage)
{
    <span style="color: blue">try
    </span>{

        jlm = <span style="color: blue">new </span><span style="color: #2b91af">JumpListManager</span>(appID);
        jlm.UserRemovedItems += <span style="color: blue">delegate </span>{ };

        <span style="color: blue">string </span>strAppDir = <span style="color: #2b91af">Path</span>.GetDirectoryName(<span style="color: #2b91af">Assembly</span>.GetEntryAssembly().Location);
        <span style="color: blue">string </span>app = <span style="color: #2b91af">Assembly</span>.GetEntryAssembly().GetName().Name + <span style="color: #a31515">&quot;.exe&quot;</span>;

        jlm.AddUserTask(<span style="color: blue">new </span><span style="color: #2b91af">ShellLink
        </span>{
            Title = <span style="color: #a31515">&quot;Color it Red!&quot;</span>,
            Path = <span style="color: #2b91af">Path</span>.Combine(strAppDir, app),
            Arguments = <span style="color: #a31515">&quot;/r&quot;</span>,
            IconLocation = <span style="color: #2b91af">Path</span>.Combine(strAppDir, <span style="color: #a31515">@&quot;ico\Red.ico&quot;</span>)

        });

        jlm.AddUserTask(<span style="color: blue">new </span><span style="color: #2b91af">ShellLink
        </span>{
            Title = <span style="color: #a31515">&quot;Color it Green!&quot;</span>,
            Path = <span style="color: #2b91af">Path</span>.Combine(strAppDir, app),
            Arguments = <span style="color: #a31515">&quot;/g&quot;</span>,
            IconLocation = <span style="color: #2b91af">Path</span>.Combine(strAppDir, <span style="color: #a31515">@&quot;ico\green.ico&quot;</span>)
        });
        jlm.Refresh();

        ProcessArguments();
    }
    <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception</span>)
    {

    }</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Let’s break this down. </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb3.png" width="316" height="45" /></a> </p>
<p>We start by creating a new instance of the JumpListManager passing the appID we’ve assigned to our app. Next we register to the UserRemovedItems event as this is required if we want to refresh the JumpList after adding items to it. In this case, we do nothing when any items are removed.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb4.png" width="649" height="49" /></a> </p>
<p>Here, we get the directory where the application is running as well as the app name itself, so we can tell the JumpList link what to invoke when it is clicked. Basically it’s emulating running your app from a command prompt and passing the arguments (if any). Now we can proceed to adding our JumpList items.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb5.png" width="516" height="165" /></a> </p>
<p>I’ve mentioned we can add a few other things such as Recent Documents &amp; Frequent Documents&#160; but you’ll find lots of resources on this on the net as well as the samples for the library. In this case, we’re adding a new User Task to the jumplist which results in having these links under a “Tasks” header as below:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb1.png" width="306" height="229" /></a></p>
<p>Path, Arguments, and IconLocation are pretty self explanatory. </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb6.png" width="227" height="496" /></a> </p>
<p>I need to make sure my icons are available to my application so here I’ve placed all my custom icons in one directory and set the property so the IDE knows to copy these files to the output directory.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/07/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/07/image_thumb7.png" width="177" height="41" /></a> </p>
<p>After defining my JumpList links, I can call a Refresh on the JumpListManager so it loads up all my new links. After this, I make a call to my ProcessArguments method. This will make sure it runs the additional code if any arguments were passed when running the application. Of course, if you see that your users may want to run your app from a command line and pass arguments manually, you might want to put this call outside of the if statement or anywhere before your first form completes loading.</p>
<p>It’s that easy! If you got lost on the way, here’s the source to this project. If you manage to get your JumpLists going, feel free post a link to your app! <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedrowdetail.aspx/Projects/TechFriday/Hello%20Windows%207.zip" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
<p><strong>RESOURCES:</strong></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=12100526-ed26-476b-8e20-69662b8546c1">Windows 7 RC Training Kit for Developers</a></p>
<p>Managed APIs in this sample&#160; </p>
<ul>
<li>Windows 7 Taskbar &#8211; <a title="http://code.msdn.microsoft.com/Windows7Taskbar" href="http://code.msdn.microsoft.com/Windows7Taskbar">http://code.msdn.microsoft.com/Windows7Taskbar</a> </li>
</ul>
<p>Other Managed APIs available:</p>
<ul>
<li>Windows API Code Pack for Microsoft .NET Framework &#8211; <a title="http://code.msdn.microsoft.com/WindowsAPICodePack" href="http://code.msdn.microsoft.com/WindowsAPICodePack">http://code.msdn.microsoft.com/WindowsAPICodePack</a> </li>
<li>Windows 7 Taskbar Extensions &#8211; <a title="http://windows7taskbarext.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22682" href="http://windows7taskbarext.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22682">http://windows7taskbarext.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22682</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/07/10/techfriday-jumping-into-jumplists/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TechFriday: Building Custom Behaviors</title>
		<link>http://aimeegurl.com/2009/06/29/techfriday-building-custom-behaviors/</link>
		<comments>http://aimeegurl.com/2009/06/29/techfriday-building-custom-behaviors/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 17:57:40 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Custom Behaviors]]></category>
		<category><![CDATA[Expression Blend 3]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[techfriday]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/06/29/techfriday-building-custom-behaviors/</guid>
		<description><![CDATA[<p id="top" />
<p>Okay, I missed Tech Friday, so I decided to make it Tech Weekend instead. I attended the June Mix-It-Up: Re-MIX last Thursday and was able to catch up a bit on the new technologies. I have been busy with a few other things at work and I am ashamed to say, I have [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>Okay, I missed Tech Friday, so I decided to make it Tech Weekend instead. I attended the <a href="http://mstechevents.sg/ViewEvent.aspx?eventId=241">June Mix-It-Up: Re-MIX</a> last Thursday and was able to catch up a bit on the new technologies. I have been busy with a few other things at work and I am ashamed to say, I have been lagging behind! <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> </p>
<p>One of the things that interested me is behaviors in Silverlight 3. <a href="http://www.bing.com/search?q=behaviors+in+silverlight+3">If you do a bit of searching</a> you’ll find quite a few articles on behaviors. Basically, it’s the ability to encapsulate “behaviors” that you can reuse on different UIElements that developers can write and have their designers use (with drag and drop of course) to earn brownie points. Expression Blend 3 comes with a few behaviors out of the box. They’re the ones listed in the screen shot below, apart from the first one which is the behavior I created:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb4.png" width="618" height="453" /></a></p>
<p>My favorite, I would have to say is the MouseDragElementBehavior. To use it, all you have to do is drag and drop it to any element in your app to enable drag and drop capabilities. There’s just so much you can do for interactivity with that behavior alone. I remember this being one of the things I use to code time and time again with previous projects I used to tinker with.</p>
<p>Another behavior that I’ve always wished I could encapsulate was the “bring to front” behavior. Say you have a bunch of UI elements scattered in a pile on the screen, you sometimes want it to behave in such a way that an element you click on gets floated to the top. This is probably a behavior that you would like to use in several scenarios/apps so it makes sense to build a behavior for it, and reuse it across different projects.</p>
<p>WARNING: I think I’m using a different build of Blend so I won’t get into the details of where to get which assemblies. I’ll update this post once Blend 3 is out, but I think what’s more important is understanding how building a behavior would be like more or less.</p>
<p>Basically what I did was build a Silverlight Class Library that inherited from the Behavior generic:</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">BringToTopBehavior </span>: <span style="color: #2b91af">Behavior</span>&lt;<span style="color: #2b91af">Canvas</span>&gt;
{
<blockquote>
//some code here
</blockquote>

}</pre>
<p>When creating your own behaviors, Canvas would be the object you would like to apply your behavior to. Next thing to do is override the onAttached() method:</p>
<pre class="code"><span style="color: blue">protected override void </span>OnAttached()
{
    <span style="color: blue">base</span>.OnAttached();

    AssociatedObject.Loaded += <span style="color: blue">new </span><span style="color: #2b91af">RoutedEventHandler</span>(AssociatedObject_Loaded);

}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>AssociatedObject would be the the actual instance to which the behavior is attached. What I did here is add an event handler to the Loaded event because I wanted to attach another event handler to each of the objects that gets loaded into the canvas. I can only get the children once the UI element has finished loading. My Loaded handler looks something like this:</p>
<p>&#160;</p>
<pre class="code"><span style="color: blue">void </span>AssociatedObject_Loaded(<span style="color: blue">object </span>sender, <span style="color: #2b91af">RoutedEventArgs </span>e)
 {

     <span style="color: blue">foreach </span>(<span style="color: blue">var </span>child <span style="color: blue">in </span>AssociatedObject.Children)
     {
         child.MouseLeftButtonUp += child_MouseLeftButtonUp;
     }
 }</pre>
<p>What I’m doing is attaching a handler to the MouseLeftButtonUp event for each of the objects contained in the Canvas in question. This handler is defined as:</p>
<pre class="code"><span style="color: blue">void </span>child_MouseLeftButtonUp(<span style="color: blue">object </span>sender, System.Windows.Input.<span style="color: #2b91af">MouseButtonEventArgs </span>e)
{
    BringToTop(sender);
}</pre>
<p>I created a few private methods to handle sorting the z-orders of the elements contained in the Canvas:</p>
<pre class="code"><span style="color: blue">private void </span>BringToTop(<span style="color: blue">object </span>element)
 {

     <span style="color: #2b91af">Canvas </span>p = (<span style="color: #2b91af">Canvas</span>)((<span style="color: #2b91af">FrameworkElement</span>)element).Parent;
     <span style="color: blue">int </span>z = getHighestValue(p);
     <span style="color: blue">for </span>(<span style="color: blue">int </span>i = 0; i &lt; p.Children.Count; i++)
     {
         <span style="color: blue">var </span>child = p.Children[i];
         <span style="color: blue">if </span>(element.Equals(child))
         {
             child.SetValue(<span style="color: #2b91af">Canvas</span>.ZIndexProperty, z);
         }
     }
 }

 <span style="color: blue">private int </span>getHighestValue(<span style="color: #2b91af">Canvas </span>p)
 {
     <span style="color: blue">int </span>highest = 0;
     <span style="color: blue">foreach </span>(<span style="color: blue">var </span>child <span style="color: blue">in </span>p.Children)
     {
         <span style="color: blue">var </span>val = (<span style="color: blue">int</span>)child.GetValue(<span style="color: #2b91af">Canvas</span>.ZIndexProperty);
         <span style="color: blue">if </span>( val &gt; highest) {
             highest = val;
         }
         child.SetValue(<span style="color: #2b91af">Canvas</span>.ZIndexProperty, val - 1);
     }
     <span style="color: blue">return </span>highest;
 }</pre>
<p><a href="http://11011.net/software/vspaste"></a>This probably isn’t the best implementation of this behavior but it gets the job done <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>USING THE BEHAVIOR</strong></p>
<p>Once you’ve finished writing your behavior you can compile the code and reference that dll into any of your existing projects and start using the behaviors. Right-click on references, click Add Reference, and navigate to the compiled dll of your custom behavior.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb5.png" width="404" height="232" /></a></p>
<p>Once you’re done, you should be able to make use of this behavior through blend. In my case, I can click and drag BringToTopBehavior to my chosen Canvas and I would see the following:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb6.png" width="564" height="745" /></a></p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb7.png" width="345" height="262" /></a></p>
<p>Now you’ll notice, however, when I try to drag and drop the behavior to the Grid panel, it tells me that it’s not a valid drop target.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb8.png" width="348" height="173" /></a></p>
<p>This is because, in my definition of my behavior, I’d specified that this behavior can be applied only to Canvases. But now, I realize the same behavior can apply to any Panel object. What I can do now is update my behavior definition to, instead of Canvas, have it apply to Panel instead:</p>
<pre style="width: 99.47%; height: 251px" class="code"><span style="color: blue">public class </span><span style="color: #2b91af">BringToTopBehavior </span>: <span style="color: #2b91af">Behavior</span>&lt;<span style="color: #2b91af">Panel</span>&gt;
  {
      <span style="color: green">//somecode
      </span><span style="color: blue">private void </span>BringToTop(<span style="color: blue">object </span>element)
      {

          <span style="color: #2b91af">Panel </span>p = (<span style="color: #2b91af">Panel</span>)((<span style="color: #2b91af">FrameworkElement</span>)element).Parent;
          <span style="color: green">//some code
      </span>}
      <span style="color: blue">private int </span>getHighestValue(<span style="color: #2b91af">Panel </span>p)
      {
          <span style="color: green">//some code
      </span>}
  }</pre>
<p><a href="http://11011.net/software/vspaste"></a>With this change, I should be able to apply the behavior to any UIElement inheriting from Panel. I’ve zipped up and uploaded the code for this project. Feel free to download and explore here: Update: I realized that the file I uploaded wasn’t working. I updated the file, you can download it from the expression gallery on <a title="http://gallery.expression.microsoft.com/en-us/BringToFrontBehavior" href="http://gallery.expression.microsoft.com/en-us/BringToFrontBehavior">http://gallery.expression.microsoft.com/en-us/BringToFrontBehavior</a></p>
<p>Want to contribute to the gallery? Visit <a title="http://gallery.expression.microsoft.com/en-us/site/create" href="http://gallery.expression.microsoft.com/en-us/site/create">http://gallery.expression.microsoft.com/en-us/site/create</a></p>
<p>To see a sample application, check out <a href="http://www.badgorilla.net/behaviors">http://www.badgorilla.net/behaviors</a> </p>
<p>For more about the greatness of behaviors, check out this Mix Video: <a title="http://videos.visitmix.com/MIX09/C27M" href="http://videos.visitmix.com/MIX09/C27M">http://videos.visitmix.com/MIX09/C27M</a> and of course the link to the behavior pack used in the demo: <a title="http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack" href="http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack">http://gallery.expression.microsoft.com/en-us/MIXBehaviorPack</a></p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/06/29/techfriday-building-custom-behaviors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tech Friday: Your Own Custom Search Providers</title>
		<link>http://aimeegurl.com/2009/06/12/tech-friday-your-own-custom-search-providers/</link>
		<comments>http://aimeegurl.com/2009/06/12/tech-friday-your-own-custom-search-providers/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 15:53:15 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[techfriday]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/06/12/tech-friday-your-own-custom-search-providers/</guid>
		<description><![CDATA[<p id="top" />
<p>Not the most techie thing to do but hey, today isn’t the greatest day to be using much of my brain as most of it is concentrating on agonizing on pain. I was browsing around the blogs I monitor and found a post by Long Zheng talking about a little experiment that showed [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>Not the most techie thing to do but hey, today isn’t the greatest day to be using much of my brain as most of it is concentrating on agonizing on pain. I was browsing around the blogs I monitor and <a href="http://www.istartedsomething.com/20090607/bing-vs-google-vs-yahoo-blind-search-engine-test">found a post</a> by <a href="http://twitter.com/longzheng">Long Zheng</a> talking about a little experiment that showed how much branding had an impact on peoples perceptions about search engines. Check out <a href="http://www.istartedsomething.com/20090607/bing-vs-google-vs-yahoo-blind-search-engine-test">his post</a> if you want to know more. Down the comments, I found someone saying that he wanted to make it his default browser search and saw that he created a search provider. I tried installing it but I am guessing it only works for Firefox. So I went ahead and <a href="http://aimeegurl.com/blindsearch.html">created my own</a> which I found was quite easy for IE8, especially with the tools that they have out there. </p>
<p>1. Go to <a title="http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx" href="http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx">http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx</a> where they already have a list of popular search providers. They also have a custom-search-provider-generatorer if you want to create one of your own <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb.png" width="504" height="480" /></a> </p>
<p>2. Go to the search page that you would like to create a provider for and search for TEST (all caps). When the results page come, paste the URL in the text box provided and name your custom search provider</p>
<p><img style="display: inline" title="image" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image1.png" width="320" height="323" /> </p>
<p>3. Now you can choose to install the provider straight from the page, but if you’d like to share it on your blog/web page, what you do next is click on View XML. It should take you to a page similar to the one below:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb1.png" width="705" height="399" /></a> </p>
<p>4. Next step is to go to File-&gt;Save As and save the page to your local drive as anything-you-want.xml and upload it to your webserver, skydrive, or anywhere visible to the internet at large.</p>
<p>5. Now on the page where you want to share your provider, you’ll need a link that will point to the following code &quot;javascript:window.external.AddSearchProvider(&#8216;http://www.aimeegurl.com/blindsearch.xml&#8217;);&quot;. In my case, i have <a href="http://aimeegurl.com/blindsearch.html">this page</a>:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb2.png" width="888" height="218" /></a> </p>
<p>with the following code to the Add Blind Search link:</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/06/image4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/06/image_thumb3.png" width="421" height="67" /></a>&#160;</p>
<p>And it’s that simple <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>I know, I owe a super tech friday next week… especially since I skipped last week! ^_^</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/06/12/tech-friday-your-own-custom-search-providers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tech Friday: The Orientator</title>
		<link>http://aimeegurl.com/2009/05/29/tech-friday-the-orientator/</link>
		<comments>http://aimeegurl.com/2009/05/29/tech-friday-the-orientator/#comments</comments>
		<pubDate>Fri, 29 May 2009 09:43:15 +0000</pubDate>
		<dc:creator>Aimee</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[techfriday]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://aimeegurl.com/2009/05/29/tech-friday-the-orientator/</guid>
		<description><![CDATA[<p id="top" />
<p>I was thinking of an app to build for tech Friday and I remember running in to @willyfoo the other day. He mentioned he needed an application that would read in EXIF data from photographs and rotate them based on the orientation meta tag. It was quite a good exercise cause it allowed [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>I was thinking of an app to build for tech Friday and I remember running in to <a href="http://twitter.com/willyfoo">@willyfoo</a> the other day. He mentioned he needed an application that would read in EXIF data from photographs and rotate them based on the orientation meta tag. It was quite a good exercise cause it allowed me to play around with a few things.</p>
<p>&#160;</p>
<p><strong>Problem 1: EXIF what?</strong></p>
<p>Although I play around with photography once in a while (I bought a camera last year and I haven’t put any serious effort into it just yet), there are a few concepts which I have yet to understand. So apparently, cameras have a way of storing meta data into the photos you take. Some cameras store what its orientation is when you take a picture. So today, I brought my camera to work and took a few photographs as test photos. I found an existing library on <a href="http://www.codeproject.com">CodeProject</a> that will allow you to read EXIF data from photos called <a href="http://www.codeproject.com/KB/graphics/exiflib.aspx">ExifLib</a>.</p>
<p>So now, I can extract the data. The next step was understanding what code means what. <a title="http://www.impulseadventure.com/photo/exif-orientation.html" href="http://www.impulseadventure.com/photo/exif-orientation.html">http://www.impulseadventure.com/photo/exif-orientation.html</a> gives a graphical explanation for the values of the Orientation metadata.</p>
<p><strong>Problem 2: UI</strong></p>
<p>To be honest, this is something that really needs to be thought through. I am guessing traditional applications would have a UI such as this that will allow you to select a file you want to “fix”. But then I thought, what if I wanted to do a batch job? I guess I could then select a directory. And then I remembered the <a href="http://aimeegurl.com/2009/05/19/how-i-upload-photos-to-facebook/">challenge I had when I dealt with photos when uploading to facebook</a> where my photos aren’t always in the same directory. </p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/05/image20.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/05/image-thumb18.png" width="321" height="36" /></a> </p>
<p>I then remembered <a href="http://twitter.com/MSExpression/status/1937523871">a tweet by @MSExpression</a> pointing to <a href="http://www.kirupa.com/blend_wpf/drag_drop_files_wpf_pg1.htm">a blog post by kirupa</a> where he talks about how you can enable drag &amp; drop onto WPF components. So that is settled, Drag &amp; Drop. I built a simple UI with a ListBox where you can drag your files to and an Image component where you can preview the rotated image.</p>
<p><a href="http://aimeegurl.com/wp-content/uploads/2009/05/image21.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://aimeegurl.com/wp-content/uploads/2009/05/image-thumb19.png" width="590" height="376" /></a> </p>
<p>There might be cases when the application messes up the auto orienting and you’d rather do it yourself manually. The UI allows you to select/de-select the files you want to save changes to. I have to say, it’s not the prettiest or most intuitive way to do it but I am not creative so this will have to do.</p>
<p><strong>Problem 3: Preserving EXIF Data</strong></p>
<p>I had originally thought it would be as easy as </p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: #2b91af"><font color="#000000" face="Tahoma">&#160; </font>&#160;&#160; 1</span>&#160; <span style="color: #2b91af">Bitmap</span> bmPhoto = <span style="color: blue">new</span> <span style="color: #2b91af">Bitmap</span>(filePath);</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 2</span>&#160; bmPhoto.RotateFlip(<span style="color: #2b91af">RotateFlipType</span>.Rotate180FlipNone);</p>
</p></div>
<p>but I was wrong. First, I realized that although it would successfully rotate the image, it would also bloat up the file (as it was saved without compression) plus, it would lose all the EXIF data the photos had. I don’t think this is something that <a href="http://www.twitter.com/jawss">@willyfoo</a> would have wanted ^_^. So I dug around and found <a href="http://www.techbubble.net/Blog/tabid/57/EntryId/36/How-to-preserve-EXIF-data-when-rotating-resizing-JPEG-images.aspx">this post</a> that showed you how to resize and manipulate jpegs while preserving the metadata. I did a bit of trimming as the code had stuff to resize the image, which I didn’t want to do for this round. One issue though, is because it encodes the bitmap using some parameters that i can’t figure out just yet (am just lazy too :p) It bloats the file up by a bit. </p>
<p><strong>Problem 4: Saving Changes</strong></p>
<p>Because my UI shows a preview of the image that was rotated, I got some errors where “the file is being used by a process” once I loaded them up into the application and tried to rename/delete them. This <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c66f2f56-fa0a-41cf-9edd-350770f5cba6">post on the msdn forum</a> showed the fix for this.</p>
<p>You can download the code here:</p>
<p><iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 66px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-bdfb7845c22e26b6.skydrive.live.com/embedrowdetail.aspx/Projects/Orientator.zip" frameborder="0" marginwidth="0" scrolling="no"></iframe></p>
<p><strong>Issues:</strong></p>
<p>The application is functional but there is definitely a lot of room for improvement <img src='http://aimeegurl.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>1. Design – I think this application can be a lot nicer looking if I actually spend time on it. There’s a lot the WPF platform can do to “jazz up” the look and feel of the UI. I think my biggest challenge right now is coming up with a concept that would be cool looking enough :p</p>
<p>2. I’m not sure what happens if I drag&amp;drop none images into the application. This line was supposed to take care of that:</p>
<p>&#160;</p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 1</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">if</span> (e.Data.GetDataPresent(<span style="color: #2b91af">DataFormats</span>.Bitmap))</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 2</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 3</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green">some code here</span></p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 4</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p></div>
<p>But for some reason, files I drag&amp;drop into the app don’t get recognized as a Bitmap. I had to use DataFormats.FileDrop instead.</p>
<p>3. Bloating of image. As I mentioned in problem 3, I’m not very familiar with how encoding works so the app actually bloats the image size quite a bit. I think the following lines take care of the encoding, but when I try to step down on the encParm, it makes the image size smaller than the source. I figured, bigger is better.    </p>
<div style="font-family: courier new; background: white; color: black; font-size: 10pt">
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 1</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Drawing.Imaging.<span style="color: #2b91af">Encoder</span> enc = System.Drawing.Imaging.<span style="color: #2b91af">Encoder</span>.Quality;</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 2</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Drawing.Imaging.<span style="color: #2b91af">EncoderParameters</span> encParms = <span style="color: blue">new</span> <span style="color: #2b91af">EncoderParameters</span>(1);</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 3</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.Drawing.Imaging.<span style="color: #2b91af">EncoderParameter</span> encParm = <span style="color: blue">new</span> <span style="color: #2b91af">EncoderParameter</span>(enc,100L);</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 4</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; encParms.Param[0] = encParm;</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 5</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #2b91af">ImageCodecInfo</span>[] codecInfo = <span style="color: #2b91af">ImageCodecInfo</span>.GetImageEncoders();</p>
<p style="margin: 0px"><span style="color: #2b91af">&#160;&#160;&#160; 6</span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #2b91af">ImageCodecInfo</span> codecInfoJpeg = codecInfo[1];</p>
<p style="margin: 0px">
</p></div>
<p>&#160;</p>
<p>That’s it for now, until next Tech Friday!</p>
]]></content:encoded>
			<wfw:commentRss>http://aimeegurl.com/2009/05/29/tech-friday-the-orientator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
