本文介绍了获取WPF窗口类名。 C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从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?

解决方案
string name = theWindow.GetType().Name;

这篇关于获取WPF窗口类名。 C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 15:54
查看更多