Unable to style title bar...

5 posts, 0 answers
  1. Martin
    Martin avatar
    10 posts
    Member since:
    Jun 2011

    Posted 07 Jun 2011 Link to this post

    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>
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 13 Jun 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    10 posts
    Member since:
    Jun 2011

    Posted 14 Jun 2011 Link to this post

    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!
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 17 Jun 2011 Link to this post

    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
  6. Martin
    Martin avatar
    10 posts
    Member since:
    Jun 2011

    Posted 17 Jun 2011 Link to this post

    Done! Thanks a lot guys keep it real!
    Regards, Martin o.
Back to Top
UI for WPF is Visual Studio 2017 Ready