使用全局的EventManager的RegisterClassHandler函数,如:
public partial class App : Application { protected void MyLoaded(object source, RoutedEventArgs e) { object s = e.Source; } protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); EventManager.RegisterClassHandler(typeof(Window), Window.LoadedEvent, new RoutedEventHandler(MyLoaded), true); } } }