Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144154 | Apr 22,2019 08:05 PM UTC | Apr 23,2019 12:35 PM UTC | WPF | 2 |
![]() |
Tags: DocumentContainer |
<sf:DocumentContainer.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"
FontWeight="{Binding Modified,
Converter={StaticResource BoolToFontWeight}}"
/>
</DataTemplate>
</sf:DocumentContainer.HeaderTemplate>
And it works fine. But I want the first tab to show static header "Start". I thought it would be simple. Just add item into container and set sf:DocumentContainer.Header property. But it doesn't work. I tried also some datatriggers, but I failed. How to do it?
tabControl = VisualUtils.FindDescendant(sender as Visual, typeof(DocumentTabControl)) as DocumentTabControl;
//find template and add it to first item and add it to first item:
DataTemplate template = TryFindResource(templateKeyName) as DataTemplate;
TabItemExt item = tabControl.Items[0] as TabItemExt;
if(item != null)
item.HeaderTemplate = template;
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.