Playing around with WPF

0
72

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.