WPF - How do I get the MainWindow instance?

前端 未结 2 2107
无人及你
无人及你 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:30

    Try this: Application.Current.MainWindow._frameCounter

    Application.MainWindow MSDN

提交回复
热议问题