Infragistics TabControl继承模板

时间:2014-09-26 11:52:03

标签: c# wpf xaml datagrid infragistics

我正在使用infragistics wpf tabcontrol控件。请查看以下代码段。

XAML

<Window x:Class="DynamicTabControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:igWindows="http://infragistics.com/Windows"
        xmlns:igDP="http://infragistics.com/DataPresenter"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <igWindows:XamTabControl Name="xamTabCtrl" ItemsSource="{Binding Collection}" Theme="Metro">
            <igWindows:XamTabControl.ItemTemplate>
                <DataTemplate >
                    <Label Content="{Binding Header}" />
                </DataTemplate>
            </igWindows:XamTabControl.ItemTemplate>
            <igWindows:XamTabControl.ContentTemplate>
                <DataTemplate>
                    <igDP:XamDataGrid Theme="Metro"
                  DataSource="{Binding Logins}"/>
                </DataTemplate>
            </igWindows:XamTabControl.ContentTemplate>
        </igWindows:XamTabControl>
    </Grid>
</Window>

数据网格看起来像 Datagrid

正如你可以看到上面的xaml,我覆盖了ItemTemplate属性wit标签,它导致了与infragistics默认样式不同的外观,默认看起来像

Default

如何从infragistics继承ItemTemplate样式?

更新

我试着跟随:

<Window x:Class="DynamicTabControl.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:igWindows="http://infragistics.com/Windows"
        xmlns:igDP="http://infragistics.com/DataPresenter"
        Title="MainWindow" Height="450" Width="700">
    <Grid>
        <igWindows:XamTabControl Name="xamTabCtrl" ItemsSource="{Binding Collection}" Theme="Metro">
            <igWindows:XamTabControl.ItemContainerStyle>
                <Style TargetType="{x:Type igWindows:TabItemEx}" BasedOn="">
                    <Setter Property="Header" Value="{Binding Path=Header}" />
                </Style>
            </igWindows:XamTabControl.ItemContainerStyle>
            <igWindows:XamTabControl.ContentTemplate>
                <DataTemplate>
                    <igDP:XamDataGrid Theme="Metro"
                  DataSource="{Binding Logins}" IsGroupByAreaExpanded="False" GroupByAreaLocation="None" GroupByAreaMode="DefaultFieldLayoutOnly"/>
                </DataTemplate>
            </igWindows:XamTabControl.ContentTemplate>
        </igWindows:XamTabControl>
    </Grid>
</Window>

一切正常,但主题不接受。我需要在baseOn属性中写什么?

0 个答案:

没有答案