-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 –