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

ElementBinding height of HeaderSelectedItem

2 Answers 64 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 14 Jan 2014, 08:29 AM

- Please see attached screenshot -


The toolbar on the right side of the screen (blue line above "toolbar" buttons) should always have the same height as the HeaderSelectedItem element of the OutlookBar on the left. So when a user switches his theme at runtime, the toolbars height should adjust with the new selected theme. For example "Office 2013" and "Windows 8" themes use different heights. I tried that with the following code where "MyOutlookBar" is the key of my RadOutlookBar:



<!-- ToolBar Area -->
<StackPanel Orientation="Horizontal" Height="{Binding ElementName=MyOutlookBar, Path=HeaderSelectedItem.Height}">
    <Image Source="{Binding ToolBarIcon}" Stretch="None" />
    <TextBlock Text="{Binding ToolBarTitle}" />
</StackPanel>




Sadly there is no "HeaderSelectedItem" property which I can refer to. How is that element accessible?







2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 17 Jan 2014, 08:49 AM
Hi Johannes,

Indeed there is no HeaderSelectedItem property in our RadOutlookBar and there is no easy approach to get the height of the RadOutlookBar's header. Since every theme has different size of the items, I think the most suitable way to achieve your requirement is to extract the heights of all themes from the implicit themes of the control (or with any XAML inspecting tool) in a collection. And then you can manually change the tool bar's height when you change the theme.

For your convenience, I prepared a sample project achieving your requirement. Also, I encourage you to use our RadToolBar control instead of the ToolBar Area from your XAML.

I hope this information is helpful.

Regards,
Martin Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Johannes
Top achievements
Rank 1
answered on 17 Jan 2014, 11:41 AM
Thank you very much for your response and the attached project. I will use the solution you suggested.
Tags
OutlookBar
Asked by
Johannes
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Johannes
Top achievements
Rank 1
Share this question
or