<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Alan Gasperini's blog</title><link>http://blogs.msdn.com/b/alanga/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Blend demo from TechEd</title><link>http://blogs.msdn.com/b/alanga/archive/2010/09/29/blend-demo-from-teched.aspx</link><pubDate>Wed, 29 Sep 2010 18:01:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10069399</guid><dc:creator>Alan Gasperini</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/alanga/rsscomments.aspx?WeblogPostID=10069399</wfw:commentRss><comments>http://blogs.msdn.com/b/alanga/archive/2010/09/29/blend-demo-from-teched.aspx#comments</comments><description>&lt;p&gt;Earlier this year, I gave a presentation about using Blend to create Silverlight applications at TechEd with another member of the Blend team, &lt;a title="Unni Ravindranathan" href="http://blogs.msdn.com/b/unnir/"&gt;Unni Ravindranathan&lt;/a&gt;. &amp;nbsp;You can see a video of the presentation here:&amp;nbsp;&lt;a href="http://www.msteched.com/2010/NorthAmerica/WEB201"&gt;http://www.msteched.com/2010/NorthAmerica/WEB201&lt;/a&gt;. &amp;nbsp;Unni and I discuss some of the new features of Expression Blend 4, and I walk through a demo creating a photo viewer application using some of these new features. &amp;nbsp;I've gotten some requests for the code, which I'm posting. &amp;nbsp;I've attached both the original projects that I started the demos with, as well as the final version after the demo. &amp;nbsp;There are two steps, the first is representing a designer -&amp;gt; developer workflow where the designer creates the application skeleton, and a second step that represents the developer -&amp;gt; designer workflow, where a designer adds some interactivity and hooks up to a predefined data model.&lt;/p&gt;
&lt;p&gt;If you want to reuse the code or the demo content for your own presentation, please feel free to do so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10069399" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-06-93-99/demo.zip" length="555244" type="application/x-zip-compressed" /></item><item><title>Using multiple value converters with a binding</title><link>http://blogs.msdn.com/b/alanga/archive/2006/07/10/661635.aspx</link><pubDate>Mon, 10 Jul 2006 22:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:661635</guid><dc:creator>Alan Gasperini</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/alanga/rsscomments.aspx?WeblogPostID=661635</wfw:commentRss><comments>http://blogs.msdn.com/b/alanga/archive/2006/07/10/661635.aspx#comments</comments><description>&lt;P&gt;Data binding is an extrememly cool avalon feature that lets you automatically populate UI with data.&amp;nbsp; Value converters supply a generic way to adapt a model to the view without having to write custom code.&amp;nbsp; For instance, it is fairly common to set visibility of elements based on whether or not they should be enabled, and you can data bind the visibility of your element to some bool property, and use a BoolToVisibilityConverter to convert the bool to a visibility.&lt;/P&gt;
&lt;P&gt;But what if you want a more complex binding - what if you only want to show a listbox when the number of items is greater than zero?&amp;nbsp; Say you have an IntegerToBoolConverter, and a BoolToVisibilityConverter, but you don't want to write a new IntegerToVisibilityConverter.&amp;nbsp; If you add a composing converter to your value converter toolbox, you'll have a generic way to chain converters together.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT size=2&gt;public class ComposingConverter : IValueConverter&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;private List&amp;lt;IValueConverter&amp;gt; converters = new List&amp;lt;IValueConverter&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;public List&amp;lt;IValueConverter&amp;gt; Converters&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;get { return this.converters; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;public object Convert(object o, Type targetType, object parameter, CultureInfo culture)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i = 0; i &amp;lt; this.converters.Count; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o = converters[i].Convert(o, targetType, parameter, culture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return o;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)&lt;BR&gt;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;for (int i = this.converters.Count - 1; i &amp;gt;= 0; i--)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;value = converters[i].ConvertBack(value, targetType, parameter, culture);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return value;&lt;BR&gt;&amp;nbsp;&amp;nbsp;}&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Times New Roman" size=2&gt;Then you would use this converter like so:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&amp;lt;ComposingConverter&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;ComposingConverter.Converters&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;IntegerToBoolConverter/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;BoolToVisibilityConverter/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;/ComposingConverter.Converters&amp;gt;&lt;BR&gt;&amp;lt;/ComposingConverter&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=661635" width="1" height="1"&gt;</description></item><item><title>Focus scopes in Avalon</title><link>http://blogs.msdn.com/b/alanga/archive/2006/05/17/600278.aspx</link><pubDate>Wed, 17 May 2006 23:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:600278</guid><dc:creator>Alan Gasperini</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/alanga/rsscomments.aspx?WeblogPostID=600278</wfw:commentRss><comments>http://blogs.msdn.com/b/alanga/archive/2006/05/17/600278.aspx#comments</comments><description>&lt;P&gt;Focus scopes are a mechanism in avalon for allowing multiple elements to have focus simultaneously.&amp;nbsp; A very common example of multiple focus can be seen in Word - say you want to change the font size of a selection of text.&amp;nbsp; You select the text, then start typing in the font control to change the font size - and the application remembers that the text itself was selected.&amp;nbsp; If you built this kind of application in avalon without setting up focus scopes, the original textbox would lose focus when you started typing in the font size.&lt;/P&gt;
&lt;P&gt;Here's a very simple example of a xaml layout with multiple focus scopes:&lt;/P&gt;
&lt;P&gt;&amp;lt;StackPanel&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;TextBox/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;lt;TextBox FocusManager.IsFocusScope="True"/&amp;gt;&lt;BR&gt;&amp;lt;/StackPanel&amp;gt;&lt;/P&gt;
&lt;P&gt;If you type some text into the first textbox, and select it, you can then give focus to the second text box without the original losing focus.&amp;nbsp; The avalon terminology is "logical" vs. "keyboard" focus - the original text box has logical focus, while the second text box would have keyboard focus.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Also note that any elements that are in one focus scope won't lose logical focus if the keyboard focus changes to target an element in another focus scope.&amp;nbsp; In other words, every focus scope can have an element with logical focus, but only one element in the entire tree will have keyboard focus.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=600278" width="1" height="1"&gt;</description></item><item><title>First Post</title><link>http://blogs.msdn.com/b/alanga/archive/2006/01/25/517675.aspx</link><pubDate>Thu, 26 Jan 2006 02:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:517675</guid><dc:creator>Alan Gasperini</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/alanga/rsscomments.aspx?WeblogPostID=517675</wfw:commentRss><comments>http://blogs.msdn.com/b/alanga/archive/2006/01/25/517675.aspx#comments</comments><description>&lt;P&gt;Since this is my first blog entry, I'll introduce myself.&amp;nbsp; I'm a developer at Microsoft working on &lt;A href="http://www.microsoft.com/products/expression/en/interactive_designer/default.mspx"&gt;Expression Interactive Designer&lt;/A&gt;.&amp;nbsp; I'll be using this blog to talk about Expression, Microsoft, and software development in general.&amp;nbsp; In other words, it will be very work oriented.&amp;nbsp; I've been at Microsoft for about&amp;nbsp;two&amp;nbsp;and a half years, and I work on the text editing and data binding features in Expression.&amp;nbsp; Since Expression is built on &lt;A href="http://www.microsoft.com/products/expression/en/wpf/default.mspx"&gt;Windows Presentation Foundation(WPF)&lt;/A&gt;, you'll hear me talk about that quite a bit as well.&lt;/P&gt;
&lt;P&gt;-Alan&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=517675" width="1" height="1"&gt;</description></item></channel></rss>