You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

GetControl vs GetFrameworkElement

Received Response
edited Oct 6, 2015 7:26AM in UI Extensibility 4 comments


There has been an issue long before that GetControl gets called multiple times, on workspaces twice and in the designer three times. Now that most workspaces (except answers) are WPF we have the GetFrameworkElement as well. So now the two methods are called like;

Designer:                  GetControl (3x)
Normal Workspace:   GetControl, GetFrameworkElement
Answer Workspace:  GetControl (2x)

I want to reliably determine which Control I should return and in case of the normal workspace I don't want to prepare the WinForms control and after that the WPF one, since this is a waste of resurces. Some options I considered were
1) ignore GetControl once

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!