modern-forms / Modern.Forms

Cross-platform spiritual successor to Winforms for .NET 6+
MIT License
842 stars 54 forks source link

ActivePopupWindow reference update #71

Closed dax-leo closed 1 year ago

dax-leo commented 1 year ago

Hi,

just a small improvement idea.

The line of code below should be within PopupWindow Show(), not within Control implementing PopupWindow. https://github.com/modern-forms/Modern.Forms/blob/504a7bf6c7747a2ec7709c657b226a59e75b8187/src/Modern.Forms/ComboBox.cs#L83

(PopupWindow) What we have now: https://github.com/modern-forms/Modern.Forms/blob/504a7bf6c7747a2ec7709c657b226a59e75b8187/src/Modern.Forms/PopupWindow.cs#L41-L56

(PopupWindow) We should change into: image

Reason: Not possible to (properly) use PopupWindow as a standalone control (ApplicApplication.ActivePopupWindow is internal). PopupWindow should be responsible to change ActivePopupWindow reference, not the control implementing it.

jpobst commented 1 year ago

Good suggestion, that makes a lot more sense!