February 6th, 2012, 08:33 AM
How to determine if form/window is WPF or WinForm?
I apologize in advance if I don't have the terminology quite correct- I've done almost no WPF programming (yet!)
I have an application that I need to support that has a sort of a plug-in client form architecture. The client form can be WinForm or WPF. I need to do a InvokeRequired check if WinForm or Dispatcher.CheckAccess if WPF. I have a handle to the client. Right now I have code that works that has try/catches and if the InvokeRequired check fails, then I assume it's a WPF window and I try the CheckAccess. I'm interested in coming up with a more elegant solution. I have a handle to the form- is there a way for me to programmatically determine if my window is WPF or WinForm without throwing errors from try/catch blocks?
Thanks a bunch! AL
February 6th, 2012, 08:47 AM
Re: How to determine if form/window is WPF or WinForm?
I don't see an "edit" button- I have a IWin32Window that I'm dealing with (which is a WPF window or a WinForm window...)
Click Here to Expand Forum to Full Width