This is a migrated thread and some comments may be shown as answers.

Unable to style title bar...

4 Answers 363 Views
Window
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 07 Jun 2011, 09:36 PM
I have this scenario:
 
<
telerik:RadRibbonWindow
   ...
     
    WindowStartupLocation="CenterScreen"
    Title="Xxxxx"
    Height="700"
    Width="980"
    MinHeight="700"
    MinWidth="980"
    Name="XxxxxWindow"
    AutomationProperties.Name="XxxxxWindow"
     
    Closing="XxxxxWindow_Closing"
    >
     
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closed">
            <c:CommandAction Command="{Binding Path=ShellClosedCommand}" SyncOwnerIsEnabled="True" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
     
    <DockPanel SizeChanged="mainRegion_SizeChanged" Name="mainRegionDockPanel" AutomationProperties.Name="mainRegionDockPanel" >       
        <telerik:RadRibbonBar
            DockPanel.Dock="Top"
            prism:RegionManager.RegionName="{x:Static common:RegionNames.RibbonBarRegion}"
            ApplicationName="{Binding Title}"
            HorizontalContentAlignment="Stretch"
            HelpButtonVisibility="Visible"
            HelpRequested="RadRibbonBar_HelpRequested"
            Name="RibbonTitle"
            AutomationProperties.Name="RibbonTitle"
            ApplicationButtonImageSource="{Binding Source={x:Static CommonProps:Resources.Icon_Mario}, Converter={StaticResource bitmapConverter}}"
            >
            <telerik:RadRibbonBar.ApplicationMenu>
                <telerik:ApplicationMenu RightPaneVisibility="Collapsed">
                    <telerik:RadRibbonButton Text="Select/Change Xxxxx/Xxxxx" Click="Xxxxx_Click" />
                    <telerik:RadRibbonButton Text="Close" Click="CloseApplication"/>
                </telerik:ApplicationMenu>
            </telerik:RadRibbonBar.ApplicationMenu>
               <telerik:RadRibbonBar.QuickAccessToolBar >
                <telerik:QuickAccessToolBar >
                     
                    <telerik:RadRibbonButton Text="Export" Size="Small" Command="{Binding ExportToExcelCommand}"
                                                IsEnabled="{Binding ExportToExcelEnabled, UpdateSourceTrigger=PropertyChanged}"
                                                SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Excel}, Converter={StaticResource bitmapConverter}}"/>
                    <telerik:RadRibbonButton Text="Print" Size="Small" Command="{Binding PrintCommand}"
                                                IsEnabled="{Binding PrintSearchEnabled, UpdateSourceTrigger=PropertyChanged}"
                                                SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Print}, Converter={StaticResource bitmapConverter}}" />
                     
                    </telerik:QuickAccessToolBar>
            </telerik:RadRibbonBar.QuickAccessToolBar>
          </telerik:RadRibbonBar>


This is what i get after a couple hours, tha bad thing about this is that the quicklaunch and the minimize, close, etc buttons
 dissapears, any idea why?
<Style TargetType="DockPanel" x:Name="mainRegionDockPanel">
        <Setter Property="Background" Value="{DynamicResource titleBackground}"/>
    </Style>
    
     
    <LinearGradientBrush x:Key="titleBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFE1EBF5" Offset="0.396"/>
        <GradientStop Color="#FFE1EBF5" Offset="1"/>
        <GradientStop Color="#FFC6DFFC" Offset="0.463"/>
        <GradientStop Color="#FFE1EBF5"/>
        <GradientStop Color="#FFD8E7F7" Offset="0.856"/>
    </LinearGradientBrush>

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 13 Jun 2011, 09:20 AM
Hi Martin,

The issue you have come up with is expected. The RadRibbonWindow is specially designed to work with the RadRibbonBar and using the RibbbonBar as a root of the application is mandatory requirement. However, could you please elaborate more on your scenario so that we could advice you. How to do you need to use the DockPanel?

All the best,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 14 Jun 2011, 03:43 PM
I've been able to make some advances, but the thing i can't set is the title color, i already made a template like this page suggest:
http://www.telerik.com/help/wpf/radribbonbar-styling-ribbon-titlebar.html

and this is what i change
<ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_RibbonBar_Primitives:WindowTitle}" x:Name="customTitleBar">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="Title" Foreground="Black" Text="hola" Background="Black"/>
                        <TextBlock x:Name="Divider" Foreground="Black"
                                    telerik:LocalizationManager.ResourceKey="RibbonBarWindowTitleDivider"
                                    Background="Black" Text=" - "
                                    Visibility="{TemplateBinding DividerVisibility}">
                                    <Run Text=" - "/>
                        </TextBlock>
                        <TextBlock x:Name="ApplicationName" Foreground="Black" Text="Xxxxxx" Background="Black" />

i set the foregrounds as white but the title remains white....and that is my problem now :S,
 thanks in advance!
0
Petar Mladenov
Telerik team
answered on 17 Jun 2011, 04:59 PM
Hello Martin,

You can use the TitleBarStyle property as it is shown in the attached project. Let us know if it helps you.

Best wishes,
Petar Mladenov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 17 Jun 2011, 07:36 PM
Done! Thanks a lot guys keep it real!
Regards, Martin o.
Tags
Window
Asked by
Martin
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Martin
Top achievements
Rank 1
Share this question
or