<?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>ALOMOHORA &#187; Silverlight</title>
	<atom:link href="http://alomohora.com/category/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://alomohora.com</link>
	<description>All about programming languages</description>
	<lastBuildDate>Tue, 25 Oct 2011 04:27:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What’s New in Silverlight 4?</title>
		<link>http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/</link>
		<comments>http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 17:01:31 +0000</pubDate>
		<dc:creator>alomohora</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight 4]]></category>

		<guid isPermaLink="false">http://alomohora.com/?p=2849</guid>
		<description><![CDATA[Silverlight 4 delivers a full suite of powerful capabilities to business application developers, bringing the best-of-breed .NET platform to browser-based experiences. Silverlight provides an ideal platform for developing and deploying modern business applications for both customer facing and staff-facing applications. Business Application Development Silverlight 4 consolidates its position as the natural choice for building business [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Silverlight 4 delivers a full suite of powerful capabilities to business application developers, bringing the best-of-breed .NET platform to browser-based experiences. Silverlight provides an ideal platform for developing and deploying modern business applications for both customer facing and staff-facing applications.</p>
<p style="text-align: justify;"><span id="more-2849"></span></p>
<h3 style="text-align: justify;">Business Application Development</h3>
<p style="text-align: justify;">Silverlight 4 consolidates its position as the natural choice for building business applications on the Web:</p>
<h4 style="text-align: justify;">New Features for Application Developers</h4>
<ul style="text-align: justify;">
<li>Comprehensive printing support enabling hardcopy reports and documents as well as a virtual print view, independent of screen content.</li>
<li>A full set of forms controls with over 60 customizable, styleable components. New controls include RichTextbox with hyperlinks, images, in-line controls, and editing. Enhanced controls include DataGrid with sortable/resizeable columns and copy/paste rows.</li>
<li>WCF RIA Services introduces enterprise class networking and data access for building n-tier applications including transactions, paging of data, WCF and HTTP enhancements.</li>
<li>Localization enhancements with Bi-Directional text, Right-to-Left support and complex scripts such as Arabic, Hebrew and 31 new languages including Vietnamese and Indic support.</li>
<li>The .NET Common Runtime (CLR) now enables the same compiled code to be run on the desktop and Silverlight without change.</li>
<li>Enhanced databinding support increases flexibility and productivity through data grouping/editing and string formatting within bindings.</li>
<li>Managed Extensibility Framework supports building large composite applications.</li>
<li>Exclusive tooling support for Silverlight, new in Visual Studio 2010. Including a full editable design surface, drag &amp; drop data-binding, automatically bound controls, datasource selection, integration with Expression Blend styling resources, Silverlight project support and full IntelliSense.</li>
</ul>
<h4 style="text-align: justify;">Developer tools</h4>
<ul style="text-align: justify;">
<li>Fully editable design surface for drawing out controls and layouts.</li>
<li>Rich property grid and new editors for values</li>
<li>Drag and drop support for databinding and automatically creating bound controls such as listbox, datagrid. New datasources window and picker.</li>
<li>Easy to pick styles and resources to make a good looking application based on designer resources built in Expression Blend.</li>
<li>Built in project support for Silverlight applications</li>
<li>Editor with full intellisense for XAML and C# and VB languages.</li>
</ul>
<h4 style="text-align: justify;">Empowering richer, more interactive experiences</h4>
<p style="text-align: justify;">Silverlight is already in use as a comprehensive platform for building rich experiences both for application and pure media scenarios including HD quality, interactive video through Smooth Streaming. Silverlight 4 introduces additional capabilities to enable creation of ever more rich, appealing high-performance interactive experiences and innovative media experiences:</p>
<ul style="text-align: justify;">
<li>Fluid interface enhancements advance application usability through animation effects.</li>
<li>Webcam and microphone to allow capture of audio and video on the client.</li>
<li>Bring data in to your application with features such as copy and paste or drag and drop.</li>
<li>Long lists can now be scrolled effortlessly with the mouse wheel.</li>
<li>Support conventional desktop interaction models through new features such as right-click context menu.</li>
<li>Support for Google’s Chrome browser.</li>
<li>Performance optimizations mean Silverlight 4 applications start quicker and run 200% faster than the equivalent Silverlight 3 application.</li>
<li>Multi-touch support enables a range of gestures and touch interactions to be integrated into user experiences.</li>
<li>Multicast networking, enabling Enterprises to lower the cost of streaming broadcast events such as company meetings and training, interoperating seamlessly with existing Windows Media Server streaming infrastructure.</li>
<li>Content protection for H.264 media through Silverlight DRM powered by PlayReady.</li>
<li>Output protection for audio/video streams allowing content owners or distributors to ensure protected content is only viewed through a secure video connection.</li>
</ul>
<h3 style="text-align: justify;">Move beyond the browser</h3>
<p style="text-align: justify;">Silverlight 3 pioneered the delivery of a new class of Rich Internet Applications to work on the desktop without additional code or runtimes. Silverlight 4 extends this capability:</p>
<h4 style="text-align: justify;">For Sandboxed applications</h4>
<ul style="text-align: justify;">
<li>Place HTML within your application enabling much tighter integration with content from web servers such as email, help and reports.</li>
<li>Provide support for ‘toast’ notification windows, allowing applications to communicate status or change information while the user is working on another application through a popup window on the taskbar.</li>
<li>Offline DRM, extending the existing Silverlight DRM powered by PlayReady technology to work offline. Protected content can be delivered with a persistent license so that users can go offline immediately and start enjoying their content.</li>
<li>Control over aspects of UI include window settings such as start position, size and chrome.</li>
</ul>
<h4 style="text-align: justify;">For Trusted applications</h4>
<ul style="text-align: justify;">
<li>Read and write files to the user’s MyDocuments, MyMusic, MyPictures and MyVideos folder (or equivalent for non-windows platforms) for example storage of media files and taking local copies of reports.</li>
<li>Run other desktop programs such as Office, for example requesting Outlook to send an email, send a report to Word or data to Excel.</li>
<li>COM automation enables access to devices and other system capabilities by calling into application components; for instance to access a USB security card reader.</li>
<li>A new user interface for requesting application privileges access outside the standard Silverlight sandbox.</li>
<li>Group policy objects allow organizations to tailor which applications may have elevated trust.</li>
<li>Full keyboard support in fullscreen mode richer kiosk and media applications.</li>
<li>Enhancements to networking allow cross-domain access without a security policy file.</li>
<li style="text-align: justify;">Custom Window ‘chrome’ to provide a highly branded experience</li>
</ul>
<h4>Incoming search terms for the article:</h4><p style="text-align: justify;"><a href="http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/" title="autoadjust layout in silverlight">autoadjust layout in silverlight</a>, <a href="http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/" title="Implementing Multi pages in Silverlight Applications">Implementing Multi pages in Silverlight Applications</a>, <a href="http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/" title="silverlight 4 navigate user control">silverlight 4 navigate user control</a>, <a href="http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/" title="silverlight iswitchable">silverlight iswitchable</a>, <a href="http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/" title="silverlight switcher">silverlight switcher</a></p>]]></content:encoded>
			<wfw:commentRss>http://alomohora.com/what%e2%80%99s-new-in-silverlight-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi Page Silverlight Application</title>
		<link>http://alomohora.com/multi-page-silverlight-application/</link>
		<comments>http://alomohora.com/multi-page-silverlight-application/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 07:31:43 +0000</pubDate>
		<dc:creator>alomohora</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://alomohora.com/?p=1647</guid>
		<description><![CDATA[There are a number of ways of implementing a multi-page Silverlight 2.0 application. Let’s begin by creating a new Silverlight application in Visual Studio (allowing it to create an ASP.NET Web Application Project) named SilverlightNavigation Notice that Visual Studio creates one page, Page.xaml for you by default and that Page.xaml is a UserControl (you can [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">There are a number of ways of implementing a multi-page Silverlight 2.0 application.</p>
<p style="text-align: justify;"><span id="more-1647"></span></p>
<p style="text-align: justify;">Let’s begin by creating a new Silverlight application in Visual Studio (allowing it to create an ASP.NET Web Application Project) named <strong>Silverlight<span>Navigation</span></strong></p>
<p style="text-align: justify;">Notice that Visual Studio creates one page, <strong><span>Page.xaml</span></strong> for you by default and that <strong>Page.xaml </strong>is a UserControl (you can see that by looking at the xaml view of <strong>Page.xaml</strong>).</p>
<p style="text-align: justify;">Add <strong>PageSwitcher.xaml</strong> as you would any other UserControl, but once it is created, take out the grid that Visual Studio creates for you and change the width and height of the UserControl to 300 x 300.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightNavigation.PageSwitcher&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;300&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;LayoutRoot&quot;</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;AliceBlue&quot;&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">This is the one UserControl that you will leave empty, because we will fill it programmatically with the contents of other pages as we go. It is, in essence, the vessel into which we’ll be pouring each page we want to view.</p>
<p style="text-align: justify;">The core of <strong>PageSwitcher.xaml.cs</strong> is an overloaded Navigate method that takes either a UserControl or a UserControl and an object.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">using</span> System;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Collections.Generic;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Linq;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Net;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Controls;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Documents;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Input;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media.Animation;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Shapes;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: blue;">namespace</span> SilverlightNavigation</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">partial</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">PageSwitcher</span> : <span style="color: #2b91af;">UserControl</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> PageSwitcher()</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InitializeComponent();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// 1st overload</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">void</span> Navigate(<span style="color: #2b91af;">UserControl</span> nextPage)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.Content = nextPage;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// 2nd overload</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">void</span> Navigate(<span style="color: #2b91af;">UserControl</span> nextPage, <span style="color: blue;">object</span> state)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.Content = nextPage;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">ISwitchable</span> s = nextPage <span style="color: blue;">as</span> <span style="color: #2b91af;">ISwitchable</span>;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (s != <span style="color: blue;">null</span>)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; s.UtilizeState(state);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">else</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">throw</span> <span style="color: blue;">new</span> <span style="color: #2b91af;">ArgumentException</span>(<span style="color: #a31515;">&quot;nextPage is not ISwitchable! &quot;</span> + nextPage.Name.ToString());</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">}</p>
</div>
<p style="text-align: justify;">The interface is just a promise that any class implementing the interface will implement UtilizeState. UtilizeState is a method that takes an object and returns void.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">using</span> System;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: blue;">namespace</span> SilverlightNavigation</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">interface</span> <span style="color: #2b91af;">ISwitchable</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">void</span> UtilizeState(<span style="color: blue;">object</span> state);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">}</p>
</div>
<p style="text-align: justify;">You create the interface by telling visual studio you want to create a new class named <strong>ISwitchable.cs</strong> and then replacing the class that it creates for you with the interface code shown.</p>
<p style="text-align: justify;">Before we go any further, we must update <strong>App.xaml.cs</strong>. Please replace the contents of <strong>Application_Startup</strong> with the following four lines of code.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">private</span> <span style="color: blue;">void</span> Application_Startup(<span style="color: blue;">object</span> sender, StartupEventArgs e)</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; PageSwitcher pageSwitcher = <span style="color: blue;">new</span> PageSwitcher();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">this</span>.RootVisual = pageSwitcher;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; Switcher.pageSwitcher = pageSwitcher;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; Switcher.Switch(<span style="color: blue;">new</span> Page());</p>
<p style="margin: 0px;">}</p>
</div>
<p style="text-align: justify;">Let’s create a very simple body for both <strong>Page.xaml</strong> and <strong>Page2.xaml</strong> to test the mechanism we’ve created.</p>
<p style="text-align: justify;">In Page, add the following <strong>Page.xaml</strong></p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightNavigation.Page&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;300&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;LayoutRoot&quot;</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;AliceBlue&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">TextBlock</span><span style="color: red;"> Text</span><span style="color: blue;">=&quot;Page1&quot;</span><span style="color: red;"> FontSize</span><span style="color: blue;">=&quot;18&quot;</span><span style="color: red;"> HorizontalAlignment</span><span style="color: blue;">=&quot;Center&quot; /&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;ButtonPage1&quot;</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Go To Page2&quot;</span><span style="color: red;"> FontSize</span><span style="color: blue;">=&quot;18&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;125&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot; /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">You’ll navigate to this new instance of Page2 through the static Switch method of the Switcher class.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">using</span> System;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Collections.Generic;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Linq;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Net;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Controls;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Documents;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Input;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media.Animation;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Shapes;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: blue;">namespace</span> SilverlightNavigation</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">partial</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Page</span> : <span style="color: #2b91af;">UserControl</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> Page()</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InitializeComponent();</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ButtonPage1.Click += <span style="color: blue;">new</span> <span style="color: #2b91af;">RoutedEventHandler</span>(ButtonPage1_Click);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">void</span> ButtonPage1_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">RoutedEventArgs</span> e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Switcher</span>.Switch(<span style="color: blue;">new</span> <span style="color: #2b91af;">Page2</span>());</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">}</p>
</div>
<p style="text-align: justify;">In Page, add the following <strong>Page2.xaml</strong></p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightNavigation.Page2&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;300&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;LayoutRoot&quot;</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;AliceBlue&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">TextBlock</span><span style="color: red;"> Text</span><span style="color: blue;">=&quot;Page2&quot;</span><span style="color: red;"> FontSize</span><span style="color: blue;">=&quot;18&quot;</span><span style="color: red;"> HorizontalAlignment</span><span style="color: blue;">=&quot;Center&quot; /&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;ButtonPage2&quot;</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Go To Page1&quot;</span><span style="color: red;"> FontSize</span><span style="color: blue;">=&quot;18&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;125&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot; /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">And <strong>Page2.xaml.cs</strong></p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">using</span> System;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Collections.Generic;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Linq;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Net;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Controls;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Documents;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Input;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Media.Animation;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Shapes;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: blue;">namespace</span> SilverlightNavigation</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">partial</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">Page2</span> : <span style="color: #2b91af;">UserControl</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> Page2()</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; InitializeComponent();</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ButtonPage2.Click += <span style="color: blue;">new</span> <span style="color: #2b91af;">RoutedEventHandler</span>(ButtonPage2_Click);</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">void</span> ButtonPage2_Click(<span style="color: blue;">object</span> sender, <span style="color: #2b91af;">RoutedEventArgs</span> e)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: #2b91af;">Switcher</span>.Switch(<span style="color: blue;">new</span> <span style="color: #2b91af;">Page</span>());</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">}</p>
</div>
<p style="text-align: justify;">Result</p>
<div id="silverlightControlHost" align="center">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightNavigation.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
		</object><br />
		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
	</div>
<p style="text-align: justify;"><a title="Silverlight Navigation" href="http://www.ziddu.com/download/11176480/SilverlightNavigation.rar.html">Source Code</a></p>
<h4>Incoming search terms for the article:</h4><p style="text-align: justify;"><a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi page application">silverlight multi page application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multiple pages">silverlight multiple pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi page silverlight application">multi page silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi page">silverlight multi page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multipage">silverlight multipage</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight page switcher">silverlight page switcher</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="PageSwitcher silverlight">PageSwitcher silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight Switcher">silverlight Switcher</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight next page">silverlight next page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi-page Silverlight application">multi-page Silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight pageswitcher">silverlight pageswitcher</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multiple pages in silverlight">multiple pages in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="page switcher in silverlight">page switcher in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to navigate from one xaml page to another xaml page in silverlight">how to navigate from one xaml page to another xaml page in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight application multiple page">silverlight application multiple page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multipage application in silver light 4">multipage application in silver light 4</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multipage application in silverlight">multipage application in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="designing multipage silverlight application">designing multipage silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto page">silverlight goto page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi-page application">silverlight multi-page application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multipage silverlight application">multipage silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="ISWITCHABLE SILVERLIGHT">ISWITCHABLE SILVERLIGHT</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi-page applications in silverlight">multi-page applications in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi page applications">silverlight multi page applications</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="buliding multiple page silverlight application in asp net codeproject">buliding multiple page silverlight application in asp net codeproject</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to use multiple xaml page in silverlight">how to use multiple xaml page in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multiple page">silverlight multiple page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to create multiple page silverlight application">how to create multiple page silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="add user control to page xaml in silverlight">add user control to page xaml in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi page silverlight">multi page silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight application with multiple pages">silverlight application with multiple pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight page usercontrol">silverlight page usercontrol</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi-page Silverlight app">multi-page Silverlight app</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight xaml switch pages samples c">silverlight xaml switch pages samples c</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight application programming multi pages">silverlight application programming multi pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight click switch to page">silverlight click switch to page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multiple page silverlight 4">multiple page silverlight 4</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="go to page silverlight">go to page silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multiple xaml in single page">silverlight multiple xaml in single page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to nevigate from one page to user control in silverlight">how to nevigate from one page to user control in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to create multipage silverlight application">how to create multipage silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight page navigation animation">silverlight page navigation animation</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight switch usercontrol">silverlight switch usercontrol</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="how to create multiple page in silverlight application">how to create multiple page in silverlight application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight switch page">silverlight switch page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Multi pages in Silverlight Applications Codeproject">Multi pages in Silverlight Applications Codeproject</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="How to create multiple pages in silverlight">How to create multiple pages in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="programmatically navigate to another xaml in silverlight navigation project">programmatically navigate to another xaml in silverlight navigation project</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="changing pages in silverlight programmatically">changing pages in silverlight programmatically</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="working with multiple page in silverlight">working with multiple page in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi page application in silverlight">multi page application in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="adding user control in silverlight page">adding user control in silverlight page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="navigate from one usercontrol xaml to another user control xaml">navigate from one usercontrol xaml to another user control xaml</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi xaml">silverlight multi xaml</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="programmatically navigate silverlight">programmatically navigate silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="page to page in silverlight">page to page in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="application multi pages silverlight 4">application multi pages silverlight 4</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="wpf iswitchable">wpf iswitchable</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi usercontrol">silverlight multi usercontrol</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multiple xaml pages">silverlight multiple xaml pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi page xaml">multi page xaml</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Iswitchable cs">Iswitchable cs</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Implementing Multi pages in Silverlight Applications">Implementing Multi pages in Silverlight Applications</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multiple usercontrol in xaml silverlight">multiple usercontrol in xaml silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Implementing Multi pages in Silverlight Applications\">Implementing Multi pages in Silverlight Applications\</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight iswitchable">silverlight iswitchable</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="create a multipage silverlight">create a multipage silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="multi page application silverlight">multi page application silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto new page">silverlight goto new page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multi page application navigation">silverlight multi page application navigation</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto page xaml">silverlight goto page xaml</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto">silverlight goto</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight login windows on multipage app">silverlight login windows on multipage app</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight multiple navigation page">silverlight multiple navigation page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Silverlight how to navigate to a page from usercontrol">Silverlight how to navigate to a page from usercontrol</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="Silverlight ISwitchable cs">Silverlight ISwitchable cs</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight layoutroot switchcontrol">silverlight layoutroot switchcontrol</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight login">silverlight login</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="PageSwitcher UserControl">PageSwitcher UserControl</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto xaml page">silverlight goto xaml page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight goto page2 xaml">silverlight goto page2 xaml</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight login navigation">silverlight login navigation</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight in vs2010 navigation from page to page">silverlight in vs2010 navigation from page to page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight login page example">silverlight login page example</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight go to page2">silverlight go to page2</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight go to page">silverlight go to page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="open multiple page in silverlight">open multiple page in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="run multiple xaml pages in silverlight">run multiple xaml pages in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="show multiple silverlight applications">show multiple silverlight applications</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 0 multi page application">silverlight 4 0 multi page application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 custom control multiple pages">silverlight 4 custom control multiple pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 muli-page application">silverlight 4 muli-page application</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 multiple pages">silverlight 4 multiple pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 navigate from usercontrol to page">silverlight 4 navigate from usercontrol to page</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="silverlight 4 programmatically page navigation">silverlight 4 programmatically page navigation</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="public void navigate(usercontrol nextpage)">public void navigate(usercontrol nextpage)</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="programmatically navigate pages in silverlight">programmatically navigate pages in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="print user control content in silverlight multiple pages">print user control content in silverlight multiple pages</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="page navigation animation in silverlight">page navigation animation in silverlight</a>, <a href="http://alomohora.com/multi-page-silverlight-application/" title="page switch control silverlight">page switch control silverlight</a></p>]]></content:encoded>
			<wfw:commentRss>http://alomohora.com/multi-page-silverlight-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate Media into Silverlight</title>
		<link>http://alomohora.com/integrate-media-into-silverlight/</link>
		<comments>http://alomohora.com/integrate-media-into-silverlight/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:12:51 +0000</pubDate>
		<dc:creator>alomohora</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://alomohora.com/?p=1624</guid>
		<description><![CDATA[Silverlight includes support to play audio and video files. It can play Windows Media Video (WMV), Windows Media Audio (WMA) and MP3 files. Adding media to a page is as simple as adding a MediaElement to your markup and providing a Uniform Resource Identifier (URI) to the media to play. The following example creates a [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Silverlight includes support to play audio and video files.</p>
<p style="text-align: justify;"><span id="more-1624"></span></p>
<p style="text-align: justify;">It can play Windows Media Video (WMV), Windows Media Audio (WMA) and MP3 files.</p>
<p style="text-align: justify;">Adding media to a page is as simple as adding a <strong>MediaElement</strong> to your markup and providing a Uniform Resource Identifier (URI) to the media to play. The following example creates a <strong>MediaElement</strong> and sets its <strong>Source</strong> property to the URI of a video file. The <strong>MediaElement</strong> begins playing when the page loads.</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">MediaElement</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&#8221;mediaElement&#8221;</span><span style="color: red;"> Source</span><span style="color: blue;">=&#8221;Bear.wmv&#8221;</span><span style="color: red;"> Width</span><span style="color: blue;">=&#8221;250&#8243;</span><span style="color: red;"> Height</span><span style="color: blue;">=&#8221;250&#8243; </span><span style="color: blue;">/&gt;</span></p>
</div>
<p style="text-align: justify;">We can control media playback by using the <strong>Play</strong>, <strong>Pause</strong>, and <strong>Stop</strong> methods of a <strong>MediaElement</strong> object.</p>
<div id="silverlightControlHost" align="center">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightMedia.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
		</object><br />
		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
	</div>
<p style="text-align: justify;"><a title="Silverlight Media" href="http://www.ziddu.com/download/11176446/SilverlightMedia.rar.html">Download Code</a></p>
<h4>Incoming search terms for the article:</h4><p style="text-align: justify;"><a href="http://alomohora.com/integrate-media-into-silverlight/" title="MediaElement do not play wmv">MediaElement do not play wmv</a></p>]]></content:encoded>
			<wfw:commentRss>http://alomohora.com/integrate-media-into-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight (Layout Management)</title>
		<link>http://alomohora.com/silverlight-layout-management/</link>
		<comments>http://alomohora.com/silverlight-layout-management/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 06:45:46 +0000</pubDate>
		<dc:creator>alomohora</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://alomohora.com/?p=349</guid>
		<description><![CDATA[Silverlight and WPF support a flexible layout management system that enables developers and designers to easily coordinate how controls are positioned within a UI surface. This layout system supports both a fixed position model where controls are positioned using explicit coordinates, as well as a more dynamic position model where layout and controls can be [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Silverlight and WPF support a flexible layout management system that enables developers and designers to easily coordinate how controls are positioned within a UI surface.  This layout system supports both a fixed position model where controls are positioned using explicit coordinates, as well as a more dynamic position model where layout and controls can be automatically sized and flowed as the browser resizes.</p>
<p style="text-align: justify;"><span id="more-349"></span></p>
<p style="text-align: justify;">Developers using Silverlight and WPF use layout panels to coordinate the position and resizing of controls contained within them.  The built-in layout panels in Silverlight 2 include three of the most commonly used ones in WPF:</p>
<ul type="disc">
<li style="text-align: justify;">Canvas</li>
<li style="text-align: justify;">Stack Panel</li>
<li style="text-align: justify;">Grid</li>
</ul>
<p style="text-align: justify;"><strong>Canvas Panel</strong></p>
<p style="text-align: justify;">The Canvas panel is a pretty basic layout panel that supports positioning controls contained within it using explicit coordinates.</p>
<p style="text-align: justify;">You position elements in a Canvas using a XAML feature called &#8220;Attached Properties&#8221; &#8211; which allow you to specify a control&#8217;s position relative to its immediate parent Canvas control&#8217;s Left, Top, Right or Bottom coordinates.  Attached properties are useful as they allow a parent panel to extend the property set of a control contained within it. Canvas, by defining an attached property for “Top” and ”Left” basically adds the ability to define left and top attachment on Button (or any other UI element that is added to the Canvas), without any need to actually add a property to the Button class, or modify the Button class in any way.</p>
<p style="text-align: justify;">We could add two buttons to a Canvas container, and position them both 50 pixels from the left of the Canvas, and 50 and 150 pixels from the top using XAML like below (the Canvas.Left and Canvas.Top attributes are examples of the attached property syntax):</p>
<p style="text-align: center;"><a title="layout-management1" href="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management1.jpg"><img class="size-medium wp-image-350 aligncenter" title="Alomohora - Silverlight - Layout Management1" src="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management1.jpg?w=300&amp;h=100" alt="Alomohora - Silverlight - Layout Management1" width="300" height="100" /></a></p>
<p style="text-align: justify;">The code</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightSample.Page&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;300&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Canvas</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;#FF5C7590&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Canvas.Left</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Canvas.Top</span><span style="color: blue;">=&quot;50&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button2&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Canvas.Left</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Canvas.Top</span><span style="color: blue;">=&quot;150&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Canvas</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">This would then render our buttons like below:</p>
<div id="silverlightControlHost" align="center">
	<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightApplicationCanvas.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
	</object></p>
<p>	<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
<p style="text-align: justify;"><a href="http://www.ziddu.com/download/11176547/SilverlightSample%20-%20Canvas%20Panel.zip.html">Download source code for Canvas Panel</a></p>
<p style="text-align: justify;">While the Canvas is useful for scenarios where the UI elements contained within it never move, it tends not to be very flexible as you add more controls into it or handle scenarios where the UI needs to resize or move. In cases like these you end up having to manually write code yourself to move things around inside the Canvas (which is a pain). A better solution for these dynamic scenarios is typically to use an alternative layout panel that has built-in semantics to-do this for you &#8211; like the StackPanel and Grid.</p>
<p style="text-align: justify;"><strong>StackPanel</strong></p>
<p style="text-align: justify;">The StackPanel control is a simple layout panel that supports positioning its contained controls in either a row or column layout.  StackPanels are typically used in scenarios where you want to arrange a small subsection of the UI on your page.</p>
<p style="text-align: justify;">For example, we could use the StackPanel to vertically arrange three buttons on our page using XAML markup like below:</p>
<p style="text-align: center;"><a title="layout-management3" href="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management3.jpg"><img class="size-medium wp-image-357 aligncenter" title="Alomohora - Silverlight - Layout Management3" src="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management3.jpg?w=300&amp;h=145" alt="Alomohora - Silverlight - Layout Management3" width="300" height="145" /></a></p>
<p style="text-align: justify;">The code</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightSample.Page&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;400&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">StackPanel</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;#FF5C7590&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button2&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button3&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">StackPanel</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">At runtime the StackPanel would then automatically arrange the Button controls in a vertical stack for us like below:</p>
<div id="silverlightControlHost" align="center">
	<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightApplicationStackPanel.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
	</object></p>
<p>	<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
<p style="text-align: justify;"><a href="http://www.ziddu.com/download/11176556/SilverlightSample%20-%20StackPanel.zip.html">Download source code for Stack Panel</a></p>
<p style="text-align: justify;">We could alternatively set the &#8220;Orientation&#8221; property of the StackPanel to be &#8220;Horizontal&#8221; instead of Vertical (which is the default):</p>
<p style="text-align: center;"><a title="layout-management5" href="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management5.jpg"><img class="size-medium wp-image-354 aligncenter" title="Alomohora - Silverlight - Layout Management5" src="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management5.jpg?w=300&amp;h=145" alt="Alomohora - Silverlight - Layout Management5" width="269" height="300" /></a></p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightSample.Page&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;400&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">StackPanel</span><span style="color: red;"> Orientation</span><span style="color: blue;">=&quot;Horizontal&quot;</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;#FF5C7590&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button2&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button3&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Margin</span><span style="color: blue;">=&quot;10&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">StackPanel</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">This will then cause the StackPanel to automatically arrange the Button controls in a horizontal row like below:</p>
<div align="center">
<div id="silverlightControlHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightApplicationStackPanelOrientation.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
				<img src="http://storage.timheuer.com/sl4wp-ph.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/><br />
			</a><br />
		</object></p>
<p>		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
	</div>
<p>
</div>
<p style="text-align: justify;"><a href="http://www.ziddu.com/download/11176570/SilverlightSample%20-%20StackPanel%20(Orientation).zip.html">Download source code for Stack Panel (Orientation)</a></p>
<p style="text-align: justify;"><strong>Grid Panel</strong></p>
<p style="text-align: justify;">The Grid control is the most flexible layout panel, and supports arranging controls in multi-row and multi-column layouts.  It is conceptually similar to an HTML Table element.</p>
<p style="text-align: justify;">Unlike an HTML Table, you don&#8217;t embed controls within column and row elements.  Instead you specify a Grid&#8217;s Row and Column definitions using &lt;Grid.RowDefinitions&gt; and &lt;Grid.ColumnDefinitions&gt; properties that are declared immediately under the &lt;Grid&gt; control.  You can then use the XAML &#8220;Attached Property&#8221; syntax on controls contained within the grid to indicate which Grid row and column they should be populated within.</p>
<p style="text-align: justify;">For example, we could declare a Grid layout has three rows and three columns, and then position 4 buttons within it using XAML like below:</p>
<p style="text-align: center;"><a title="layout-management7" href="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management7.jpg"><img class="size-medium wp-image-355 aligncenter" title="Alomohora - Silverlight - Layout Management7" src="http://makiki.files.wordpress.com/2009/02/alomohora-silverlight-layout-management7.jpg?w=269&amp;h=300" alt="Alomohora - Silverlight - Layout Management7" width="300" height="196" /></a></p>
<p style="text-align: justify;">The code</p>
<div style="font-family: Courier New; font-size: 8pt; color: black; background: white;">
<p style="margin: 0px;"><span style="color: blue;">&lt;</span><span style="color: #a31515;">UserControl</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Class</span><span style="color: blue;">=&quot;SilverlightSample.Page&quot;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> xmlns</span><span style="color: blue;">:</span><span style="color: red;">x</span><span style="color: blue;">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp; <span style="color: red;"> Width</span><span style="color: blue;">=&quot;400&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;300&quot;&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;#FF5C7590&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid.RowDefinitions</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">RowDefinition</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;60&quot; /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">RowDefinition</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;60&quot; /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">RowDefinition</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;60&quot; /&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid.RowDefinitions</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid.ColumnDefinitions</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">ColumnDefinition</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;110&quot;/&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">ColumnDefinition</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;110&quot;/&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">ColumnDefinition</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;110&quot;/&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid.ColumnDefinitions</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Grid.Column</span><span style="color: blue;">=&quot;1&quot;</span><span style="color: red;"> Grid.Row</span><span style="color: blue;">=&quot;0&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Grid.Column</span><span style="color: blue;">=&quot;2&quot;</span><span style="color: red;"> Grid.Row</span><span style="color: blue;">=&quot;1&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Grid.Column</span><span style="color: blue;">=&quot;0&quot;</span><span style="color: red;"> Grid.Row</span><span style="color: blue;">=&quot;1&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;Button1&quot;</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;100&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;50&quot;</span><span style="color: red;"> Grid.Column</span><span style="color: blue;">=&quot;1&quot;</span><span style="color: red;"> Grid.Row</span><span style="color: blue;">=&quot;2&quot;&gt;&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: blue;">&lt;/</span><span style="color: #a31515;">UserControl</span><span style="color: blue;">&gt;</span></p>
</div>
<p style="text-align: justify;">The Grid layout panel would then position the Button elements for us like so:</p>
<div id="silverlightControlHost" align="center">
	<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightApplicationStackPanelOrientation.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
	</object></p>
<p>	<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
<p style="text-align: justify;"><a href="http://www.ziddu.com/download/11176571/SilverlightSample%20-%20Grid%20Panel.zip.html">Download source code for Grid Panel</a></p>
<p style="text-align: justify;">n addition to supporting absolute sizing (for example: Height=&#8221;60&#8243;) the Grid&#8217;s RowDefinition and ColumnDefinition controls also support an AutoSizing mode (Height=&#8221;Auto&#8221;), which automatically sizes the Grid or Row based on the size of the content contained within it (you can also optionally specify maximum and minimum size constraints &#8211; which can be very useful).</p>
<p style="text-align: justify;">The Grid&#8217;s Row and ColumnDefinitions also support a feature called &#8220;Proportional Sizing&#8221; &#8211; which enables the size of a Grid&#8217;s Rows and Columns to be spaced proportionally relative to each other (for example: you could have the second row grow at 2x the rate of the first one).</p>
<p style="text-align: justify;">You&#8217;ll find that the Grid provides a ton of power and flexibility &#8211; and it will probably be the most common layout panel control you&#8217;ll end up using.</p>
<h4>Incoming search terms for the article:</h4><p style="text-align: justify;"><a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout management">silverlight layout management</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="#FF5C7590">#FF5C7590</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight dynamic layout arrange browser">silverlight dynamic layout arrange browser</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight move canvas based on content">silverlight move canvas based on content</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="Silverlight UI Layout">Silverlight UI Layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight flexible layout">silverlight flexible layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="layout management silverlight">layout management silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="grid background">grid background</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout panels">silverlight layout panels</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout manager">silverlight layout manager</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="width * auto silverlight">width * auto silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight auto resize controls">silverlight auto resize controls</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="GridPanel Delphi">GridPanel Delphi</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight grid with dynamic height size">silverlight grid with dynamic height size</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight grid layout position elements">silverlight grid layout position elements</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight grid with horizontal rows">silverlight grid with horizontal rows</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight insert element in stackpanel at runtime">silverlight insert element in stackpanel at runtime</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout">silverlight layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight moving stackpanel">silverlight moving stackpanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout bottom">silverlight layout bottom</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="Silverlight layout cause">Silverlight layout cause</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight grid get top left position">silverlight grid get top left position</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight grid elements">silverlight grid elements</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="set ListBoxDragDropTarget Grid Column from codeBehind#">set ListBoxDragDropTarget Grid Column from codeBehind#</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="Silverlight ArrangeElement canvas">Silverlight ArrangeElement canvas</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight button fixed position">silverlight button fixed position</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight canvas move margin">silverlight canvas move margin</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight canvas top attribute">silverlight canvas top attribute</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight change location of control in code">silverlight change location of control in code</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight control move/resize attach property#">silverlight control move/resize attach property#</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight control three panel">silverlight control three panel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight coordinates canvas">silverlight coordinates canvas</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight dynamic panel">silverlight dynamic panel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight fixed control position">silverlight fixed control position</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight flexible resizable grid">silverlight flexible resizable grid</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="Silverlight Get Position of dyamic button">Silverlight Get Position of dyamic button</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight get top left of ui element without margin">silverlight get top left of ui element without margin</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout control">silverlight layout control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout example">silverlight layout example</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight: resize panel based on browser size">silverlight: resize panel based on browser size</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight stackpanel bottom attached to grid">silverlight stackpanel bottom attached to grid</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight stackpanel proportional">silverlight stackpanel proportional</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight stunning UI#">silverlight stunning UI#</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight usercontrol in stakpanel">silverlight usercontrol in stakpanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight usercontrol move grid">silverlight usercontrol move grid</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight usercontrol position bottom">silverlight usercontrol position bottom</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="stunning silverlight layout">stunning silverlight layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="usercontrol cause arrange silverlight">usercontrol cause arrange silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="what is move silverlight control relative to other control">what is move silverlight control relative to other control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="WPF alternative layout">WPF alternative layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="wpf flexible layout with grid">wpf flexible layout with grid</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight stackpanel">silverlight stackpanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight set height auto">silverlight set height auto</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout panel from code">silverlight layout panel from code</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layout with user control">silverlight layout with user control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight layoutcontrol with autosized content">silverlight layoutcontrol with autosized content</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight listboxdragdroptarget grid">silverlight listboxdragdroptarget grid</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight move control">silverlight move control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight move resize ui elements">silverlight move resize ui elements</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight panel control">silverlight panel control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight panel layout left">silverlight panel layout left</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight panel move">silverlight panel move</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight pixels coordinates">silverlight pixels coordinates</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight position on the bottom of canvas">silverlight position on the bottom of canvas</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="silverlight postion relative to other control">silverlight postion relative to other control</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="xaml 3 columns layout examples">xaml 3 columns layout examples</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="3 column layout in siverlight">3 column layout in siverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="elements inside a coordinate in silverlight">elements inside a coordinate in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="explicit coordinates">explicit coordinates</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="find bottom coordinate silverlight">find bottom coordinate silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="fix element position silverlight">fix element position silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="fix position control on right bottom of browser silverlight">fix position control on right bottom of browser silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="fixed position elements silverlight">fixed position elements silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="fixed position layout in silverlight">fixed position layout in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="flexible grid layout in silverlight">flexible grid layout in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="flexible width layout in silverlight">flexible width layout in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="get control row and column coordinates in canvas silverlight">get control row and column coordinates in canvas silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="get left top parent canvas xaml">get left top parent canvas xaml</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="get width control silverlight auto">get width control silverlight auto</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="google silverlight layout">google silverlight layout</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="dynamic grid layout in silverlight">dynamic grid layout in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="delphi dbgrid three rows">delphi dbgrid three rows</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="ColumnDefinition Proportional Sizing">ColumnDefinition Proportional Sizing</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="3 main built in layout panels in silverlight">3 main built in layout panels in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="adding a canvas control insside a grid silverlight">adding a canvas control insside a grid silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="alternate layouts at runtime silverlight">alternate layouts at runtime silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="arrange control at runtime in stackpanel">arrange control at runtime in stackpanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="arranging buttons in a stackpanel">arranging buttons in a stackpanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="attach ui element to canvas">attach ui element to canvas</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="attached properties silverlight">attached properties silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="auto adjust the relative position of component in layout silverlight">auto adjust the relative position of component in layout silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="auto arrange panel in silverlight">auto arrange panel in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="automatic resizing stackpanel at runtime in silverlight">automatic resizing stackpanel at runtime in silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="better silverlight wpf layout paanel">better silverlight wpf layout paanel</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="canvas background samples using xaml">canvas background samples using xaml</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="canvas ou grid resize silverlight">canvas ou grid resize silverlight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="communication between different dynamically loaded xaps#sclient=psy-ab">communication between different dynamically loaded xaps#sclient=psy-ab</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="grid panel silvelight">grid panel silvelight</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="moving controls silverlight canvas">moving controls silverlight canvas</a>, <a href="http://alomohora.com/silverlight-layout-management/" title="page layout management in silverlight">page layout management in silverlight</a></p>]]></content:encoded>
			<wfw:commentRss>http://alomohora.com/silverlight-layout-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tooltip for Silverlight</title>
		<link>http://alomohora.com/tooltip-for-silverlight/</link>
		<comments>http://alomohora.com/tooltip-for-silverlight/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 06:23:00 +0000</pubDate>
		<dc:creator>alomohora</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://alomohora.com/?p=1508</guid>
		<description><![CDATA[Silverlight offers a class called “ToolTipService” which can be used to display tooltips for Silverlight controls. This class can be attached to most of the UI elements in Silverlight to display tooltips. The below sample code shows how to display a simple text tooltip for a Button control: &#160;&#160;&#160; &#60;Grid x:Name=&#34;LayoutRoot&#34; Background=&#34;White&#34;&#62; &#160;&#160;&#160; &#160;&#160;&#160; &#60;Button [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Silverlight offers a class called “ToolTipService” which can be used to display tooltips for Silverlight controls. This class can be attached to most of the UI elements in Silverlight to display tooltips.</p>
<p style="text-align: justify;"><span id="more-1508"></span></p>
<p style="text-align: justify;">The below sample code shows how to display a simple text tooltip for a Button control:</p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: red;"> x</span><span style="color: blue;">:</span><span style="color: red;">Name</span><span style="color: blue;">=&quot;LayoutRoot&quot;</span><span style="color: red;"> Background</span><span style="color: blue;">=&quot;White&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: red;"> Width</span><span style="color: blue;">=&quot;80&quot;</span><span style="color: red;"> Height</span><span style="color: blue;">=&quot;40&quot;</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;My Button&quot;&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">ToolTipService.ToolTip</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;</span><span style="color: #a31515;">ToolTip</span><span style="color: red;"> Content</span><span style="color: blue;">=&quot;This is tool tip for Button&quot;&gt;&lt;/</span><span style="color: #a31515;">ToolTip</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">ToolTipService.ToolTip</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Button</span><span style="color: blue;">&gt;</span></p>
<p style="margin: 0px;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: blue;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: blue;">&gt;</span></p>
<p style="text-align: justify;">And the result</p>
<div id="silverlightControlHost" align="center">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="300" height="300"><param name="source" value="http://alomohora.com/wp-silverlight/SilverlightTooltip.xap"/><param name="background" value="white" /><param name="minRuntimeVersion" value="2.0.31005.0" /><param name="enableHtmlAccess" value="true" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><img src="http://makiki.wordpress.com/files/2009/05/silverlightforwordpress.png" alt="Install Microsoft Silverlight" style="border-style: none; width:400px; height:200px"/></a><br />
		</object><br />
		<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
	</div>
<p></br></p>
<h4>Incoming search terms for the article:</h4><p style="text-align: justify;"><a href="http://alomohora.com/tooltip-for-silverlight/" title="silverlight grid with tooltip">silverlight grid with tooltip</a>, <a href="http://alomohora.com/tooltip-for-silverlight/" title="tooltip on button in silverlight">tooltip on button in silverlight</a></p>]]></content:encoded>
			<wfw:commentRss>http://alomohora.com/tooltip-for-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

