-
When trying to obtain a controls ActualWidth and ActualHeight, the returned values are always 0 and 1. I have added event listeners for multiple controls' 'Loaded' events, and each one returns a width and height of 0 and 1. I have even included a PointerWheelChanged event listener, so that I could be sure that the controls have rendered before trying to obtain their ActualWidth and ActualHeight values, and the result is the same, width and height are always 0 and 1. There is a demo application at: https://github.com/onslauth/CanvasPanTest. VisualStudio 2022 Does anyone have any suggestions as to the correct way to resolve the problem and get the ActualWidth and ActualHeight values? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Fix Debug.WriteLine, like :
and I get : |
Beta Was this translation helpful? Give feedback.
Fix Debug.WriteLine, like :
System.Diagnostics.Debug.WriteLine(String.Format("Width : {0} Height : {1}", width, height));
and I get :
Width : 6016 Height : 4016