c# - Event handling with WPF -
i started learning wpf , c#.
i'm trying listen global events on wpf application. has run during entire time program running. on console application, run logic in main() function. however, main() generated during compile time in wpf application.
where put event handlers in wpf application?
not sure mean global events in context, :
public partial class mainwindow : window { public mainwindow() { initializecomponent(); this.loaded += mainwindow_loaded; } private void mainwindow_loaded(object sender, routedeventargs e) { //do stuff here } }
this mainwindow.xaml.cs class generated in every wpf template in visual studio.
Comments
Post a Comment