How to Subclass WPF's TreeViewItem and use it in a treevview
问题 I have created a simple dependency property that I want to attach to a treeViewitem, I have done similar things for other controls such as buttons but cannot figure out how to use the TreeViewItem in a treeview without loosing my defined style. With the code below I get "A style intended for type 'ErrorTreeViewItem' cannot be applied to type 'TreeViewItem'." public class ErrorTreeViewItem : TreeViewItem { static ErrorTreeViewItem() { } public bool ErrorState { get { return (bool)GetValue