maui icon indicating copy to clipboard operation
maui copied to clipboard

Process ContainerView through mapper and fix NeedsContainer logic

Open PureWeen opened this issue 3 years ago • 0 comments

Description of Change

  • When a container needs to be added we should update it via the Mapper so that participating views can intercept via the Mapper
    • These changes are related to https://github.com/dotnet/maui/pull/12259. I need a way from Controls to trigger an update with the container changes.
  • The NeedsContainer calculation on WinUI seems to be incorrect and was left out of the Clip and Shadow updates. The ViewHandler always adds a container for all platforms if Clip and Shadow are set but NeedsContainer wasn't taking those properties into account. This was actually causing RemoveContainer to get called if you set Clip and didn't set Shadow but since RemoveContainer was called during initial setup the ContainerView would incorrectly remain in place even though HasContainer would transition to false. You'll see in the tests here for ContainerView testing I added a check for HasContainer because that value is currently false on Windows without the change in this PR for the ContainerView tests.
    • This also could lead to scenarios in windows where if you were to remove a shadow but leave the clip the container would disappear.

PureWeen avatar Dec 21 '22 23:12 PureWeen