WPF - How do I get the MainWindow instance?

前端 未结 2 2079
无人及你
无人及你 2020-12-30 21:35

I have this in MainWindow.xaml.cs:

public partial class MainWindow : Window
{
    public double _frameCounter = 0;\\;

Very new to WPF and C

相关标签:
2条回答
  • 2020-12-30 22:21

    You can access your field with

    Application.Current.MainWindow._frameCounter
    
    0 讨论(0)
  • 2020-12-30 22:30

    Try this: Application.Current.MainWindow._frameCounter

    Application.MainWindow MSDN

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