)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the header Background color on a specific MDI child in DocumentContainer ?

Platform: WPF |
Control: DocumentContainer |
Published Date: January 30, 2015 |
Last Revised Date: January 30, 2015

In DocumentContainer, set the header’s background color on a specific MDIchild using DocumentMDIHeaderStyle property.

XAML

<Window.Resources>

<Style x:Key="headerstyle" TargetType="syncfusion:DocumentHeader">

      <Setter Property="Header" Value="syncfusion:DocumentHeader.Header"/>

        <Setter Property="Background">

             <Setter.Value>

                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">

                        <GradientStop Color="#FFD9EDFF" Offset="0"/>

                        <GradientStop Color="#FFC0DEFF" Offset="0.445"/>

                        <GradientStop Color="#FFAFD1F8" Offset="0.53"/>

                    </LinearGradientBrush>

             </Setter.Value>

        </Setter>

</Style>

</Window.Resources>

<syncfusion:DocumentContainer x:Name="Doccontainer" Mode="MDI">

            <ContentControl x:Name="child1" syncfusion:DocumentContainer.Header="Document1" syncfusion:DocumentContainer.DocumentMDIHeaderStyle="{StaticResource headerstyle}">

             </ContentControl>

            <ContentControl x:Name="child2" syncfusion:DocumentContainer.Header="Document2">

                <TextBlock Text="This is a document2"/>

            </ContentControl>

            <ContentControl x:Name="child3" syncfusion:DocumentContainer.Header="Document3"/>

</syncfusion:DocumentContainer>

C#

Style style = this.FindResource("headerstyle") as Style;

child1.SetValue(DocumentContainer.DocumentMDIHeaderStyleProperty, style);

The following screenshot displays the setting of the header background color on a specific MDIchild,

Figure 1: Output

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon