TouchUp not working for Image

I can’t seem to get the Image on the display to respond to touch. It works in other software. I can see the touch down and up in the debug output but that window is not seeing it as the function to handle the touch doesn’t fire.

I have the following functions in Program.cs

        private static void Touch_TouchUp(FT5xx6Controller sender, TouchEventArgs e)
        {
            if (touchState)
            {
                touchState = false;

                Application.Current.InputProvider.RaiseTouch(e.X, e.Y, GHIElectronics.TinyCLR.UI.Input.TouchMessages.Up, DateTime.UtcNow);
                Debug.WriteLine("Touch up");
            }
        }

        private static void Touch_TouchDown(FT5xx6Controller sender, TouchEventArgs e)
        {
            if (!touchState)
            {
                touchState = true;

                Application.Current.InputProvider.RaiseTouch(e.X, e.Y, GHIElectronics.TinyCLR.UI.Input.TouchMessages.Down, DateTime.UtcNow);
                Debug.WriteLine("Touch down");
            }
        }

I then have this in the class that handles the UI

currentForecastImage.TouchUp += ForecastImage_TouchUp;

It’s as if the touch is not being passed to the class. This never gets called.

I’m unsure if this is related. I had a similar issue where TouchUp wasn’t working. I found that my screen vendor changed the touch controller IC. The new touch controller had the x and y swapped on the touch up. I now check the Firmware ID of the touch controller and swap the x and y in the Touch_TouchUp function.

I just checked and both touch up and down are similar values so X and Y are correct.

I should add that the same code that displays the clock digits, responds to the touch on the image. They both run the same software with a hardware switch determining which LCD they are running on. The more complex and loaded display for the 3rd LCD is the one that is not working.

I have 1 image that needs to respond to a touch up and second textbox that is used for display only and should respond to the touch up.