我放在Window.Resources我的图片样式的第一个按钮图像:图像样式没有应用到工具栏
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.3" />
</Trigger>
</Style.Triggers>
</Style>
,我有一个工具栏:
<ToolBarTray DockPanel.Dock="Top" Background="Transparent">
<ToolBar Band="0" BandIndex="0" x:Name="ToolbarCATIAAccess" Background="{DynamicResource linearGradBrushHellaTitanMenu}">
<Button Name="ButtonInsertIntoProduct">
<Image x:Name="ImageInsertIntoProduct" Source="/HKBEStandardsFromPDMLibrary;component/Resources/InsertIntoCATIAProduct.png"
ToolTip="insert files into active CATIA Product"/>
</Button>
<Button Name="ButtonCopyFilesToWIN">
<Image x:Name="ImageCopyFilesToWIN" Source="/HKBEStandardsFromPDMLibrary;component/Resources/CopyFilesToWIN.png"
ToolTip="copy files to WIN folder"></Image>
</Button>
</ToolBar>
</ToolBarTray>
此样式适用于整个窗口以及其他应用程序中的所有图像。 但它不适用于工具栏中的第一个图像,并且哪一个先到达并不重要,不透明度不会在第一个设置。 如果我添加一个隐藏的(按钮)图像作为第一个图像到工具栏,它适用于第一个可见。
...
<Button Name="ButtonCopyFilesToWIN_" Visibility="Collapsed">
<Image x:Name="ImageCopyFilesToWIN_" Source="/HKBEStandardsFromPDMLibrary;component/Resources/CopyFilesToWIN.png"
ToolTip="copy files to WIN folder"></Image>
</Button>
<Button Name="ButtonInsertIntoProduct">
<Image x:Name="ImageInsertIntoProduct" Source="/HKBEStandardsFromPDMLibrary;component/Resources/InsertIntoCATIAProduct.png"
ToolTip="insert files into active CATIA Product"/>
</Button>
...
是否有人在这里有一个想法可能是什么问题,能帮帮我吗? 谢谢
做** **所有的工具栏按钮有'的IsEnabled = “假”' ?您是否验证了这一点(例如[Snoop](http://snoopwpf.codeplex.com/))? –