You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During investigating the issue in another repository, I've identified the problem there. (or can be somewhere deeper inside VS)
The constructorActiveFrameChangeEventArgs(IVsWindowFrame oldFrame, IVsWindowFrame newFrame) calls constructors for WindowFrame(IVsWindowFrame frame) and these in turn calls SetProperty(-3011, this) later invoking NotifyPropertyChanged("ViewHelper") in original WindowFrame possibly messing other things during Window initialization. My investigation ended here, I didn't went further.
Anyway, I was able to reproduce the bug with calling WindowFrame(IVsWindowFrame frame) myself.
What if it didn't new up a WindowFrame at all, but just returned the IVsWindowFrame. Then we can add a extension method to IVsWindowFrame that returns a WindowFrame for people to use when needed. It can return null if the WindowFrame constructor fails.
Wouldn't changing signature break all current usages?
In current WindowManagerService implementation they are guaranteed to be WindowFrame or null.
WindowFrameoldFrame= varValueOld as WindowFrame;WindowFramenewFrame= varValueNew as WindowFrame;
NotifyWindowFrameEvent(delegate(uintcookie,IVsWindowFrameEventsevents){
events.OnActiveFrameChanged(oldFrame, newFrame);});
But with extension way. WindowFrame constructor should be called on main thread, maybe the async method should be created as well.
During investigating the issue in another repository, I've identified the problem there. (or can be somewhere deeper inside VS)
The constructor
ActiveFrameChangeEventArgs(IVsWindowFrame oldFrame, IVsWindowFrame newFrame)
calls constructors forWindowFrame(IVsWindowFrame frame)
and these in turn callsSetProperty(-3011, this)
later invokingNotifyPropertyChanged("ViewHelper")
in originalWindowFrame
possibly messing other things during Window initialization. My investigation ended here, I didn't went further.Anyway, I was able to reproduce the bug with calling
WindowFrame(IVsWindowFrame frame)
myself.Is it possible to not create new instances and reuse the old ones when they are already
WindowFrame
?The text was updated successfully, but these errors were encountered: