C# 如何从tabitemex infragistics继承样式
我正在使用基础设施选项卡控制控件。我的itemcontainer值基于对象属性。为了明确我的意思,请看下面的代码片段 WPFC# 如何从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"
谁能继承基础设施主题的风格?我找到了。我找到了继承的类
<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>