Click here to Skip to main content
15,896,915 members
Articles / Programming Languages / C#

Grid960 Layout for Silverlight

Rate me:
Please Sign up or sign in to vote.
4.94/5 (13 votes)
11 Jun 2013CPOL3 min read 45.5K   1.4K   37  
The 960 Grid System is a hugely popular layout system for web sites - Grid960 lets you use it in Silverlight!
<UserControl x:Class="Grid960Sample.ElementView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400"
             >

    <Grid x:Name="LayoutRoot" Background="White">
        <Border Background="#33FF0000" BorderThickness="1" BorderBrush="#333333" x:Name="border" SizeChanged="border_SizeChanged">
            <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
                <TextBlock HorizontalAlignment="Center">
                        <Run Text="Span:" />
                        <Run Text="{Binding ColumnSpan}" />
                </TextBlock>
                <TextBlock HorizontalAlignment="Center">
                    <Run Text="Offset:" />
                        <Run Text="{Binding ColumnOffset}" />
                </TextBlock>
                <TextBlock HorizontalAlignment="Center">
                        <Run Text="Width:" />
                     <!--   <Run Text="{Binding MeasuredWidth, ElementName=elementView}" /> -->
                </TextBlock>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United Kingdom United Kingdom
Follow my blog at www.dwmkerr.com and find out about my charity at www.childrenshomesnepal.org.

Comments and Discussions