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

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -