53.2 F
Los Angeles
Thursday, March 28, 2024

Trump Lawyer Resigns One Day Before Trial To Begin

Joseph Tacopina has filed with the courts that he will not represent Donald J. Trump. The E. Jean Carroll civil case is schedule to begin Tuesday January 16,...

Judge Lewis A. Kaplan Issues Order RE Postponement

On May 9, 2023, a jury found Donald J. Trump liable for sexual assault and defamation. The jury awarded Ms. Carroll $5 million in damages. Seven months ago,...

ASUS Announces 2023 Vivobook Classic Series

On April 7, 2023, ASUS introduced five new models in the 2023 Vivobook Classic series of laptops. The top laptops in the series use the 13th Gen Intel® Core™...
StaffIncremental BloggerPlaying around with WPF

Playing around with WPF

I’ve been wanting to code up a radial menu control in WPF for a long while. I’ve started a couple times, but gave up after I realized I was trying to make the code too flexible and my understanding of how WPF worked didn’t match.

Today, however, I tried a much simpler approach. I gave myself permission to hardcode anything I wanted. It made a big difference. In about an hour I had the ultra-tiny “form” app shown here with a semi-transparent radial menu:

Now that I’ve had some limited success, I’ll try for something a little more re-usable and something worthwhile sharing.

This time around, though, I constructed the radial menu from an Ellipse that was positioned at the bottom left of the window. Actually, it’s top position is bound to the height of a grid that consumes the whole client area of the window itself. And further, the location of the ellipse is translated vertically by half its height to place it in the correct position. The left position is fixed since the left edge of the window doesn’t ever resize. Just the right and bottom edges do.

The toolbar buttons are merely images that are strategically placed within the edge of the ellipse. Nothing fancy here. Triggers (and styling) are used to provide feedback when the cursor enters one of the buttons or clicks on them. Right now the icons don’t save any state. This is a toy app after all.

Anyway, there lots more to do, but it was fun seeing at least this much running.

Loren
Lorenhttp://www.lorenheiny.com
Loren Heiny (1961 - 2010) was a software developer and author of several computer language textbooks. He graduated from Arizona State University in computer science. His first love was robotics.

Latest news

Related news