Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF events in Child windows from DROP event are not propogating

$
0
0

I have a WPF application  having drag and drop functionality. On Drop event I am popping up a child window with a button. It will work normally in mouse driven environment but in case of multi touch monitor it won’t . The events say Touch down or mouse down or preview mouse down wont fire in child window.

Please refer the attached sample project. Thank you very much in advance.

 private void Button_PreviewMouseDown(object sender, MouseButtonEventArgs e)
    {
      DragDrop.DoDragDrop(this, "DropData", DragDropEffects.Copy);
    }   

private void Button_Drop(object sender, DragEventArgs e)
    {
      MessageBox.Show("I got dropped data on event");
      Window1 kk = new Window1();
      kk.Owner = this;
      kk.ShowDialog();
    }

In Window1.cs 


   <Grid><Button Margin="64,97,92,117" Click="Button_PreviewMouseDown"
                Content="Click me!"
                Focusable="True"   /></Grid>


    private void Button_PreviewMouseDown(object sender, MouseButtonEventArgs e)
    {
      MessageBox.Show("I preview got click!");
      Close();
    }

}





Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>