<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[[SecurityRatty] tag: wpf]]></title>
    <link>http://securityratty.com/tag/wpf</link>
    <description></description>
    <pubDate>Thu, 20 Dec 2007 05:38:00 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[I'm coming to New York in February]]></title>
      <link>http://securityratty.com/article/5e50403cbac8243c71d43a88b9c73256</link>
      <guid>http://securityratty.com/article/5e50403cbac8243c71d43a88b9c73256</guid>
      <description><![CDATA[This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our Applied .NET 3.0 course , and covering some of the new stuff in 3.5 as...]]></description>
      <content:encoded><![CDATA[<p>This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">Applied .NET 3.0 course</a>, and covering some of the new stuff in 3.5 as well. This class is an introduction to the 3.x platform: four day's of lectures, demos, and labs covering WCF, Workflow, WPF, and one of my favorite topics, the new claims-based identity model (which ADFS and CardSpace use). The course runs Tuesday through Friday.</p> <p>If this sounds intriguing, <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">sign up today</a>!</p><div style="clear:both;"></div><img src="http://pluralsight.com/community/aggbug.aspx?PostID=50035" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 23 Jan 2008 16:44:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/favorite topics">favorite topics</category>
      <category domain="http://securityratty.com/tag/favorite">favorite</category>
      <category domain="http://securityratty.com/tag/runs tuesday">runs tuesday</category>
      <category domain="http://securityratty.com/tag/identity model">identity model</category>
      <category domain="http://securityratty.com/tag/february">february</category>
      <category domain="http://securityratty.com/tag/wcf">wcf</category>
      <category domain="http://securityratty.com/tag/net">net</category>
      <category domain="http://securityratty.com/tag/adfs">adfs</category>
      <category domain="http://securityratty.com/tag/demos">demos</category>
      <source url="http://pluralsight.com/community/blogs/keith/archive/2008/01/23/50035.aspx">I'm coming to New York in February</source>
    </item>
    <item>
      <title><![CDATA[I'm coming to New York in February]]></title>
      <link>http://securityratty.com/article/c7e7f465f969361eff8fc66992d32480</link>
      <guid>http://securityratty.com/article/c7e7f465f969361eff8fc66992d32480</guid>
      <description><![CDATA[This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our Applied .NET 3.0 course , and covering some of the new stuff in 3.5 as...]]></description>
      <content:encoded><![CDATA[<p>This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">Applied .NET 3.0 course</a>, and covering some of the new stuff in 3.5 as well. This class is an introduction to the 3.x platform: four day's of lectures, demos, and labs covering WCF, Workflow, WPF, and one of my favorite topics, the new claims-based identity model (which ADFS and CardSpace use). The course runs Tuesday through Friday.</p> <p>If this sounds intriguing, <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">sign up today</a>!</p><div style="clear:both;"></div><img src="http://www.pluralsight.com/community/aggbug.aspx?PostID=50035" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 23 Jan 2008 16:44:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/favorite topics">favorite topics</category>
      <category domain="http://securityratty.com/tag/favorite">favorite</category>
      <category domain="http://securityratty.com/tag/runs tuesday">runs tuesday</category>
      <category domain="http://securityratty.com/tag/identity model">identity model</category>
      <category domain="http://securityratty.com/tag/february">february</category>
      <category domain="http://securityratty.com/tag/wcf">wcf</category>
      <category domain="http://securityratty.com/tag/net">net</category>
      <category domain="http://securityratty.com/tag/adfs">adfs</category>
      <category domain="http://securityratty.com/tag/demos">demos</category>
      <source url="http://www.pluralsight.com/community/blogs/keith/archive/2008/01/23/50035.aspx">I'm coming to New York in February</source>
    </item>
    <item>
      <title><![CDATA[I'm coming to New York in February]]></title>
      <link>http://securityratty.com/article/cf8acaeb61c97b377962f93dae108204</link>
      <guid>http://securityratty.com/article/cf8acaeb61c97b377962f93dae108204</guid>
      <description><![CDATA[This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our Applied .NET 3.0 course , and covering some of the new stuff in 3.5 as...]]></description>
      <content:encoded><![CDATA[<p>This is one of my favorite places, and I've been away for quite awhile. During the week of February 12, I'll be teaching our <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">Applied .NET 3.0 course</a>, and covering some of the new stuff in 3.5 as well. This class is an introduction to the 3.x platform: four day's of lectures, demos, and labs covering WCF, Workflow, WPF, and one of my favorite topics, the new claims-based identity model (which ADFS and CardSpace use). The course runs Tuesday through Friday.</p> <p>If this sounds intriguing, <a href="http://www.pluralsight.com/courses/AppliedDotNet3.aspx" target="_blank">sign up today</a>!</p><img src ="http://pluralsight.com/blogs/keith/aggbug/50035.aspx" width = "1" height = "1" />]]></content:encoded>
      <pubDate>Wed, 23 Jan 2008 09:44:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/favorite topics">favorite topics</category>
      <category domain="http://securityratty.com/tag/favorite">favorite</category>
      <category domain="http://securityratty.com/tag/runs tuesday">runs tuesday</category>
      <category domain="http://securityratty.com/tag/identity model">identity model</category>
      <category domain="http://securityratty.com/tag/february">february</category>
      <category domain="http://securityratty.com/tag/wcf">wcf</category>
      <category domain="http://securityratty.com/tag/net">net</category>
      <category domain="http://securityratty.com/tag/adfs">adfs</category>
      <category domain="http://securityratty.com/tag/demos">demos</category>
      <source url="http://pluralsight.com/blogs/keith/archive/2008/01/23/50035.aspx">I'm coming to New York in February</source>
    </item>
    <item>
      <title><![CDATA[WPF Layout Tips]]></title>
      <link>http://securityratty.com/article/2e4f14acffb1f3d827a686f965724dbc</link>
      <guid>http://securityratty.com/article/2e4f14acffb1f3d827a686f965724dbc</guid>
      <description><![CDATA[The more I work with Windows Presentation Foundation (WPF) , the more I'm impressed with its consistency. I'm finding it so intuitive to navigate, and just plain fun to use. The other day I was trying...]]></description>
      <content:encoded><![CDATA[<p>The more I work with <a href="http://windowsclient.net/">Windows Presentation Foundation (WPF)</a>, the more I'm impressed with its consistency. I'm finding it so intuitive to navigate, and just plain fun to use. The other day I was trying to build something that behaved similarly to an ASP.NET repeater control. I wanted to use a data template to specify the presentation of each item, and I wanted the list of items to be presented using a WrapPanel. Pretty simple, you'd think!</p> <p>When the result of my efforts looked like stretched silly putty, I figured that I must have taken the wrong approach, so I hooked up with the author of our <a href="http://www.pluralsight.com/courses/AppliedWPF.aspx">WPF short course</a>, <a href="http://www.pluralsight.com/ian.aspx">Ian Griffiths</a>. Ian reminded me about constraints in layout, and I was able to fix my problem pretty quickly.</p> <p>Unless you use absolute positioning (such as the Canvas layout control does), WPF uses a pretty sophisticated negotiation model to figure out how each control will be laid out. WrapPanel, for example, asks each child element how much space it wants, and lays those children out in a wrapped fashion. Here's a simple example with two buttons:</p> <table cellspacing="0" cellpadding="2" border="0"> <tbody> <tr> <td valign="top" width="400"><tt>&lt;WrapPanel&gt;<br>&nbsp; &lt;Button&gt;One&lt;/Button&gt;<br>&nbsp; &lt;Button&gt;Two&lt;/Button&gt;<br>&lt;/WrapPanel&gt;</tt></td> <td valign="center" width="75">&nbsp;<img src="http://www.pluralsight.com/keith/images/blogged/wpf-layout/two-buttons.jpg"> </tt></td></tr></tbody></table> <p>In the above case, the WrapPanel asks its children how much space they want. The buttons size themselves according to their content (in the example above, the text in each button determines its size). So there's no problem. But try dropping a simple Image into the same panel and things start to get weird:</p> <table cellspacing="0" cellpadding="2" border="0"> <tbody> <tr> <td valign="top" width="400"><tt>&lt;WrapPanel&gt;<br>&nbsp; &lt;Button&gt;One&lt;/Button&gt;<br>&nbsp; &lt;Image Source="..."/&gt;<br>&lt;/WrapPanel&gt;</tt></td> <td valign="center" width="75"><img src="http://www.pluralsight.com/keith/images/blogged/wpf-layout/button-with-image-unconstrained.jpg"> </tt></td></tr></tbody></table> <p>You see, by default, Image stretches to fill the available space in the container. But the WrapPanel isn't constraining the child's space, and so things get strange. Either the parent or the child in this case needs to step up and figure out how much space should be allotted for the child. One easy way to fix this is to turn off stretching in the Image element:</p> <table cellspacing="0" cellpadding="2" border="0"> <tbody> <tr> <td valign="top" width="400"><tt>&lt;WrapPanel&gt;<br>&nbsp; &lt;Button&gt;One&lt;/Button&gt;<br><tt>&nbsp; &lt;Image Source="..." Stretch="None"/&gt;<br></tt>&lt;/WrapPanel&gt;</tt></td> <td valign="center" width="75">&nbsp;<img src="http://www.pluralsight.com/keith/images/blogged/wpf-layout/button-with-image-constrained.jpg"> </tt></td></tr></tbody></table> <p>Now I've got something more reasonable - the little XML image is the size I expected it to be. Image is an example of a control that can wreak havoc with the layout engine if you're not aware of this. ScrollViewer is an example of a container that can do the same thing, as it essentially tells its children they have infinite space. So if you run into weirdness like this, take some time to adjust various constraints until you find a solution you like!</p><img src ="http://pluralsight.com/blogs/keith/aggbug/49494.aspx" width = "1" height = "1" />]]></content:encoded>
      <pubDate>Thu, 20 Dec 2007 05:38:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/layout">layout</category>
      <category domain="http://securityratty.com/tag/image">image</category>
      <category domain="http://securityratty.com/tag/simple image">simple image</category>
      <category domain="http://securityratty.com/tag/control">control</category>
      <category domain="http://securityratty.com/tag/net repeater control">net repeater control</category>
      <category domain="http://securityratty.com/tag/wpf">wpf</category>
      <category domain="http://securityratty.com/tag/infinite space">infinite space</category>
      <category domain="http://securityratty.com/tag/image stretches">image stretches</category>
      <category domain="http://securityratty.com/tag/space">space</category>
      <source url="http://pluralsight.com/blogs/keith/archive/2007/12/20/49494.aspx">WPF Layout Tips</source>
    </item>
  </channel>
</rss>
