简体   繁体   English

Silverlight中是否有OnDrawComplete类型事件?

[英]Is there an OnDrawComplete type event in silverlight?

我正在寻找一个在Silverlight窗口中绘制完所有表单元素后触发的事件。

It depends on what you want to use it for. 这取决于你想用它做什么。 In WPF, the FrameworkElement.Loaded event always fires after the template has been applied, however in Silverlight, that is not guaranteed to be true. 在WPF中, FrameworkElement.Loaded事件总是应用模板触发,但是在Silverlight中,不保证是真的。 As an alternative, you may want to work with the FrameworkElement.LayoutUpdated event. 或者,您可能希望使用FrameworkElement.LayoutUpdated事件。 This may, however, become very expensive if you have lots of moving parts in your visual tree. 但是,如果您的可视树中有许多活动部件,这可能会变得非常昂贵。

我通常使用UserControl.SizeChanged事件,只是在第一次调用事件时使用它,并且应该在那时呈现控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM