开发者

Content Resized event for WPF app

开发者 https://www.devze.com 2023-03-10 17:52 出处:网络
For some scaling recalculation in a Silverlight application I use the following event: App.Current.Host.Content.Resized += new EventHandler(Content_Resized);

For some scaling recalculation in a Silverlight application I use the following event:

 App.Current.Host.Content.Resized += new EventHandler(Content_Resized);

I'd like to use a similar 开发者_StackOverflowevent in a WPF application, but can not figure out what it should be.

What is an equivalent of Silverlight's App.Current.Host.Content.Resized for a WPF application?


WPF can have multiple windows which are not hosted anywhere, that is why there is no respective property in the Application class, if you have a conceptual main window you can set the application's MainWindow property and handle Application.Current.MainWindow.SizeChanged instead.

0

精彩评论

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