RibbonWindow/RibbonView - Title Style and Icon

4 posts, 0 answers
  1. Dan
    Dan avatar
    8 posts
    Member since:
    Oct 2012

    Posted 01 Nov 2012 Link to this post

    1st issue - We're new to the Telerik controls.  When using the RibbonWindow and the RibbonView, the Title of the Window is black without a white blur behind/around it, making the title very difficult to see.  Which style do I need to change to add the BlurEffect?  Also, on Windows 7 with Aero turned on, could not this blur not be the default style.  

    2nd issue - The interaction between the RibbonWindow and RibbonView, the title, and the IconVisibility/WindowIconVisibility properties is quite confusing.  In our sample applications, the window icon shows up perfectly to the left of the QAT.  But we cannot get the icon to display in our Win32 application with integrated Telerik controls nor does the window menu open when clicking on it.  The RibbonWindow/RibbonView and QAT display correctly.  I seem to have tried all combinations of  IconVisibility/WindowIconVisibility property settings.  I don't know what else to try.  Any guidance would be appreciated.

    Dan - Bentley Systems, Inc.

  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 06 Nov 2012 Link to this post

    Hello Dan,

    Unfortunately the RibbonWindow TitleBarStyle doesn't define a blur effect and in order to add one, you need to customize the style. I modified the solution you attached in your other thread to demonstrate how you can apply a custom TitleBarStyle on the RibbonWindow.Title and define a blur-like effect.

    However, I don't think I understand your second issue correctly. This is why I wanted to ask you if you can send over a solution demonstrating it? Then I'll be able to take a closer look at your implementation and the issue in question. Thank you in advance.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dan
    Dan avatar
    8 posts
    Member since:
    Oct 2012

    Posted 06 Nov 2012 Link to this post

    Hi Tina,

    Thanks for the WindowTitleStyle in RibbonWindowStyleResources.xaml.  That helped a lot.  Inside the Border(s), I put a Grid with two TextBlock elements and did the same for the ApplicationName:

    <Border HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Padding="5">
        <Grid>
            <TextBlock Margin="0"
                       VerticalAlignment="Center"
                       Foreground="White"
                       FontStretch="Expanded"
                       Text="{TemplateBinding Title}">
                <TextBlock.Effect>
                    <BlurEffect Radius="10.0"
                                KernelType="Gaussian" />
                </TextBlock.Effect>
            </TextBlock>
            <TextBlock x:Name="Title"
                       Margin="1"
                       VerticalAlignment="Center"
                       Foreground="{StaticResource RibbonWindow_TitlebarTitleBrush}"
                       Text="{TemplateBinding Title}" />
        </Grid>                                   
    </Border>
    I'll address the "White" color later.

    I had to update the Telerik source to get the Icon to work.  I am using an ImageSource object and not an BitmapImage or BitmapFrame. The IconConverter.Convert was disallowing the BitmapSource.  Since our product is an older Win32 product that uses ICOs, we rely heavily on Imaging.CreateBitmapSourceFromHIcon to get our icon objects for WPF.  Here's my change. I'm sure you can improve it:

    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value != null && value is BitmapImage)
            return value;
             
        BitmapFrame bitmapFrame = value as BitmapFrame;
        if ((bitmapFrame != null) && (bitmapFrame.Decoder != null))
        {
            foreach (BitmapFrame frame in bitmapFrame.Decoder.Frames)
            {
                BitmapSource source = GetThumbnail (frame);
                if (source != null)
                {
                    return source;
                }
            }
        }
     
        if (value != null && value is ImageSource)
            return value;
     
        return null;
    }

    Thanks again,
    Dan

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 09 Nov 2012 Link to this post

    Hi Dan,

    I am glad that the custom style helped you. Also I want to thank you for elaborating on the RibbonWindow.Icon issue. Based on your scenario description, I logged it as a bug in our PITS and we will make sure to update the converter to allow ImageSource as the value of the Icon property. I also updated your Telerik account for your feedback.

    Also instead of rebuilding our source on your side, you can extract the RibbonWindow style and remove the converter altogether. I attached an updated version of the RibbonWindowStyleResources.xaml ResourceDictionary, where I also added the RibbonWindow style and I removed the converter in the Image definition. Please note that I set the TitleBarStyle property in the RadRibbonWindowStyle setters so you won't have to apply it additionally - you only need to make sure that your RibbonWindow instance uses this customized style.

    All the best,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top