WPF - How to access method declared in App.xaml.cs?

后端 未结 2 412
死守一世寂寞
死守一世寂寞 2021-02-03 22:39

How can I access, using C#, a public instance method declared in App.xaml.cs?

相关标签:
2条回答
  • 2021-02-03 22:51
    ((App)Application.Current).YourMethod ....
    
    0 讨论(0)
  • 2021-02-03 23:04

    Have you considered to create a separate class to hold your application wide methods (eg. AppState.cs)?

    0 讨论(0)
提交回复
热议问题