Click here to Skip to main content
15,884,908 members
Articles / Desktop Programming / WPF

WPF C# Ribbon Control Library

Rate me:
Please Sign up or sign in to vote.
4.91/5 (97 votes)
25 Jun 2008CPOL26 min read 1.1M   43.2K   439  
A WPF / C# Library for implementing Office 2007 Style Ribbon Interfaces
<UserControl x:Class="DNBSoft.WPF.RibbonControl.ApplicationButton"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="50" Width="50">
    <UserControl.BitmapEffect>
        <DropShadowBitmapEffect ShadowDepth="2" />
    </UserControl.BitmapEffect>
    <Grid x:Name="LayoutRoot" Margin="0,0,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="2*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Ellipse Stroke="{x:Null}" Fill="#FF132590" Grid.Row="0" Grid.RowSpan="2" Name="backgroundRound" MouseLeftButtonUp="backgroundRound_MouseLeftButtonUp"/>
        <Ellipse Stroke="{x:Null}" Grid.Row="0" Grid.RowSpan="2" Name="bottomRound" MouseLeftButtonUp="backgroundRound_MouseLeftButtonUp">
            <Ellipse.Fill>
                <RadialGradientBrush GradientOrigin="0.5,1.0">
                    <RadialGradientBrush.RelativeTransform>
                        <TransformGroup>
                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.234" ScaleY="0.699"/>
                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5"/>
                            <TranslateTransform X="0.0" Y="0.147" />
                        </TransformGroup>
                    </RadialGradientBrush.RelativeTransform>
                    <GradientStop Color="#FF8AE4FA" Offset="0"/>
                    <GradientStop Color="#FF8AE4FA" Offset="0.231"/>
                    <GradientStop Color="#00FFFFFF" Offset="1"/>
                </RadialGradientBrush>
            </Ellipse.Fill>
        </Ellipse>
        <Path Stretch="Fill" Stroke="{x:Null}" Data="M189.33784,266.00008 C165.95535,217.10941 204.41339,136.03155 291.34098,136 394.03426,135.96273 422.12734,217.87004 401.66921,265.38106 398.13178,273.59623 359.70589,222.00981 300.00025,221.00043 232.28087,219.85557 189.33784,266.00008 189.33784,266.00008 z" 
              Name="topRound">
            <Path.Fill>
                <RadialGradientBrush GradientOrigin="0.5,0.419">
                    <RadialGradientBrush.RelativeTransform>
                        <TransformGroup>
                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.988" ScaleY="1.526"/>
                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5"/>
                            <TranslateTransform X="0.003" Y="0.337"/>
                        </TransformGroup>
                    </RadialGradientBrush.RelativeTransform>
                    <GradientStop Color="#00FFFFFF" Offset="0"/>
                    <GradientStop Color="#E5C7DBF2" Offset="1"/>
                    <GradientStop Color="#19C7DBF2" Offset="0.793"/>
                    <GradientStop Color="#19C7DBF2" Offset="0.466"/>
                </RadialGradientBrush>
            </Path.Fill>
        </Path>
        <Image Name="image" Grid.Row="0" Grid.RowSpan="2" Margin="6" MouseLeftButtonUp="backgroundRound_MouseLeftButtonUp"/>
    </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 Rail Research UK
United Kingdom United Kingdom
I originally studied for a masters in engineering of software engineering at The University of Birmingham during 2000-2004, of which I received a 2:1. I continued at Birmingham University working with Civil Engineering and Rail Research UK where I am currently in my final year of a 3 year PhD project developing a Computational Intelligent Approach to Railway Intervention Planning. Although my work has a significant focus on railway engineering and associated practices much of my work is with data mining (on SQL Server 2008) and computational intelligence (CI) techniques. My key areas of expertise in CI are clustering algorithms (including Rival Penalised Competitive Learning) and evolutionary algorithms.

Outside of my formal work I enjoy testing the latest technologies such as .NET 3.5 and the many frameworks of which it comprises (mainly WPF). I have several projects on the go including a .NET and DirectX port of Quake 3 and many utility libraries. I also maintain an extensive website coded in Cold Fusion which is regularly updated; more information is available about me there.

Comments and Discussions