Content Resized event for WPF app
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.
精彩评论