SilverlightShow: Layout controls in Silverlight Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) RE: Layout controls in Silverlight 2 <p>Hi Abhijit,</p> <p>The problem is in the following row:</p> <div class="reCodeBlock" style="border:1px solid #7f9db9;overflow-y: auto;"> <div style="background-color: #ffffff;"><span style="margin-left: 0px !important;"><code style="color: #000000;"><</code><code style="color: #006699; font-weight: bold;">Grid.RowDefinitions</code> <code style="color: #808080;">Height</code><code style="color: #000000;">=</code><code style="color: blue;">"*"</code><code style="color: #000000;">></code></span></div> </div> <p>Note that Grid.RowDefinitions has no Height property, although its child elements have.</p> <p>You should use this to achieve what you intend:</p> <div class="reCodeBlock" style="border:1px solid #7f9db9;overflow-y: auto;"> <div style="background-color: #ffffff;"><span style="margin-left: 0px !important;"><code style="color: #000000;"><</code><code style="color: #006699; font-weight: bold;">Grid.RowDefinitions</code><code style="color: #000000;">></code></span></div> <div style="background-color: #f8f8f8;"><span><code>    </code><span style="margin-left: 12px !important;"><code style="color: #000000;"><</code><code style="color: #006699; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000000;">=</code><code style="color: blue;">"*"</code><code style="color: #000000;">></</code><code style="color: #006699; font-weight: bold;">RowDefinition</code><code style="color: #000000;">></code></span></span></div> <div style="background-color: #ffffff;"><span><code>    </code><span style="margin-left: 12px !important;"><code style="color: #000000;"><</code><code style="color: #006699; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000000;">=</code><code style="color: blue;">"100"</code><code style="color: #000000;">></</code><code style="color: #006699; font-weight: bold;">RowDefinition</code><code style="color: #000000;">></code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>    </code><span style="margin-left: 12px !important;"><code style="color: #000000;"><</code><code style="color: #006699; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000000;">=</code><code style="color: blue;">"100"</code><code style="color: #000000;">></</code><code style="color: #006699; font-weight: bold;">RowDefinition</code><code style="color: #000000;">></code></span></span></div> <div style="background-color: #ffffff;"><span style="margin-left: 0px !important;"><code style="color: #000000;"></</code><code style="color: #006699; font-weight: bold;">Grid.RowDefinitions</code><code style="color: #000000;">></code></span></div> </div> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment5102 lnikolov http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Thu, 16 Dec 2010 11:35:19 GMT RE: Layout controls in Silverlight 3 <p>Hay i did this using silverlight 3,<br /> Bue while execution error has occured...<br /> Error 1 Unexpected ATTRIBUTE in parse rule PropertyElement ::= . PROPERTYELEMENT Content? ENDTAG.. C:\Documents and Settings\Abhijit\My Documents\Visual Studio 2010\Projects\basic s controls\basic s controls\MainPage.xaml basic s controls<br /> <br /> please sugest me the soln...<br /> my MainPage,Xaml Code as fallow,</p> <div class="reCodeBlock" style="overflow-y: auto;border: #7f9db9 1px solid;"> <div style="background-color: #fff;"><span style="margin-left: 0px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">UserControl</code> <code style="color: #808080;">x:Class</code><code style="color: #000;">=</code><code style="color: blue;">"basic_s_controls.MainPage"</code> </span></div> <div style="background-color: #f8f8f8;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">xmlns</code><code style="color: #000;">=</code><code style="color: blue;">"<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" originalPath="http://schemas.microsoft.com/winfx/2006/xaml/presentation" originalAttribute="href">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>"</code> </span></span></div> <div style="background-color: #fff;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">xmlns:x</code><code style="color: #000;">=</code><code style="color: blue;">"<a href="http://schemas.microsoft.com/winfx/2006/xaml" originalPath="http://schemas.microsoft.com/winfx/2006/xaml" originalAttribute="href">http://schemas.microsoft.com/winfx/2006/xaml</a>"</code> </span></span></div> <div style="background-color: #f8f8f8;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">xmlns:d</code><code style="color: #000;">=</code><code style="color: blue;">"<a href="http://schemas.microsoft.com/expression/blend/2008" originalPath="http://schemas.microsoft.com/expression/blend/2008" originalAttribute="href">http://schemas.microsoft.com/expression/blend/2008</a>"</code> </span></span></div> <div style="background-color: #fff;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">xmlns:mc</code><code style="color: #000;">=</code><code style="color: blue;">"<a href="http://schemas.openxmlformats.org/markup-compatibility/2006" originalPath="http://schemas.openxmlformats.org/markup-compatibility/2006" originalAttribute="href">http://schemas.openxmlformats.org/markup-compatibility/2006</a>"</code> </span></span></div> <div style="background-color: #f8f8f8;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">xmlns:UserControl</code><code style="color: #000;">=</code><code style="color: blue;">"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"</code> </span></span></div> <div style="background-color: #fff;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">mc:Ignorable</code><code style="color: #000;">=</code><code style="color: blue;">"d"</code> </span></span></div> <div style="background-color: #f8f8f8;"><span><code>             </code><span style="margin-left: 39px !important;"><code style="color: #808080;">d:DesignWidth</code><code style="color: #000;">=</code><code style="color: blue;">"400"</code> <code style="color: #808080;">d:DesignHeight</code><code style="color: #000;">=</code><code style="color: blue;">"300"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>    </code><span style="margin-left: 12px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Grid</code> <code style="color: #808080;">x:Name</code><code style="color: #000;">=</code><code style="color: blue;">"grroot"</code> <code style="color: #808080;">Background</code><code style="color: #000;">=</code><code style="color: blue;">"White"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"300"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"400"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Grid.RowDefinitions</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"*"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"*"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">RowDefinition</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">RowDefinition</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">RowDefinition</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">RowDefinition</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Grid.RowDefinitions</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Grid.ColumnDefinitions</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">ColumnDefinition</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"*"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">ColumnDefinition</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">ColumnDefinition</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"300"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">ColumnDefinition</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Grid.ColumnDefinitions</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">StackPanel</code> <code style="color: #808080;">x:Name</code><code style="color: #000;">=</code><code style="color: blue;">"firstrowfirstcolumn"</code> <code style="color: #808080;">Background</code><code style="color: #000;">=</code><code style="color: blue;">"Aquamarine"</code> <code style="color: #808080;">Grid.Column</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Grid.Row</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Orientation</code><code style="color: #000;">=</code><code style="color: blue;">"Horizontal"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Insert"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"-:)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Update"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"5"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">":)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Delete"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"5"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">":)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Search"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"5"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">":)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Back"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">":)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"50"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">"Next"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Button</code> <code style="color: #808080;">Content</code><code style="color: #000;">=</code><code style="color: blue;">":)"</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Button</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">StackPanel</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">StackPanel</code> <code style="color: #808080;">x:Name</code><code style="color: #000;">=</code><code style="color: blue;">"ThirdRowSecColumn"</code> <code style="color: #808080;">Grid.Row</code><code style="color: #000;">=</code><code style="color: blue;">"2"</code> <code style="color: #808080;">Grid.Column</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Background</code><code style="color: #000;">=</code><code style="color: blue;">"Honeydew"</code> <code style="color: #808080;">Orientation</code><code style="color: #000;">=</code><code style="color: blue;">"Horizontal"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Rectangle</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"BlanchedAlmond"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Rectangle</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Ellipse</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"8"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"45"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"Gold"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Ellipse</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Rectangle</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"LightBlue"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Rectangle</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Ellipse</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"8"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"Moccasin"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Ellipse</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Canvas</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"100"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Rectangle</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"10"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"20"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"Lavender"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Rectangle</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">Ellipse</code> <code style="color: #808080;">Canvas.Left</code><code style="color: #000;">=</code><code style="color: blue;">"8"</code> <code style="color: #808080;">Canvas.Top</code><code style="color: #000;">=</code><code style="color: blue;">"55"</code> <code style="color: #808080;">Canvas.ZIndex</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Height</code><code style="color: #000;">=</code><code style="color: blue;">"30"</code> <code style="color: #808080;">Width</code><code style="color: #000;">=</code><code style="color: blue;">"70"</code> <code style="color: #808080;">Fill</code><code style="color: #000;">=</code><code style="color: blue;">"Lime"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">Ellipse</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Canvas</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">StackPanel</code> <code style="color: #808080;">x:Name</code><code style="color: #000;">=</code><code style="color: blue;">"FirstRowSecColumn"</code> <code style="color: #808080;">Background</code><code style="color: #000;">=</code><code style="color: blue;">"Aqua"</code> <code style="color: #808080;">Grid.Row</code><code style="color: #000;">=</code><code style="color: blue;">"0"</code> <code style="color: #808080;">Grid.Column</code><code style="color: #000;">=</code><code style="color: blue;">"1"</code> <code style="color: #808080;">Orientation</code><code style="color: #000;">=</code><code style="color: blue;">"Horizontal"</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>                </code><span style="margin-left: 48px !important;"><code style="color: #000;"><</code><code style="color: #069; font-weight: bold;">TextBlock</code> <code style="color: #808080;">Text</code><code style="color: #000;">=</code><code style="color: blue;">"I Did this"</code><code style="color: #000;">></</code><code style="color: #069; font-weight: bold;">TextBlock</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>            </code><span style="margin-left: 36px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">StackPanel</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span><code>        </code><span style="margin-left: 24px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">StackPanel</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>    </code><span style="margin-left: 12px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">Grid</code><code style="color: #000;">> </code></span></span></div> <div style="background-color: #fff;"><span style="margin-left: 0px !important;"><code style="color: #000;"></</code><code style="color: #069; font-weight: bold;">UserControl</code><code style="color: #000;">></code></span></div> </div> <p><span style="font-family: consolas; font-size: 13px;">pppppppplllllllllllllleeeeeeeaaaasssssseeeeee.....</span></p> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment4857 Abhijit Mane http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Mon, 15 Nov 2010 11:30:35 GMT RE: Layout controls in Silverlight 2 Thanks for the article. http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment3493 Kareem http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Sat, 24 Apr 2010 23:17:14 GMT RE: Layout controls in Silverlight 2 Nice article,,, just the right dose of information i needed for a startup http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment3319 Passionate about Silverlight http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Mon, 29 Mar 2010 10:26:53 GMT RE: Layout controls in Silverlight 2 Thank you for posting these simple articles. It helps n00bs like me :) http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment3168 Jonathan http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Fri, 05 Mar 2010 05:33:40 GMT RE: Layout controls in Silverlight 2 <p>Very nice article.  </p> <p>But I don't like to background image. :(</p> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment2426 Arun http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Fri, 02 Oct 2009 10:16:44 GMT RE: Layout controls in Silverlight 2 <p>Its really useful but want to know how scrolling of page is working in SL2</p> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment224 amruta http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Mon, 07 Jul 2008 03:30:42 GMT RE: Layout controls in Silverlight 2 <p>Thanks for your remark, John. I corrected it.</p> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment211 nikolayraychev http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Tue, 01 Jul 2008 23:33:32 GMT RE: Layout controls in Silverlight 2 <ul> <li>There are also four more ancestors of the <em>Panel</em> Class: <em>DataGridCellsPresenter</em>, <em>DataGridColumnHeadersPresenter</em>, <em>DataGridDetailsPresenter</em>, <em>DataGridRowsPresenter</em>.</li> </ul> <p>these are not "ancestors".  these are "descendants".  ancestors = parents, not children</p> http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx#comment208 John "Z-Bo" Zabroski http://www.silverlightshow.net/items/Layout-controls-in-Silverlight-2-Beta-1.aspx Tue, 01 Jul 2008 11:42:41 GMT