Window title should be centered with Office2013 theme

7 posts, 0 answers
  1. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 18 Feb 2014 Link to this post

    Hello,
    when using the Office2013, the window title is left-aligned.
    To be consistent with Office 2013 and the RadRibbonWindow class, it should be centered horizontally.
    Patrick
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 21 Feb 2014 Link to this post

    Hi Patrick,

    By the design the Header of the Window is left aligned. However you could easily center it by modifying its ControlTemplate in order to set the HorizontalContentAlignment property of the ContentControl named HeaderContent to Center.

    Hope this helps. You can give it try and let us know if you have any issues.

    Regards,
    Kalin
    Telerik
  3. UI for WPF is Visual Studio 2017 Ready
  4. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 24 Feb 2014 in reply to Kalin Link to this post

    Hi Kalin,
    this is the usual Telerik answer in this cases: change the control template.
    But, unfortunately, this is not a usable solution. If I had followed each time I had this answer, that means at least a dozen change on the templates, to repeat each time a new version is out and for each theme. It takes a lot of time to do this, and there are the risk to make errors or to forget something.
    I'm asking this because, in Microsoft Office 2013, the dialog box titles are centered, not left aligned. So I think that in your Office2013 theme, that tries to reproduce Office 2013 look and feel, the dialog box titles must also be centered.
    Patrick
  5. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 27 Feb 2014 Link to this post

    Hello Patrick,

    Indeed the Office 2013 theme is inspired from the Microsoft Office 2013, however our goal wasn't to provide exact visual representation of the Microsoft Office. Our controls and themes are designed in such a way to be highly customizable which allows the users to easily modify them and the ControlTemplates in order to suit their needs as everyone has different requirements.

    Hope this helps. If you have any other questions let us know.

    Regards,
    Kalin
    Telerik
  6. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 27 Feb 2014 in reply to Kalin Link to this post

    Hi Kalin,
    so why not define a HeaderHorizontalAlignment dependency property, so we can change the alignment without modify the control template?
    Patrick
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 04 Mar 2014 Link to this post

    Hi Patrick,

    Thanks for your feedback. We will consider your suggestion for the future versions of the Window. As for now I can suggest you another solution which can be done in the code instead of the modifying the ControlTemplate. You could get the element named HeaderContent from the Template and change its HorizontalAlignment property to Center the following way:

    var radWindow = new RadWindow();
    radWindow.Header = "My RadWindow";
    radWindow.Show();
    // change the alignment
    var headerContent = radWindow.Template.FindName("HeaderContent", radWindow) as ContentPresenter;
    headerContent.HorizontalAlignment = HorizontalAlignment.Center;

    Hope this will work for you.

    Regards,
    Kalin
    Telerik

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

  8. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 04 Mar 2014 in reply to Kalin Link to this post

    Hi Kalin,
    it works.... if you change your code to cast the header as ContentControl and not as ContentPresenter.
    Thanks
    Patrick
Back to Top
UI for WPF is Visual Studio 2017 Ready