-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common interface for all UI components #39
Comments
For consistency all controls will now allow instantiations without passing an ID to the constructor. If no control ID is passed, an ID will be automatically generated. This also means that all controls will now be accessible using Fit.Controls.Find(..). |
PickerBase also implements logic similar to Component (previously found in ControlBase) - for instance it makes the control accessible through Fit.Controls.Find(..) and defines GetId() - both of which only Component should define. |
ListView now extends Component so it doesn't lose functionality removed from PickerBase. Also made sure ListView and WSListView can be instantiated without a control ID. Furthermore fixed potential memory leaks in TreeView and ListView where Dispose() did not call Destroy() to free PickerBase specific resources.
Not all controls/components inherit from a common interface.
Base classes:
Inheriting from ControlBase (edit controls):
Inheriting from PickerBase (defined by DropDown):
Not inheriting from anything:
These components have to implement the same logic again and again (e.g. support for Fit.Controls.Find(..)). But what's equally annoying, is that we have to use feature detection to determine whether a component is for instance disposable or not - we cannot simply rely on type information.
We actually have other objects that also doesn't inherit from anything, but that's alright as they are not intended for use as separate components, but as child components:
What we want is for all objects useful as separate UI components to at least implement the following basic functionality. First and foremost to reduce duplicated code and ensure consistency, and to ensure that all components can reliably be disposed without relying on feature detection.
The text was updated successfully, but these errors were encountered: