public Window1()
{
InitializeComponent();
this.button1.AddHandler(Control.MouseDownEvent, new MouseButtonEventHandler(openWindow), true);
this.button2.AddHandler(Control.MouseDownEvent, new MouseButtonEventHandler(closeWindow), true);
}
private void openWindow (object sender, RoutedEventArgs e)
{
/* Here some code */
Window1 w1 = new Window1();
I want to launch this application in a PC with a touch screen, then I’m using MouseDown event instead of Click event.
I have realized that when these buttons are pressed, sometimes, they are not changed to Red. I tried to call Dispatcher.Invoke with Render priority once the button is pressed but it didn’t solve the problem.
Bookmarks