-1
自己的枚举返回NULL我有这样的代码:WPF DataTrigger - 在XAML
的.xaml:
<DataTrigger Binding="{Binding Path=TypeItem}" Value="{x:Static local:CListBoxItem+ETypeItem.File}">
...
</DataTrigger>
的.cs:
public CListBoxItem(ETypeItem _type)
{
this.TypeItem = _type;
InitializeComponent();
}
...
public enum ETypeItem { File, Directory }
...
public static readonly DependencyProperty TypeItemProperty =
DependencyProperty.Register("TypeItem", typeof(ETypeItem), typeof(CListBoxItem), new PropertyMetadata(ETypeItem.Directory));
public ETypeItem TypeItem
{
get { return (ETypeItem) GetValue(TypeItemProperty); }
set { SetValue(TypeItemProperty, value); }
}
当我运行的应用程序我的风格不工作。当我使用:
<DataTrigger Binding="{Binding Path=TypeItem}" Value="{x:Null}">
...
</DataTrigger>
然后工作..如何使TypeItem加载自己的风格?
非常感谢。这项工作:D –