you may try this but, for more specific answers please elaborate your question possibly with some examples.
In this example i have used an xml file to populate the tree view and then getting the selected value.
private void _treeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
if ((((System.Windows.Controls.ItemsControl)(sender)).Items).Count > 0)
{
string CategoryName = (((System.Xml.XmlElement)(_treeView.SelectedItem))).Attributes[0].Value;
string Name = (((System.Xml.XmlElement)(_treeView.SelectedItem))).Attributes[1].Value;
string Imageref = (((System.Xml.XmlElement)(_treeView.SelectedItem))).Attributes[2].Value;
}
}
probably you may get some hint from this example..