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

ContentView is not getting invalidated when invoking the InvalidateMeasure() method in WinUI #26423

Closed
marchev-prgs opened this issue Dec 6, 2024 · 2 comments
Labels
platform/windows 🪟 t/bug Something isn't working

Comments

@marchev-prgs
Copy link

Description

When invoking the InvalidateMeasure() on a ContentView, the ContentView is not properly invalidated, i.e. its MeasureOverride() and ArrangeOverride() methods are not being invoked in WinUI. Only the Content is being invalidated, in the sample the Grid is re-measured and re-arranged.
The issue is observed only in WinUI. In Android and iOS the MeasureOverride() and ArrangeOverride() methods of the ContentView are being called.
This obstructs many custom scenarios where one needs to add custom logic to the MeasureOverride() and ArrangeOverride() of the ContentView.

Steps to Reproduce

  1. Get the repo from the link
  2. Open the project in folder Maui/ContentViewNotGettingInvalidatedOnWinUI
  3. Run the project
  4. Place a breakpoint in the MeasureOverride() method of the CustomView class
  5. Click the button

Expected Behavior:
The breakpoint should get hit.
If debugging isn't available to you, it is expected that in the Debug Output a message is displayed saying that the ContentView was measured and arranged.
Expected debug output:
::: CustomView: will MeasureOverride
::: MyGrid: will MeasureOverride
::: CustomView: will ArrangeOverride
::: MyGrid: will ArrangeOverride

Actual Behavior:
The ContentView is not getting invalidated, i.e. the breakpoint is not getting hit.
There is no information in the Debug Output that the MeasureOverride() and ArrangeOverride() of the ContentView methods were called.
Actual debug output:
::: MyGrid: will MeasureOverride
::: MyGrid: will ArrangeOverride

Link to public reproduction project repository

https://github.com/telerik/ms-samples/tree/main/Maui/ContentViewNotGettingInvalidatedOnWinUI

Version with bug

9.0.0 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

I was unable to find a workaround.

Relevant log output

@marchev-prgs marchev-prgs added the t/bug Something isn't working label Dec 6, 2024
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@marchev-prgs
Copy link
Author

Closing this issue as there was already one issue describing the same bug
[WinUI] Cannot invalidate measure and arrange for a ContentView #17367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants