获取WPF窗口类名。 C#窗口、WPF

2023-09-06 18:43:03 作者:た寶貝吥哭う

我需要从WPF窗口类的字符串值?比如我有MainWorkspace窗口类的一个实例,我想要得到这个MainWorkspace字符串。如何做到这一点?

解决方案

 字符串名称= theWindow.GetType()名称。
 

I need to get string value from WPF Window class? For example I have an instance of MainWorkspace window class, and I want to get this "MainWorkspace" string. How to do this?

解决方案 C WPF如何美化窗口

string name = theWindow.GetType().Name;