wpf 关于PathListBoxItem里添加Trigger
问题是这样的,我需要一个加入PathListBoxItem的style里的Trigger.
比如说这样。
<Trigger Property="Status" Value="True">
然后我在装着这个PathListBox的usercontrol(类名是UC_Meeting_Topology)对应的.cs文件中加了一个依赖属性。
#region DependencyProperty Status
public string Status
{
get { return (string)GetValue(StatusProperty); }
set { SetValue(StatusProperty, value); }
}
// Using a DependencyProperty as the backing store for Status. This enables animation, styling, binding, etc...
public static readonly DependencyProperty StatusProperty =
DependencyProperty.Register("Status", typeof(string), typeof(UC_Meeting_Topology), new PropertyMetadata(null));
#endregion
这样的。
现在,在Trigger中无法使用这个依赖属性。提示无法识别或访问成员“Status”。
怎么注册这个属性,才可以在PathListBoxItem的style中的Trigger中调用。