开发者

Event that fires after element is resized

开发者 https://www.devze.com 2023-01-18 11:53 出处:网络
Here is a problem: after loading some visual elements, I need to change something knowing their new sizes. There is MeasureOverride method, but it is called before changing the 开发者_运维百科size. Is

Here is a problem: after loading some visual elements, I need to change something knowing their new sizes. There is MeasureOverride method, but it is called before changing the 开发者_运维百科size. Is there any method that is called after it?

P.S. I know that I can calculate new sizes having old ones, but new sizes aren't calculated simply. It would be much easier to just use such an event (if it exists).


Are you looking for the FrameworkElement.SizeChanged event?

MSDN's description:

Occurs when either the ActualHeight or the ActualWidth properties change value on a FrameworkElement.

EDIT:

This article has a good description of both the SizeChanged and LayoutUpdated events, including an overview of how the layout loop works.

0

精彩评论

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

关注公众号