Hi, I have a header template for my TabControl (code below), but when i try to set binding to Header property of a tab (at least i think so) I don't get nothing...
What i would like is when i create new tab (let say from code ... something like :
), that property of this header would bi binded as i stated in xaml....
Thank you for all your help!
What i would like is when i create new tab (let say from code ... something like :
MainTabControl.Items.Add(new RadTabItem() {Header = "HeaderText", Content = new MyControl()});
), that property of this header would bi binded as i stated in xaml....
Thank you for all your help!
<
telerik:RadTabControl
x:Name
=
"MainTabControl"
DockPanel.Dock
=
"Bottom"
Margin
=
"0"
>
<
telerik:RadTabControl.ItemContainerStyle
>
<
Style
TargetType
=
"telerik:RadTabItem"
>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Grid.Column
=
"0"
Text
=
"{Binding Header}"
/>
<
Button
Grid.Column
=
"1"
Margin
=
"0 0 0 0"
Content
=
"x"
Width
=
"15"
Height
=
"15"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
RE:EventHelper.EnableRoutedClick
=
"True"
/>
</
Grid
>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:RadTabControl.ItemContainerStyle
>
</
telerik:RadTabControl
>