How to access WPF MainWindow Controls from my own .cs file

后端 未结 7 1199
执笔经年
执笔经年 2021-01-31 18:28

I am a NOVICE and am very much struggling with what seems should be a very simple task. How do I modify a property of a MainWindow TextBlock, from ano

7条回答
  •  广开言路
    2021-01-31 19:14

    You need to create an instance of MainWindow.

    But there shouldn't be a reason to do that because it will be done automagically in an WPF app. Unless you have specific reason to do that (which I doubt because of this question and because you say you're a novice).

提交回复
热议问题