Hello,
I am using Telerik TabControl and have several tab items under it.
Issue : When I set IsTabEnabled = false in VM, it disables the tabitem but does not apply the below style. The trigger seems to be not getting called when TabItem.IsEnabled Property sets to false. Please suggest.
Thanks,
Abdi
TabItem Style:
<
Style
x:Key
=
"TabItemStyle"
TargetType
=
"{x:Type telerik:RadTabItem}"
>
<
Setter
Property
=
"Header"
Value
=
"{Binding TabName}"
/>
<
Setter
Property
=
"IsEnabled"
Value
=
"{Binding IsTabEnabled}"
/>
<
Setter
Property
=
"FocusVisualStyle"
Value
=
"{x:Null}"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"{x:Type telerik:RadTabItem}"
>
<
Grid
x:Name
=
"wrapper"
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Border
Name
=
"Border"
Grid.Row
=
"0"
Margin
=
"0,0,4,0"
Background
=
"{StaticResource TabItem_DefaultBackground}"
BorderBrush
=
"{StaticResource TabItem_Border}"
BorderThickness
=
"1,1,1,1"
CornerRadius
=
"2,5,0,0"
>
<
ContentPresenter
x:Name
=
"ContentSite"
VerticalAlignment
=
"Center"
HorizontalAlignment
=
"Center"
ContentSource
=
"Header"
Margin
=
"16,0,16,0"
RecognizesAccessKey
=
"True"
/>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"PreviewMouseLeftButtonDown"
>
<
cmd:EventToCommand
Command="{Binding DataContext.TabHeaderMouseDownCommand,
Mode
=
OneWay
,
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:RadTabControl}}}"
PassEventArgsToCommand
=
"True"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
</
Border
>
<
Rectangle
Grid.ZIndex
=
"1"
Name
=
"focusVisualStyle"
StrokeThickness
=
"1"
Stroke
=
"Black"
StrokeDashArray
=
"1 2"
SnapsToDevicePixels
=
"true"
Visibility
=
"Hidden"
Margin
=
"0,0,4,0"
/>
<
Border
x:Name
=
"OuterBorder"
Grid.Row
=
"1"
BorderBrush
=
"{StaticResource GenericSelItem_Border_Background}"
BorderThickness
=
"0.5,0,0,0.5"
/>
</
Grid
>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"IsSelected"
Value
=
"True"
>
<
Setter
Property
=
"Panel.ZIndex"
Value
=
"100"
/>
<
Setter
TargetName
=
"Border"
Property
=
"Background"
Value
=
"{StaticResource PMDarkGreen}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
TargetName
=
"Border"
Property
=
"BorderBrush"
Value
=
"{StaticResource PMDarkGreen}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"Height"
Value
=
"24"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource GenericActive_Foreground}"
/>
<
Setter
Property
=
"FontFamily"
Value
=
"Verdana"
/>
<
Setter
Property
=
"FontSize"
Value
=
"11"
/>
<
Setter
Property
=
"FontWeight"
Value
=
"Bold"
/>
<
Setter
Property
=
"Opacity"
Value
=
"30"
/>
</
Trigger
>
<
Trigger
Property
=
"IsSelected"
Value
=
"False"
>
<
Setter
Property
=
"Foreground"
Value
=
"Black"
/>
<
Setter
Property
=
"FontFamily"
Value
=
"Verdana"
/>
<
Setter
Property
=
"FontSize"
Value
=
"11"
/>
<
Setter
Property
=
"FontWeight"
Value
=
"Bold"
/>
<
Setter
Property
=
"Opacity"
Value
=
"30"
/>
<
Setter
TargetName
=
"Border"
Property
=
"Height"
Value
=
"24"
/>
</
Trigger
>
<
Trigger
Property
=
"IsEnabled"
Value
=
"False"
>
<
Setter
TargetName
=
"Border"
Property
=
"Background"
Value
=
"{StaticResource GenericDisabled_Background}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"BorderBrush"
Value
=
"{StaticResource GenericSelItem_Border_Background}"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource GenericDisabled_Foreground}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
Property
=
"Opacity"
Value
=
"20"
/>
</
Trigger
>
<
Trigger
SourceName
=
"Border"
Property
=
"IsMouseOver"
Value
=
"True"
>
<
Setter
Property
=
"Foreground"
Value
=
"{StaticResource GenericMouseOver_Foreground}"
/>
<
Setter
TargetName
=
"OuterBorder"
Property
=
"Background"
Value
=
"{StaticResource GenericMouseOver_BorderBackground}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"BorderBrush"
Value
=
"{StaticResource GenericMouseOver_BorderBackground}"
/>
<
Setter
TargetName
=
"Border"
Property
=
"Background"
Value
=
"{StaticResource GenericMouseOver_BorderBackground}"
/>
</
Trigger
>
<
Trigger
Property
=
"IsFocused"
Value
=
"True"
>
<
Setter
TargetName
=
"focusVisualStyle"
Property
=
"Visibility"
Value
=
"Visible"
/>
</
Trigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>