我有prism和mahapps.metro库的问题。我将TabControl设置为我的Shell中的区域,这里我有问题beacouse每个tabitem(模块)没有对触发器做出反应,例如:Property =“IsMouseOver”。标题具有相同的风格,我不知道如何强制它们正常工作。这是我的代码:
Shell.xaml
<Window.Resources>
<Style BasedOn="{StaticResource {x:Type TabItem}}" TargetType="TabItem" x:Key="HeaderStyle">
<Setter Property="Header"
Value="{Binding RelativeSource={RelativeSource Self},
Path=Content.DataContext.TabModel.Title}" />
</Style>
</Window.Resources>
<TabControl Grid.Row="1" cal:RegionManager.RegionName="{x:Static inf:RegionNames.TabContainer}" Style="{StaticResource MetroTabControl}"/>
和模块:
<TabItem x:Class="DataConverter.Modules.Export.Views.MenuView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" Style="{StaticResource {x:Type TabItem}}"
Header="Export"
IsSelected="{Binding Path=IsSelected}">
当我删除Style="{StaticResource {x:Type TabItem}}"
时,我的tabitem看起来像标准控件。如何解决这个问题?