So, I have a TreeView that looks something like this:
<TreeView Name="elementTreeView" ItemsSource="{Binding Elements}" Width="Auto" SelectedValuePath="Path" />
I also have a TextBlock, which is defined as follows:
<TextBlock Text="{Binding ElementName=elementTreeView, Path=SelectedValue}" />
My ModelView is pretty simple and contains exactly what you expect. I am looking for a way to bind a property in my ViewModel to SelectedValue. Right now the text block is displaying what I need. Is there an easy way to associate this property?
wpf binding
Landonchropp
source share