<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>UberDemo</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/uberdemo/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/uberdemo/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:27:27 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SEO Toolkit for IIS</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/seo-toolkit-for-iis</link>
      <pubDate>Wed, 13 Jan 2010 08:46:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2010/01/13/seo-toolkit-for-iis/</guid>
      <description><![CDATA[This looks like it might be useful for anyone that is running IIS:...]]></description>
      <content:encoded><![CDATA[<P>This looks like it might be useful for anyone that is running IIS: <A href="https://www.microsoft.com/web/spotlight/seo/?appid=10990002">https://www.microsoft.com/web/spotlight/seo/?appid=10990002</A>. Released 01/12/10. It looks to be an improvement over a preexisting version found&nbsp;<A href="https://technet.microsoft.com/en-us/library/ee729237(WS.10).aspx" mce_href="https://technet.microsoft.com/en-us/library/ee729237(WS.10).aspx">here</A> released last&nbsp;October&nbsp;</P>
<P><EM>"Start with the free download, review your website, and make changes fast. The SEO Toolkit with its detailed analysis and search engine friendly suggestions helps improve the relevance of your website in search results right away"</EM></P>]]></content:encoded>
    </item>
    <item>
      <title>Gestalt 1.0 and Gestalt Widget Pack Launched!</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/gestalt-1-0-and-gestalt-widget-pack-launched</link>
      <pubDate>Fri, 20 Nov 2009 16:20:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/11/20/gestalt-1-0-and-gestalt-widget-pack-launched/</guid>
      <description><![CDATA[MIX Online has released a major update to the Gestalt project. Gestalt has now been incorporated...]]></description>
      <content:encoded><![CDATA[<P>MIX Online has released a major update to the <A href="https://www.visitmix.com/Labs/gestalt/" mce_href="https://www.visitmix.com/Labs/gestalt/">Gestalt</A> project. Gestalt has now been incorporated directly into the&nbsp;Dynamic Language Runtime (DLR).</P>
<P>&nbsp;Joshua Allen writes: Included&nbsp;... are our sample video and audio widgets, which come with the Gestalt <A href="https://www.visitmix.com/labs/gestalt/widgets/" mce_href="https://www.visitmix.com/labs/gestalt/widgets/">Widgets</A> pack.&nbsp; By adding a &lt;script&gt; tag to the top of your HTML file, you can automatically enable use of HTML5-compatible video and audio tag syntax:</P><PRE>&lt;html&gt;&nbsp; <BR>&nbsp; &lt;head&gt;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src="https://mschnlnine.vo.llnwd.net/d1/dlr-20091120.js"&gt;&lt;/script&gt;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript" <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; src="https://mschnlnine.vo.llnwd.net/dlr/dlrmedia.js"&gt;&lt;/script&gt;&nbsp; <BR>&nbsp; &lt;/head&gt;&nbsp; <BR>&nbsp; &lt;body&gt;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &lt;audio autoplay="false"&gt;<BR>        &lt;source src="foo.mp3" type="audio/mp3"&gt;&lt;/source&gt;<BR>    &lt;/audio&gt;&nbsp; <BR>&nbsp; &lt;/body&gt;<BR>&lt;/html&gt;</PRE>]]></content:encoded>
    </item>
    <item>
      <title>Oomph: A Microformats Toolkit</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/oomph-a-microformats-toolkit</link>
      <pubDate>Tue, 25 Aug 2009 19:29:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/08/25/oomph-a-microformats-toolkit/</guid>
      <description><![CDATA[Mix Oline presents their newest project: Oomph2: A Microformats Toolkit. This new version adds...]]></description>
      <content:encoded><![CDATA[<P>Mix Oline presents their newest project: Oomph2: A Microformats Toolkit. This new version adds support for the hMedia format, plus a lot of other enhancments/improvements.&nbsp;Check it out&nbsp;at: <A href="https://www.visitmix.com/Lab/oomph/">https://www.visitmix.com/Lab/oomph/</A>. </P>
<P>"<STRONG>Microformats</STRONG> are about enhancing the web, representing data in HTML and moving that data around. Oomph: A Microformats Toolkit is for web developers, designers and users, making it easier to create, consume, and style Microformats. Oomph makes consuming and producing content for the web just a little easier, more efficient, more fun. <EM>Now featuring Oomph2!"</EM></P>]]></content:encoded>
    </item>
    <item>
      <title>Circumventing an IE/Flash Display Issue in the WPF WebBrowser control on x64 machines</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/circumventing-an-ieflash-display-issue-in-the-wpf-webbrowser-control-on-x64-machines</link>
      <pubDate>Thu, 09 Jul 2009 12:29:59 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/07/09/circumventing-an-ieflash-display-issue-in-the-wpf-webbrowser-control-on-x64-machines/</guid>
      <description><![CDATA[Recently I wrote some code with the intent to display an embedded YouTube Flash video in Window...]]></description>
      <content:encoded><![CDATA[<p>Recently I wrote some code with the intent to display an embedded YouTube Flash video in Window Presentation Foundation’s <a href="https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx" target="_blank">WebBrowser</a> control. I ran into an interesting problem. Internet Explorer displayed a broken object icon on some machines, but not others. After some investigation it appeared that the Flash video was displaying properly on x86 machines and failing to appear on x64 machines. Apparently the x64 build of the WPF application spawns an x64 instance of IE. The Flash object does not display, since IE attempts to load the x64 version of Flash, which incidentally does not yet exist for x64 versions of Windows.</p> <p>To solve the problem, set the compiler to explicitly compile the app to x86, and it becomes a non-issue. The downside is that the app can no longer take advantage of x64 capabilities, but for many cases this is probably fine.</p> <p>Incidentally here is the code that I used:</p> <p>private string embedded = "&lt;html style=\"margin:0 0 0 0; background-color:Black; overflow:hidden\"&gt;" + <br>"&lt;script event=onload for=window&gt;document.body.scroll=\"no\"&lt;/script&gt;"+ "&lt;object width=\"425\" height=\"344\"&gt;" + <br>"&lt;param name=\"movie\" value=\"https://www.youtube.com/v/{0}&amp;hl=en&amp;fs=1\"&gt;&lt;/param&gt;" + <br>"&lt;param name=\"allowFullScreen\" value=\"true\"&gt;&lt;/param&gt;" + "&lt;param name=\"allowscriptaccess\" value=\"always\"&gt;&lt;/param&gt;" + <br>"&lt;embed src=\"https://www.youtube.com/v/{0}&amp;hl=en&amp;fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"&gt;&lt;/embed&gt;" + <br>"&lt;/object&gt;&lt;/html&gt;"; </p> <p>WebBrowser wb = new WebBrowser();<br>wb.Width = 425;<br>wb.Height = 344;<br>wb.NavigateToString(string.Format(embeded, passInPathToVideo));</p>]]></content:encoded>
    </item>
    <item>
      <title>Using Custom Namespaces at the Root of a XAML File</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/using-custom-namespaces-at-the-root-of-a-xaml-file</link>
      <pubDate>Wed, 29 Apr 2009 14:02:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/04/29/using-custom-namespaces-at-the-root-of-a-xaml-file/</guid>
      <description><![CDATA[Here’s something I didn’t know about Silverlight, and I did not find any documentation on it. It’s...]]></description>
      <content:encoded><![CDATA[<P>Here’s something I didn’t know about Silverlight, and I did not find any documentation on it. It’s possible to create custom namespaces at the root of a XAML file. I always knew that you could insert namespaces inline in XAML, but apparently when you define a namespace attribute in XAML it also applies to the root. Here’s a simple example:</P>
<P>&lt;myType:TreeMapPanelItem </P>
<BLOCKQUOTE>
<P>x:Class="MIXOnline.Descry.Controls.CustomTreeMapItem" </P>
<P>xmlns=<A href="https://schemas.microsoft.com/winfx/2006/xaml/presentation" mce_href="https://schemas.microsoft.com/winfx/2006/xaml/presentation">https://schemas.microsoft.com/winfx/2006/xaml/presentation</A> </P>
<P>xmlns:x=<A href="https://schemas.microsoft.com/winfx/2006/xaml" mce_href="https://schemas.microsoft.com/winfx/2006/xaml">https://schemas.microsoft.com/winfx/2006/xaml</A> </P>
<P>xmlns:myType="clr-namespace:MIXOnline.Descry;assembly=Inaugural" &gt; </P>
<P>&lt;TextBlock Text="Hello" /&gt; </P></BLOCKQUOTE>
<P>&lt;/myType:TreeMapPanelItem&gt;</P>
<P>This allows replacing of custom elements programmatically as was done in the CPP Custom Treemap sample in Descry which needed to inherit from a base TreeMapPanelItem class to pick up some of its default properties and methods. This could not have been done with a standard Silverlight class&nbsp;since they cannot inherit from custom classes. See the <A title="CPP TreeMap" href="https://descry.codeplex.com/SourceControl/changeset/view/15982#" mce_href="https://descry.codeplex.com/SourceControl/changeset/view/15982#">CPP TreeMap</A> sample in Descry for an example and look to the CustomTreeMapItem class for an example of an implementation. Note the assignment of the PanelItemType property in the Page.xaml.cs file which lets the TreeMapItem know which class to use for rendering.</P>]]></content:encoded>
    </item>
    <item>
      <title>Glimmer Released!</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/glimmer-released</link>
      <pubDate>Tue, 28 Apr 2009 18:23:41 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/04/28/glimmer-released/</guid>
      <description><![CDATA[The Mix Online_ team has just released their latest work: Glimmer. Glimmer is a WPF tool that...]]></description>
      <content:encoded><![CDATA[<p>The Mix Online_ team has just released their latest work: Glimmer. Glimmer is a WPF tool that generates jQuery so that you can easily create effects for your website! Check it out at <a href="https://www.visitmix.com/lab/glimmer">https://www.visitmix.com/lab/glimmer</a></p><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="304" height="228">   <param name="source" value="https://channel9.msdn.com/App_Themes/default/VideoPlayer2009_02_24.xap" />   <param name="initParams" value="m=https://mschannel9.vo.msecnd.net/o9/mix/labs/glimmer/glimmer.wmv,autostart=false,autohide=true,showembed=true, thumbnail=https://mschannel9.vo.msecnd.net/o9/mix/labs/glimmer/glimmerVideo.jpg, postid=0" />   <param name="background" value="#00FFFFFF" />   <a href="https://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">   <img src="https://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" />   </a>   </object>]]></content:encoded>
    </item>
    <item>
      <title>Regular Expression support in Visual Studio 2008</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/regular-expression-support-in-visual-studio-2008</link>
      <pubDate>Tue, 14 Apr 2009 13:46:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/04/14/regular-expression-support-in-visual-studio-2008/</guid>
      <description><![CDATA[Since I write a lot of Silverlight and WPF applications, I make heavy use of Visual Studio, and when...]]></description>
      <content:encoded><![CDATA[<P>Since I write a lot of Silverlight and WPF applications, I make heavy use of Visual Studio, and when I work with large XML files it is very time saving to know how to use Visual Studio’s Regular Expressions search support. Every time I use it&nbsp; though I invariably forget how to write RegEx searches, since I use it so seldom. So as the proverb goes: the weakest ink is better than the best memory. Perhaps you may get some use out of it.</P>
<P>Regular Expression search is not on by default. To turn it on you need to expand the options section in the <STRONG>Find and Replace</STRONG> dialog. RegEx search cannot be on by default since certain RegEx characters have completely different meaning that the literal characters and so would cause conflict if both were enabled.</P>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_2.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=SearchReplaceRegExCA1Z6T88 border=0 alt=SearchReplaceRegExCA1Z6T88 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_thumb.jpg" mce_src="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/RegularExpressionsupportinVisualStudio20_8D3F/SearchReplaceRegExCA1Z6T88_thumb.jpg"></A> </P>
<P>The <STRONG><A href="https://msdn.microsoft.com/en-us/library/2k3te2cs.aspx" mce_href="https://msdn.microsoft.com/en-us/library/2k3te2cs.aspx">Complete Character List</A></STRONG> is conveniently linked off the menu shown when clicking the arrows to the right of the find and replace Textboxes. I tend to learn much more quickly by example, and this page does provide *some* examples, so while useful, it doesn’t contain as many as I’d like. So here are two more for now:</P>
<P><STRONG>\&lt;xdate\&gt;(.*)</STRONG> </P>
<P>Finds and selects the following node to the end of the line: &lt;xdate&gt;11/14/2008&lt;/xdate&gt; 
<P>This is handy if you need to remove or modify an XML node. Note that the angle brackets are escaped with backslashes. The parentheses' group the period which allows any character and the asterisk which signifies zero or more characters before the carriage return. 
<P><STRONG>\n~((.+)\n)</STRONG> 
<P>Finds and selects carriage returns that have empty lines following them. This is handy if you want to compact empty vertical space. Essentially the logic is: Find a carriage return, but only one that precedes a line with a blank carriage return. This search will not find a line if it has spaces contained in the empty line, so you would need to modify it.</P>
<P mce_keep="true">&nbsp;</P>
<P>I only provided two examples, but if you know of any good RegEx resources please provide a link in the comment, or you can tweet me on <A href="https://www.twitter.com/hanshu" mce_href="https://www.twitter.com/hanshu">twitter</A>.</P>]]></content:encoded>
    </item>
    <item>
      <title>MIX09’ing it up with a Tetris Version of Flotzam</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/mix09ing-it-up-with-a-tetris-version-of-flotzam</link>
      <pubDate>Fri, 20 Mar 2009 13:23:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/03/20/mix09ing-it-up-with-a-tetris-version-of-flotzam/</guid>
      <description><![CDATA[For MIX09, our team decided to create a new look for Flotzam that was to be shown prior to the...]]></description>
      <content:encoded><![CDATA[<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_2.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002 border=0 alt=clip_image002 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_thumb.jpg" width=244 height=159 mce_src="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image002_thumb.jpg"></A> 
<P>For MIX09, our team decided to create a new look for Flotzam that was to be shown prior to the keynotes. We’d thought about possibly creating a Vegas slot machine version, but we ended up choosing Tetris, since it was very much in line with the #MIX09 theme. It sounded like an exciting project, so I jumped on it! <A href="https://systim.spaces.live.com/" mce_href="https://systim.spaces.live.com/">Tim Aidlin</A> designed the user experience and the look and feel, and <A href="https://rhizohm.net/irhetoric" mce_href="https://rhizohm.net/irhetoric">Karsten Januszewski</A> modified the data object model to support binding a single data template type to any one of the available Flotzam data sources collected from the various feeds: Twitter, Flickr, RSS, etc. 
<P>We brainstormed about what we wanted it to do, and settled on creating a somewhat simplified version of Tetris that avoided rotating the blocks. Flotzam Tetris needed to specifically target the 16x9 format used in the MIX09 keynote screens. This translated into 1280px by 720px dimensions, a fairly low resolution by today’s standards, which forced us to experiment with shape sizes. We needed to keep a careful balance between ensuring readability of the text in the back row of the keynote sessions while looking esthetically pleasing; the less blocks on screen, the less compelling it appears. 
<P>The Tetris logic itself was simple enough; I found several samples on the web to draw from. I chose to borrow some ideas from the CodePlex <A href="https://code.msdn.microsoft.com/WPFTetris/Release/ProjectReleases.aspx?ReleaseId=382" mce_href="https://code.msdn.microsoft.com/WPFTetris/Release/ProjectReleases.aspx?ReleaseId=382">WPF Tetris</A> that Karsten showed me, but this only got us about halfway. Absent was how to programmatically solve which Tetris blocks should fall based on the pieces that had already fallen. There are probably a few ways to solve this problem. I chose to take a commonly used game approach of using a buffer for the Tetris shapes defined as an array of integers, which I’ll call a <B>table</B>. Zero represents an empty space, and a one represents a space occupied by a <B>block,</B> the fundamental unit that makes up Tetris shapes. It turned out to be convenient to use integers since it very was handy to add up columns and rows for calculating when a row was full or calculating the total height of a stack of shapes for a particular column. 
<P>The shapes are defined in the <B>TetrisShape</B> class. The individual blocks that compose a shape are represented in a Point array offset from a (0,0) origin. The TetrisShape class also contains a <B>Position</B> property that maintains the absolute position of a TetrisShape shape in the table. 
<P>There are two other interesting parts to the TetrisShape class. The first is a <B>Weight</B> property that allows us to define how important the shape is, so that we can get a better spread of shape usage. It’s used in determining the probability that it will be chosen as the “next” shape to be dropped. The second is the <B>ShapeSignature()</B> method which returns a series of numbers, as a string, that define the “signature” of the bottom of a shape. So for example a 2 x 2 square would have a signature of “00”, or a 3 x 2 Tee shape would have a signature of “101”. The numbers represent the distance to the bottom block from an imaginary line running under the shape. This reason that this signature is returned as a string is so that string operators can be used to match the signature of a shape to the signature of all the other shapes settled in the table. 
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_2.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image004 border=0 alt=clip_image004 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_thumb.jpg" width=158 height=159 mce_src="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image004_thumb.jpg"></A> <A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_2.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_2.jpg" mce_href="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_2.jpg"><IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image006 border=0 alt=clip_image006 src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_thumb.jpg" original-url="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_thumb.jpg" width=193 height=149 mce_src="https://blogs.msdn.com/blogfiles/uberdemo/WindowsLiveWriter/MIX09ingitupwithaTetrisVersionofFlotzam_9077/clip_image006_thumb.jpg"></A> 
<P>Fig. 1: Example of the signature of a Square shape vs. a Tee shape. 
<P>The <B>GetShapeNeededInTable()</B> method returns the signature of entire width of the bottom of the table. This is a function that examines the height of the columns of the settled shapes in the table to obtain the signature. Once we have this, we can see if a shape can fit in the table by simply calling: ShapeNeeded.Contains(ts.ShapeSignature()). If the call returns true it’s a suitable shape and the shape is stored it in a temporary list that gets sorted based on the TetrisShape Weight property. If there’s more than one shape in the temporary list it randomly chooses one of the shapes with the two highest weights and returns the chosen shape. 
<P>The shape chosen then gets bound to the data source and gets added to the VisualTree and displayed on screen. When a row is completed it causes all the “settled” shapes to drop down one level. If a shape drops below the bottom threshold it gets removed from the VisualTree and also the table shape list to prevent a memory leak. 
<P>The main loop is the <STRONG>RunTetrisFlotzam()</STRONG> method, which is called at regular intervals by a timer (.7 seconds in by default.) This method contains a method that determines whether a shape can drop down or whether it is “settled” it also calls a function that animates the shapes from one position to the next in a programmatic manner. We wanted the animation to have easing, but it would take a bit of reorganization of the code to make this happen. 
<P>You’ll find the source code for Flotzam and Tetris Flotzam <A href="https://flotzam.com/" mce_href="https://flotzam.com/">here</A>. This was a fun project and perhaps you can make some interesting modifications to it. If you do, be sure to let us <A href="mailto:mixon@microsoft.com" mce_href="mailto:mixon@microsoft.com">know</A>! </P>]]></content:encoded>
    </item>
    <item>
      <title>A VirtualizedStackPanel Control in Silverlight 2.0</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/a-virtualizedstackpanel-control-in-silverlight-2-0</link>
      <pubDate>Wed, 18 Feb 2009 10:44:00 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/02/18/a-virtualizedstackpanel-control-in-silverlight-2-0/</guid>
      <description><![CDATA[When putting together the code for the Descry - Social Timeline visualization, I quickly discovered...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>When putting together the code for the </FONT><A href="https://www.visitmix.com/Lab/Descry" mce_href="https://www.visitmix.com/Lab/Descry"><FONT size=3 face=Calibri>Descry</FONT></A><FONT size=3 face=Calibri> - </FONT><A href="https://www.visitmix.com/labs/descry/socialtimeline/" mce_href="https://www.visitmix.com/labs/descry/socialtimeline/"><FONT size=3 face=Calibri>Social Timeline</FONT></A><FONT size=3 face=Calibri> visualization, I quickly discovered that when I subscribed to FriendFeed friends that contained large numbers of items, I eventually encountered performance issues. </FONT><A href="https://friendfeed.com/scobleizer" mce_href="https://friendfeed.com/scobleizer"><FONT size=3 face=Calibri>Scobleizer</FONT></A><FONT size=3 face=Calibri>’s feed was a great acid test, since he had about </FONT><A href="https://friendfeed.com/scobleizer/subscriptions" mce_href="https://friendfeed.com/scobleizer/subscriptions"><FONT size=3 face=Calibri>13K+</FONT></A><FONT size=3 face=Calibri> subscribers. We needed the Social Timeline to display, at a maximum, 3 months of subscriber data. I found as the total number of FriendFeed items approached 10K, scrolling and animating databound StackPanels became unacceptably slow. My opinion is that quick response time not only is a critical determining factor in user satisfaction, but also contributes to faster user feedback time and continuity, so that user can make better informed decisions.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3><FONT face=Calibri>It can be argued that what I was attempting to do was an architectural design flaw, since we were attempting to use StackPanels to represent one days’ worth of stacked FriendFeed items; a total of 93 StackPanels for 3 months of data. However, we wished to retain the resizing and scaling properties of the StackPanels’ parent Grid control and it’s ColumnDefinitions, so that we would could avoid writing messy sizing/positioning logic, that the Grid control, conveniently, already has built-in. As a result we would need to find another method to gain performance. We ended up choosing control virtualization, since the sheer number of FriendFeed items is what was causing the slowness.<SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>So, w<SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt">hat do I mean by “virtualized control?” A</SPAN> virtualized control is one that utilizes resources efficiently. You might ask: “Shouldn’t all controls utilize resources efficiently?” The answer to that is yes, but there are performance and behavior tradeoffs between a typical&nbsp;control and a virtualized control. Non-virtualized controls have all the databound UI already in memory. Virtualized controls are specialized controls geared for managing large amounts of data that need to bind UI on the fly, and they take a performance hit when doing this. Also, you’ll note that when scrolling the content of the virtual StackPanel control in this project that it does not smoothly scroll up a pixel as a time as a normal ListBox does, instead it scrolls up one item at a time. This is not a limitation of a virtualized&nbsp;control, but rather a limitation of this implementation. To implement this would take a bit more thought.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 12pt"><FONT face=Calibri>In other words, when a typical Silverlight control is databound to a data source that contains ten’s of thousand objects, it will literally contain ten’s of thousand UI elements in its’ visual tree; potentially using a vast amount of resources. The visual tree is maintained in memory (in addition to the original data source) whether the visual tree is onscreen or off! Conversely, a virtualized control while having access the to the data source in memory, would only contain the elements that need to be physically displayed within the viewable area of the control, resulting in a dramatically smaller set of items in the visual tree. </FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>This sample shows a virtualization technique for creating a scalable and performant ListBox-like control. There are two key classes: the VirtualizedStackPanel and the VirtualizedItemsControl. The <B style="mso-bidi-font-weight: normal">source</B> for this simple virtualized control is </FONT><A href="https://www.hugli.org/code/virtualizedcontrol/virtualizedcontrol.zip" mce_href="https://www.hugli.org/code/virtualizedcontrol/virtualizedcontrol.zip"><FONT color=#0000ff size=3 face=Calibri>here</FONT></A><FONT size=3 face=Calibri>.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><FONT size=3><FONT face=Calibri>VirtualizedStackPanel Role<o:p></o:p></FONT></FONT></B></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The VirtualizedStackPanel is a control that simply limits the number of children contained in its visual tree to only the items in the viewable area. <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>This control alone is unable to display the data properly, since a scrollbar is needed to manage the position of the currently viewable area; the VirtualizedItemsControl takes care of that need.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The VirtualizedStackPanel behaves as a normal StackPanel until a data generator is attached. The IDataGenerator implemented in the custom VirtualizedItemsControl lets the VirtualizedStackPanel know what children are currently in the active viewable area, based on control size and scrollbar position settings. As soon as the size of the control, or scrollbar position changes, the MeasureOverride method is called, and the control recalculates which children are to be added or removed from the visual tree. A ContentPresenter is acquired from the assigned data generator, so that a common DataTemplate can be used to define item UI. When the ContentPresenter Content property is set, the data is bound to the UI defined in the DataTemplate.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The main logic in the VirtualizedStackPanel is in the MeasureOverride method, creates new containers if they are needed when the control height increases, or reuses containers if no new ones are needed, and also removes unnecessary containers of the control height decreases. The ArrangeOverride simply positions all the children in the StackPanel vertically.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><FONT size=3><FONT face=Calibri>VirtualizedItemsControl Role<o:p></o:p></FONT></FONT></B></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>The VirtualizedItemsControl’s role is to act as a container for one or more Virtualized StackPanel’s. It manages the data source, a common DataTemplate that children use, and it also manages the Scrollbar positioning logic. The VirtualizedItemsControl implements the IDataGenerator interface that assists in communicating with its VirtualizedStackPanel children. This sample shows a single VirtualizedStackPanel child for brevity. But you may refer to the </FONT><A href="https://www.codeplex.com/descry/SourceControl/changeset/view/11246#186460" mce_href="https://www.codeplex.com/descry/SourceControl/changeset/view/11246#186460"><FONT color=#0000ff size=3 face=Calibri>VirtualizedTimelineItemsControl</FONT></A><FONT size=3 face=Calibri> in the </FONT><A href="https://www.codeplex.com/descry/Release/ProjectReleases.aspx?ReleaseId=22743" mce_href="https://www.codeplex.com/descry/Release/ProjectReleases.aspx?ReleaseId=22743"><FONT size=3 face=Calibri>Social Timeline project on CodePlex</FONT></A><FONT size=3 face=Calibri> for one that contains multiple children.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Incidentally, the VirtualizedItemsControl’s content is defined in the projects /Themes/Generic.xaml file, it could have been just as well defined procedurally, but it uses an external resource file for better designer / developer workflow. It is critical that this file exist in the project in the Themes folder, and note that this file needs to be&nbsp;defined as a resource in the project to avoid errors. I made the Silverlight 2 newbie&nbsp;mistake of not doing this, and I literally spent days trying to figure out why I couldn't get the project to work.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><FONT size=3><FONT face=Calibri>Resources<o:p></o:p></FONT></FONT></B></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>I found that writing a virtualized control wasn’t quite as complex as I had anticipated, after I broke down a much more complex sample. There is a good&nbsp;example of a full Implementation of a VirtualListBox in the </FONT><A href="https://www.codeplex.com/SLExtensions" mce_href="https://www.codeplex.com/SLExtensions"><FONT size=3 face=Calibri>Silverlight Extensions</FONT></A><FONT size=3 face=Calibri> project on CodePlex. Another related WPF VirtualizedCanvas sample by Chris Lovett that I found useful is located </FONT><A href="https://blogs.msdn.com/jgoldb/attachment/8116217.ashx" mce_href="https://blogs.msdn.com/jgoldb/attachment/8116217.ashx"><FONT size=3 face=Calibri>here</FONT></A><FONT size=3 face=Calibri>.</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><B style="mso-bidi-font-weight: normal"><FONT size=3><FONT face=Calibri>Descry and Codeplex<o:p></o:p></FONT></FONT></B></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT size=3 face=Calibri>Visit </FONT><A href="https://www.codeplex.com/descry/Release/ProjectReleases.aspx?ReleaseId=22743" mce_href="https://www.codeplex.com/descry/Release/ProjectReleases.aspx?ReleaseId=22743"><FONT size=3 face=Calibri>CodePlex</FONT></A><FONT size=3 face=Calibri> to download a more fully developed version of a virtualized control that supports mouse drag animation with physics, plus a VirtualizedListBox as well. And visit here to get the entire Descry project <A title=source href="https://www.codeplex.com/descry" mce_href="https://www.codeplex.com/descry">source</A>!</FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><o:p><FONT size=3 face=Calibri>&nbsp;</FONT></o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>Descry</title>
      <link>https://docs.microsoft.com/archive/blogs/uberdemo/descry</link>
      <pubDate>Sat, 31 Jan 2009 00:12:23 GMT</pubDate>
      <dc:creator><![CDATA[uberdemo]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/uberdemo/2009/01/31/descry/</guid>
      <description><![CDATA[“Ever wonder what goes into building an effective visualization? Look no further. We decided to roll...]]></description>
      <content:encoded><![CDATA[<p>“Ever wonder what goes into building an effective visualization? Look no further. We decided to roll up our sleeves and explore the topic. We're calling it Project Descry.”</p>  <p><a href="https://www.visitmix.com/Lab/Descry">Descry</a> is the new culmination of our “Innovative Web” teams efforts! It’s worth a check!</p>]]></content:encoded>
    </item>
  </channel>
</rss>