2
有人能告訴我如何編寫一個事件來命令風格的tabitem?我在其他地方使用它沒有問題,但我無法弄清楚它的風格。以風格命令的事件
我想在Xaml中爲使用MVVM-Light工具包的WPF執行此操作。
這裏是什麼,我試圖做一個例子:
<DataTemplate x:Key="WorkspacesTemplate">
<igWindows:XamTabControl
AllowTabClosing="True"
IsSynchronizedWithCurrentItem="True"
ItemsSource="{Binding}" TabItemCloseButtonVisibility="Visible"
Margin="4"
Theme="Office2k7Black" >
<igWindows:XamTabControl.Resources>
<Style TargetType="{x:Type igWindows:TabItemEx}"
BasedOn="{StaticResource {x:Type igWindows:TabItemEx}}" >
<Setter Property="Header" Value="{Binding Path=DisplayName}" />
<Style.Triggers>
<i:EventTrigger >
<cmd:EventToCommand Command="{Binding Path=CloseCommand}" />
</i:EventTrigger>
</Style.Triggers>
</Style>
</igWindows:XamTabControl.Resources>
</igWindows:XamTabControl>
</DataTemplate>
我使用的是Infragistics的TabControl的,但它不應該是比常規選項卡控制太大的不同。
請提供更多信息,例如這是WPF還是Silverlight。你是指一個模板?另外,如果您可以顯示一些您嘗試過的示例XAML,那麼我們就會知道您正在嘗試執行哪些操作。 – 2010-10-13 16:27:22