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

Ambiguity Between IView.Arrange() and VisualElement.Arrange() #17417

Closed
bradencohen opened this issue Sep 15, 2023 · 2 comments
Closed

Ambiguity Between IView.Arrange() and VisualElement.Arrange() #17417

bradencohen opened this issue Sep 15, 2023 · 2 comments
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-9.0.0-preview.7.24407.4 t/bug Something isn't working
Milestone

Comments

@bradencohen
Copy link
Contributor

bradencohen commented Sep 15, 2023

Description

This is super low priority, just a "gotcha" I ran into that I thought was worth mentioning.

When implementing a custom LayoutManager and invoking the Arrange method during the ArrangeOverride phase, there's a potential ambiguity between two methods:

  1. VisualElement.Arrange() (from VisualElement class)
  2. IView.Arrange() (from IView interface)

Seemingly, only the IView.Arrange() method works correctly within the context of a LayoutManager.

For example, this doesn't work:

 CustomView.TitleLabel.Arrange( destination );

But this does:

( ( IView ) CustomView.TitleLabel ).Arrange( destination );

It took me a decent time debugging to figure out why none of my items were getting arranged on the screen, so at a worst case hopefully this can help some people out. Even if there isn't a fix it might be useful to call this out when the custom layout manager documentation is released.

If I'm misunderstanding something, please let me know, I'm still learning 😄.

Steps to Reproduce

  1. Create a custom layout manager
  2. Within that layout manager, call .Arrange() on a VisualElement without hard-casting to IView

Link to public reproduction project repository

No response

Version with bug

8.0.0-preview.7.8842

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

I was not able test on other platforms

Affected platform versions

Not really relevant

Did you find any workaround?

Yes, hard cast to IView

Relevant log output

No response

@bradencohen bradencohen added the t/bug Something isn't working label Sep 15, 2023
@jsuarezruiz jsuarezruiz added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Sep 18, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Sep 18, 2023
@ghost
Copy link

ghost commented Sep 18, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@jsuarezruiz
Copy link
Contributor

@hartez Thoughts?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-9.0.0-preview.7.24407.4 t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants