Exception : System.InvalidOperationException in UI.dll

Trying to use the Glide sample and getting this error in GlideWindow in the constructor but even before it has reached the code within the constructor.

An unhandled exception of type ‘System.InvalidOperationException’ occurred in GHIElectronics.TinyCLR.UI.dll

The sample came configured for TinyCLR 2.1.0 but seeing as we don’t have access to that just yet, I converted the project to 2.0.0 so I suspect the error is in the code with any recent changes.

Any idea how we can get access to 2.1.0 so that I can work on this project?

In reply to myself, I got it working. I had to change some of the init code around and now I have the screen working and boy is it fast. The only issue I have is with the colours. They look wrong. The grayscale on the buttons is OK but the other colours are wrong. See the 2 images here. The first one is the new display and the second one is the old display. The sample I used before had the correct colours so I swapped RED and GREEN and now the colours are correct.

1 Like

Hi Dave - did you forget to include the pics? And can you share your code so we can play along with you?

Hi John. No, I have ended up abandoning Glide as there is too much missing from the underlying UI to be able to get everything working. For example, TextBlock has no working background option and Buttons don’t seem to have a way to change the text in the code.

I am instead going to see about working with WPF and the UI directly. It Will take much longer as the old way of drag and drop with the Glide Studio was really good for this. :grinning:

I guess once I am up to speed with the WPF way, future work should be faster.

2 Likes

Sounds good!

Making good progress with WPF layout by manually scanning the old XML and using the coordinates and sizes etc with the old Glide fonts. Attached is the morning’s work. Got some additional stuff to add for WiFi status (going to use Alexa to announce remaining cooking time etc)

Next, I have to figure out how to update the display elements. Another post for that.

4 Likes