Click here to Skip to main content
15,892,674 members
Articles / Desktop Programming / XAML

Silverlight Menu4U

Rate me:
Please Sign up or sign in to vote.
4.90/5 (59 votes)
14 Aug 2011CPOL11 min read 120.5K   4.1K   85  
A new Silverlight menu with styling and templating.
<navigation:Page x:Class="Menu4UDemo.About" 
    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"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    Title="About" 
    Style="{StaticResource PageStyle}">

    <Grid x:Name="LayoutRoot">
        <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">
            
            <StackPanel x:Name="ContentStackPanel">

                <StackPanel Orientation="Horizontal" Margin="16,16,0,0">
                    <Border Width="32" Height="24" CornerRadius="0" BorderBrush="Black" BorderThickness="4,4,2,4" Margin="0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Offset="0.0" Color="#fff"/>
                                <GradientStop Offset="0.75" Color="#f44"/>
                                <GradientStop Offset="0.75" Color="#800"/>
                                <GradientStop Offset="1.0" Color="#800"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                    <Border Width="32" Height="24" CornerRadius="0" BorderBrush="Black" BorderThickness="2,4,2,4" Margin="0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Offset="0.0" Color="#fff"/>
                                <GradientStop Offset="0.75" Color="#4f4"/>
                                <GradientStop Offset="0.75" Color="#080"/>
                                <GradientStop Offset="1.0" Color="#080"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                    <Border Width="32" Height="24" CornerRadius="0" BorderBrush="Black" BorderThickness="2,4,4,4" Margin="0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Offset="0.0" Color="#fff"/>
                                <GradientStop Offset="0.75" Color="#44f"/>
                                <GradientStop Offset="0.75" Color="#008"/>
                                <GradientStop Offset="1.0" Color="#008"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </StackPanel>
                <StackPanel Margin="16,0,0,0" HorizontalAlignment="Left">
                    <Border Width="34" Height="20" CornerRadius="0" BorderBrush="Black" BorderThickness="4,0,4,4" Margin="0">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Offset="0.0" Color="#fff"/>
                                <GradientStop Offset="0.75" Color="#fc4"/>
                                <GradientStop Offset="0.75" Color="#840"/>
                                <GradientStop Offset="1.0" Color="#840"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </StackPanel>

                <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
                           Text="About Menu-4U"/>
                <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 
                           Text="© 2011 Marcelo Ricardo de Oliveira" Margin="0,0,0,0"/>
                
                <StackPanel Orientation="Horizontal">
                    <Image Source="/Images/Bob.png" HorizontalAlignment="Left" Width="32"></Image>
                    <TextBlock x:Name="ContentText2" Style="{StaticResource ContentTextStyle}" 
                                VerticalAlignment="Center"
                               Text="Made for The Code Project" Margin="8,0,0,0"/>
                </StackPanel>
               
            </StackPanel>

        </ScrollViewer>
    </Grid>

</navigation:Page>

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
Instructor / Trainer Alura Cursos Online
Brazil Brazil

Comments and Discussions