Здравствуйте, Codechanger, Вы писали:
C>Control authors who want to handle mouse double clicks should use the MouseLeftButtonDown event when ClickCount is equal to two. This will cause the state of Handled to propagate appropriately in the case where another element in the element tree handles the event.
Да MSDN-то я читал, и делать так пробовал.
Так еще хуже — событие MouseLeftButtonDown не обрабатывается
вообще. В обработчик не заходит. Вот мой код (тестовый):
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<Grid>
<TreeView>
<TreeViewItem Header="Root1" MouseLeftButtonDown="TreeViewItem_MouseLeftButtonDown">
<TreeViewItem Header="Child1" MouseLeftButtonDown="TreeViewItem_MouseLeftButtonDown">
<TreeViewItem Header="SubChild1" MouseLeftButtonDown="TreeViewItem_MouseLeftButtonDown" >
</TreeViewItem>
</TreeViewItem>
</TreeViewItem>
</TreeView>
</Grid>
</Window>
private void TreeViewItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Trace.WriteLine("Left Button Down");
}
Что я делаю не так?