Есть ли простой способ передать значение Url
в событие TextBlock_IsMouseDirectlyOverChanged
, не отображая его в пользовательском интерфейсе?
<TreeView Grid.Row="1" ItemsSource="{Binding Nodes}" >
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Nodes}">
<TextBlock IsMouseDirectlyOverChanged="TextBlock_IsMouseDirectlyOverChanged">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}">
<Binding Path="Name" />
<Binding Path="Url" />
</MultiBinding>
</TextBlock.Text>
<TextBlock.ToolTip>
<ToolTip Visibility="Collapsed">
<TextBlock Text="{Binding Url}"></TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
DataModel:
public class Node
{
public string Name { get; set; }
public string Url { get; set; }
public ObservableCollection<Node> Nodes { get; set; }
}