Main Site Documentation

Glide how to synchronize the hardware?


#1

For example, if I want to update the properties of a UI element within a GPIO button event handler or the DataReceived handler of SPI.Can give an example?


#2

There is no example because it’s much simpler with Glide. All you need to do is access things directly unlike using Windows Presentation Foundation. The only thing you do need to make sure is that your thread safe.


#3

GPIO interrupt service routine can directly access the Glide’s controls?


#4

For example:

private static void port_OnInterrupt(uint port, uint state, DateTime time)
        {
            Image image1 = (Image)window.GetChildByName("image0");
            if (state == 0)
                image1.Bitmap = Resources.GetBitmap(Resources.BitmapResources.rec);
            else
                image1.Bitmap = Resources.GetBitmap(Resources.BitmapResources.recon);
            Debug.Print("Pin=" + port + " State=" + state + " Time=" + time);
        }

Can not change the image?


#5

I’m sorry, updates need to be added:

image1.Invalidate();