The key is: your tree view item's
Content
can be of any type.
Make if a data type representing your book:
class TreeViewContent {
internal TreeViewContent(string categoryName, string name, Uri reference) { }
internal Uri Reference { get { return fReference; } }
internal string CategoryName { get { return fCategoryName; } }
internal string Name { get { return fName; } }
public override string ToString() { }
string fCategoryName, fName;
Uri fReference;
}
The key here is overridden
object.ToString
— this is what you want to see in the nodes of tree view representing the book. You can extend this class to represent different classifiers.
As I understand, you already know how to handle
System.Windows.Controls.TreeView.SelectedItemChanged
.
If this event you should cast note content to
TreeViewContent
type and use your
TreeViewContent.Reference
property (or any other properties) in your handle code.
—SA