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

Window title should be centered with Office2013 theme

6 Answers 34 Views
Window
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 18 Feb 2014, 01:48 PM
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

6 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 21 Feb 2014, 09:58 AM
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
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 25 Feb 2014, 05:55 AM
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
0
Kalin
Telerik team
answered on 27 Feb 2014, 09:35 AM
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
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 28 Feb 2014, 02:21 AM
Hi Kalin,
so why not define a HeaderHorizontalAlignment dependency property, so we can change the alignment without modify the control template?
Patrick
0
Kalin
Telerik team
answered on 04 Mar 2014, 04:40 PM
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!

0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 04 Mar 2014, 05:05 PM
Hi Kalin,
it works.... if you change your code to cast the header as ContentControl and not as ContentPresenter.
Thanks
Patrick
Tags
Window
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Kalin
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or