开发者

Drawing A Line In Silverlight...Canvas Width Is Invalid

开发者 https://www.devze.com 2023-02-17 03:34 出处:网络
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.

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 400x300 pixels or so, and when you click on it, it goes into Fullscreen mode. I want to use the Height and Width to开发者_Go百科 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

0

精彩评论

暂无评论...
验证码 换一张
取 消