ToolWindow HeaderTemplate

3 posts, 0 answers
  1. Sébastien
    Sébastien avatar
    3 posts
    Member since:
    Mar 2017

    Posted 28 Mar Link to this post

    Hi everyone,

    For some reasons, I made some changes on Header for undocked/floating window (called ToolWindow) editing ToolWindow template and modifying it.

    As you can see on attached file, I increased font size, header height (rectangle was 22, now 48), changed colors etc...

    Everything look fine BUT I can only drag the window clicking on the upper part on the header (actually I think the first 22 pixels). The new header height value is not taken in account and I don t know what to do.

    Here is my changes:

    <Rectangle Grid.ColumnSpan="2" Fill="WhiteSmoke" Height="48"/>

    <Border x:Name="HeaderElement" Background="Transparent">

         <ContentControl x:Name="Header" VerticalAlignment="Center" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"     Foreground="Gray" FontSize="22" FontFamily="{DynamicResource {x:Static telerik:Windows8ResourceKey.FontFamilyLight}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="6,0"/>

     </Border>

    Thanks in advance for your help

    Seb

     

  2. Kalin
    Admin
    Kalin avatar
    1279 posts

    Posted 31 Mar Link to this post

    Hello Seb,

    You would also need to increase the CaptionHeight property of the ToolWindow in order to match the exact (actual) height of the header in order to be able to drag it from everywhere. The property identifies the extend of the top of the Window to be treated as caption and draggable area.

    Hope this helps.

    Regards,
    Kalin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Sébastien
    Sébastien avatar
    3 posts
    Member since:
    Mar 2017

    Posted 31 Mar Link to this post

    It works.

    Thx a lot

    Sebastien

Back to Top