I know this has to be simple, but it’s driving me crazy. I’m trying to make a very simple Silverlight application. I want it to be full-screen, and I want to draw a line onto a Canvas.
My problem is that the .Width and .Height of the canvas never seem to have a valid value.
The website shows the canvas at 400×300 pixels or so, and when you click on it, it goes into Fullscreen mode. I want to use the Height and Width to find the usable space of the screen. I’ve tried adding events (thinking that the canvas wasn’t yet ready to be used immediate after the full-screen line of code) but the LayoutChanged and Resized events don’t seem to yield anything.
What am I doing wrong?
Have you tried using .ActualWidth and .ActualHeight. You could also reference this Article