【发布时间】:2015-11-28 00:11:29
【问题描述】:
我有一个 ListBox,其扩展器与 ListBoxItem 不同。扩展器的内容中有 ListBox。现在我想在标题和扩展器的内容中应用搜索过滤器。
例如:-
如果标题有a,内容有b,c,d,bt,如果我搜索b,那么将显示扩展器有a,内部内容它只显示b和bt。
下面是我的绑定结构。
private ObservableCollection<FontDetail> _fontDetail;
public ObservableCollection<FontDetail> FontDetailList
{
get
{
return _fontDetail;
}
}
FontDetail
{
public FamilyChild fontChild { get; set; }
//ContextMenu End
public bool IsFamily { get; set; }
public int TotalFonts { get; set; }
public List<FamilyChild> FamilyChildList { get; set; }
}
public class FamilyChild
{
public FontStatus Status { get; set; }
public long TimeToAdd { get; set; }
public FontType FontType { get; set; }
public string SampleText { get; set; }
public string Name { get; set; }
public string FontFamily { get; set; }
public string FontStyle { get; set; }
public long FontWeight { get; set; }
public string FontId { get; set; }
public string MenuItem1 { get; set; }
public string MenuItem2 { get; set; }
public string MenuItem3 { get; set; }
public bool IsEnableMenuItem1 { get; set; }
public bool IsEnableMenuItem2 { get; set; }
public bool IsEnableMenuItem3 { get; set; }
}
所以我已经将 ListBox 与 FontDetailList 绑定了。现在我想在 FontDetail 和 FamilyChildList 上应用过滤器。 Expander header 中的 FontDetail 绑定,FamilyChildList 绑定为扩展器的内容。
【问题讨论】:
标签: wpf filter listbox expander