Inheritable (attached) WPF properties don't inherit into AdvancedTabControl's content

Docking/MDI for WPF Forum

Posted 8 years ago by Markus Springweiler
Version: 16.1.0631
Platform: .NET 4.5
Environment: Windows 8 (64-bit)

If I define an inheritable property on AdvancedTabItem then the value is only inherited to the tab header but not to the selected content. Using standard TabControl the property is inherited to both.

Problem was caused by using Content-Binding+ContentTemplate instead of direct Content -- original TabControl behaves identical.

[Modified 8 years ago]

Comments (2)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Markus,

AdvancedTabControl is showing tabs for each item (which is a DockingWindow) but the DockingWindow is present in UI as a wrapper container for its own content.  So it is the root of what shows up in the tab control's content area.  Thus tabs might not get inherited properties since that is out of band from where the DockingWindow physically shows up in UI. 

I'm assuming this question is related to you trying to get a reference to data as mentioned in your other thread:

You would want to set the DockingWindow.DataContext property to a non-UIElement object and that will be your contextual content object.

Actipro Software Support

Posted 8 years ago by Markus Springweiler

No no, totally unrelated to docking at all; I just used AdvancedTabControl with Left aligned tabs and overflow scrolling, which the original TabControl is not capable at all.

I applied the strike-through style to the text due to the lack of a "delete thread" button (or I just missed it, if it exists).

As said, original TabControl and AdvancedTabControl behave the same:

<TabItem Header="Inheritable properties inherit into header AND content" FontSize="20" FontWeight="ExtraBold">
<TextBlock>some content also in bold and size 20</TextBlock>
<TabItem Header="Inheritable properties inherit ONLY into header" FontSize="20" FontWeight="ExtraBold" Content="some content in default size and weight">
<TextBlock Text="{Binding}" />

This happens to all sort of inheritable properties, attachable or not. In my case it was my own "HelpProvider.Topic" attachable property.

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.