Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从tabitemex infragistics继承样式_C#_Wpf_Infragistics - Fatal编程技术网

C# 如何从tabitemex infragistics继承样式

C# 如何从tabitemex infragistics继承样式,c#,wpf,infragistics,C#,Wpf,Infragistics,我正在使用基础设施选项卡控制控件。我的itemcontainer值基于对象属性。为了明确我的意思,请看下面的代码片段 WPF 谁能继承基础设施主题的风格?我找到了。我找到了继承的类 <Style TargetType="{x:Type igWindows:TabItemEx}" BasedOn="{x:Static igThemes:PrimitivesMetro.TabItemEx}"> <Setter Property="Header"

我正在使用基础设施选项卡控制控件。我的itemcontainer值基于对象属性。为了明确我的意思,请看下面的代码片段

WPF


谁能继承基础设施主题的风格?

我找到了。我找到了继承的类

  <Style TargetType="{x:Type igWindows:TabItemEx}" BasedOn="{x:Static igThemes:PrimitivesMetro.TabItemEx}">
                <Setter Property="Header" Value="{Binding Path=Header}"/>
            </Style>
   public partial class MainWindow : Window
    {
        private ObservableCollection<Model> collection;

        public ObservableCollection<Model> Collection
        {
            get { return collection; }
        }

        public MainWindow()
        {
            InitializeComponent();
            collection = new ObservableCollection<Model>()
            {
                new Model() { Header = "Tab1"},
                new Model() { Header = "Tab2"},
                new Model() { Header = "Tab3"},
                new Model() { Header = "Tab4"},
            };
            DataContext = this;
            //xamTabCtrl.ItemsSource = collection;
        }
    }
public class Model
{
    private ObservableCollection<Login> _logins = new ObservableCollection<Login>()
    {
        new Login() { User = "User", Password = "Password"},
        new Login() { User = "User", Password = "Password"},
        new Login() { User = "User", Password = "Password"},
    };

    public string Header { get; set; }

    public ObservableCollection<Login> Logins
    {
        get { return _logins; }
    }
}
{"Can only base on a Style with target type that is base type 'TabItemEx'."}
  <Style TargetType="{x:Type igWindows:TabItemEx}" BasedOn="{x:Static igThemes:PrimitivesMetro.TabItemEx}">
                <Setter Property="Header" Value="{Binding Path=Header}"/>
            </Style>