hi everyone,
i have a problem on changing tab header, what i did is bind header textblock with a property of a C# object, but once i modify the property, the textblock(tab header) did change
code is looks like :
xaml looks like:
once i go change tabItemCollection, tab header remain the same, any suggest how can i update?
best regards
MENG
i have a problem on changing tab header, what i did is bind header textblock with a property of a C# object, but once i modify the property, the textblock(tab header) did change
code is looks like :
radTab.ItemContainerStyle = App.Current.Resources[
"TabItemStyle"
]
as
Style;
radTab.ItemsSource = TabCollection;
TabCollection.add(
new
TabItem(){Header =
"aa"
, IconPath =
"~/Images/Icon1.png"
, Content =
object
})
<
Style
x:Key
=
"TabItemStyle"
TargetType
=
"telerikNavigation:RadTabItem"
>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
x:Key
=
"TabHeader"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
x:Name
=
"HeaderIcon"
Source
=
"{Binding IconPath, Mode=TwoWay}"
Margin
=
"3, 0, 3, 0"
Width
=
"40"
Height
=
"20"
/>
<
TextBlock
x:Name
=
"HeaderText"
Text
=
"{Binding Header, Mode=TwoWay}"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
/>
</
StackPanel
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"Height"
Value
=
"35"
/>
<
Setter
Property
=
"MaxWidth"
Value
=
"300"
/>
<
Setter
Property
=
"MinWidth"
Value
=
"120"
/>
<
Setter
Property
=
"ContentTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
controlsToolkit:DockPanel
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
>
<
ContentPresenter
Content
=
"{Binding Content}"
/>
</
controlsToolkit:DockPanel
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
best regards
MENG