Click here to Skip to main content
13,045,417 members (122,826 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 17 Sep 2010

Creating a IE9-like UI

, 17 Sep 2010
Rate this:
Please Sign up or sign in to vote.
Creating a IE9-like UI

If you haven’t been living under a rock, you might have noticed that IE9 Beta has been released! One of the things I like about IE9 is its new UI… Let's try and re-create it!

Glass Chrome Window

First things first, IE9 uses a glass chrome window… Microsoft has released the WPF Shell Integration Library which allows us to customize our window chrome.

The custom chrome feature allows applications control over the outer frame of the window so that WPF content can be drawn over the title bar. This allows applications to integrate with Aero glass to emulate the Office 2007/2010 look and feel, or to completely replace the frame with its own content without having to manage all the system behaviors that get lost when using WindowStyle.None"

Here is my glass chrome window style:

<Style TargetType="{x:Type local:MainWindow}">
    <Setter Property="shell:WindowChrome.WindowChrome">
            <shell:WindowChrome GlassFrameThickness="-1" />
    <Setter Property="Template">
            <ControlTemplate TargetType="{x:Type local:MainWindow}">

                        Margin="{Binding Source=
			{x:Static shell:SystemParameters2.Current}, 

                        Content="{TemplateBinding Content}"/>

Lester Lebo has a excellent sample of this feature available here.


Next on my list of things to-do is create a HeaderedTabControl! If you look at the IE9 UI, the address bar and the tabs bleed on the same line and there is a grid splitter between them that can be used to resize the allocated space!

public class HeaderedTabControl : TabControl
    static HeaderedTabControl()
		new FrameworkPropertyMetadata(typeof(HeaderedTabControl)));            

    public object Header
        get { return (object)GetValue(HeaderProperty); }
        set { SetValue(HeaderProperty, value); }

    public static readonly DependencyProperty HeaderProperty =
        DependencyProperty.Register("Header", typeof(object), 
		typeof(HeaderedTabControl), new UIPropertyMetadata(null));

And here is the default style:

<Style TargetType="{x:Type local:HeaderedTabControl}">
    <Setter Property="Template">
            <ControlTemplate TargetType="{x:Type local:HeaderedTabControl}">
                <Grid KeyboardNavigation.TabNavigation="Local">
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="5" />
                        <RowDefinition Height="*"/>
                    <Border Grid.Row="1" BorderBrush="Black" 

			Background="White" BorderThickness="1,1,1,0" 

			CornerRadius="2,2,0,0" />
                    <Grid Grid.Row="0" >
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition Width="2*" />
                        <ContentPresenter Content="{TemplateBinding Header}" 

				Grid.Column="0" Margin="0,0,5,0" />
                        <GridSplitter Width="5" HorizontalAlignment="Right" 

				Grid.Column="0" Background="Transparent" />
                        <TabPanel Grid.Column="1" Background="Transparent" 

				IsItemsHost="True" Panel.ZIndex="1" 



                    <Border Grid.Row="2"

                                BorderBrush="Black" BorderThickness="1,0,1,1" 




                        <ContentPresenter x:Name="PART_SelectedContentHost" 


                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Foreground" Value="Gray"/>

Let's Try It Out

Now that we have all the building blocks required, let's try it out…

        <Grid Margin="5,2,2,2">
                <ColumnDefinition Width="50" />
                <ColumnDefinition Width="*" />
            <Button Content="Back" Grid.Column="0" />
            <TextBox Text="this is in the header" Grid.Column="1" />
    <TabItem Header="Welcome">
        <Border Background="Cyan">
            <TextBlock Text="Welcome to my silly little demo of a IE9-like UI clone"

    <TabItem Header="Blog - Rudi Grobler">
        <WebBrowser Source="" />

And this is how it looks:

Read more about IE9 here.

P.S.: As always, here is the code!


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


About the Author

South Africa South Africa
No Biography provided

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Sep 2010
Article Copyright 2010 by rudigrobler
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid