Skip to content
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

The Great Interface Removal Part I #9553

Merged
merged 5 commits into from
Nov 29, 2022
Merged

Conversation

grokys
Copy link
Member

@grokys grokys commented Nov 27, 2022

What does the pull request do?

As discussed in #9495, removes a bunch of unneeded interfaces; the concrete classes should be used from this point on:

  • IAvaloniaObject -> AvaloniaObject
  • IControl -> Control
  • IInteractive -> Interactive
  • ILayoutable -> Layoutable
  • IPanel -> Panel
  • IStyledElement -> StyledElement
  • ITemplatedControl -> TemplatedControl
  • IVisual -> Visual

In a few cases, the interfaces were used to hide less commonly needed functionality, e.g. IVisual.VisualRoot: the extension methods should be used, e.g. control.GetVisualRoot().

Doesn't remove IStyleable yet, that will come in a later PR (perhaps some other interfaces can be removed too).

Breaking changes

Yes :)

Fixed issues

Fixes #9495

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0026598-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

Copy link
Member

@maxkatz6 maxkatz6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

40% LGTM 60% YOLO

@maxkatz6 maxkatz6 merged commit ca26912 into master Nov 29, 2022
@maxkatz6 maxkatz6 deleted the refactor/remove-interfaces branch November 29, 2022 03:50
@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0026649-beta. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]

grokys added a commit that referenced this pull request Nov 29, 2022
…on-handler

fix logic that was broken accidentally in #9553
@rabbitism
Copy link
Contributor

I have a question. How is it possible to assign StyleKey if IStyleable is going to be removed?

@maxkatz6
Copy link
Member

@rabbitism it was discussed in the #9495

grokys added a commit that referenced this pull request May 15, 2023
This was signalled for removal in #9553, but I was hesitant to do it because it will be in use by a lot of code in order to override `StyleKey`. Instead of removing it, deprecate it and provide a virtual `StyledElement.StyleKeyOverride` property as the supported way of overriding a control's style key.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking Change: Remove Unneeded Interfaces
4 participants