I have a DXTabControl that is contained in a UserControl. The UserControl is hosted by a DocumentPanel in a DockLayoutManager.
The tab control is populated by a set of tab items, and the header and visibility of the tab items are updated using data binding:
XAML<dx:DXTabControl.ItemContainerStyle>
<Style TargetType="{x:Type dx:DXTabItem}">
<Setter Property="Header" Value="{Binding Header}"/>
<Setter Property="Visibility" Value="{Binding Available, Converter={x:Static mvvm:BoolToVisibilityConverter.ToCollapsed}, Mode=OneWay}"/>
</Style>
</dx:DXTabControl.ItemContainerStyle>
The problem is that the Header text is not shown when setting the Visibility to "Visible" (see screenshot). (But the layout, i.e. size, seems to be correct.) If I select a tab, the header text will be shown correctly for that tab.
As a test I modified the registration of the Header property in HeaderedSelectorItemBase<TContainer, TItem>, by adding FrameworkPropertyMetadataOptions.AffectsRender as a property option:
C#public static readonly DependencyProperty HeaderProperty =
HeaderedContentControl.HeaderProperty.AddOwner(typeof(HeaderedSelectorItemBase<TContainer, TItem>), new FrameworkPropertyMetadata(null,
FrameworkPropertyMetadataOptions.AffectsRender,
(d, e) => ((HeaderedSelectorItemBase<TContainer, TItem>)d).OnHeaderChanged(e.OldValue, e.NewValue)));
After this change, the header text seems to be presented correctly. Is this something you can look into?
I have not had the time to create a repro, but if you need one I will try to find the time.
/Andreas
Hi Andreas,
The issue you faced is really strange. I tried to recreate it in a test project, but didn't succeed. It would be of great help if you could take a look at my sample and modify it so that we can reproduce the issue and research it on our side.
Thanks,
Alexander
It was not trivial to create a repro for this issue. I incrementally added more of the structure from our application to your sample. When I added the "InnerModel" property to the DocumentViewModel, the headers are no longer rendered correctly, until I click on them. I have attached the modified project.
Many thanks for your sample. I have reproduced the issue and will inform our developers about it. They will research why it occurs.
We will let you know once we have any results.
Any updates on this?
Hello,
Our R&D team is currently researching the cause of this issue. However, we cannot provide you with any precise time frames when this issue will be fixed. Please follow our notifications to be informed about our progress.
Thanks,
Kirill