unoplatform / uno.toolkit.ui

A set of custom controls for the WinUI and the Uno Platform not offered out of the box by WinUI, such as Card, TabBar, NavigationBar, etc.
https://platform.uno/
MIT License
77 stars 25 forks source link

[AncestorBinding] add option to support crawling across popup/flyout+host boundary #1135

Open Xiaoy312 opened 2 weeks ago

Xiaoy312 commented 2 weeks ago

What would you like to be added:

<Button>
    <Button.Flyout>
        <Flyout>
            <Button DataContext="{utu:AncestorBinding AncestorType=Button, Path=DataContext...}" />

Why is this needed:

When materialized, the inner button is under the popup branch separate from the outer button's causing the crawling to fail.

For which Platform: all

Anything else we need to know?

Can we even trace back the associated host from the flyout/popup itself? unoplatform/Uno.Samples#681

Xiaoy312 commented 2 weeks ago

uno: [Popup.AssociatedFlyout].Target can be used to retrieve the host // bracket denotes [internal property] win: impossible to do without doing a full crawling of visual tree, and comparing every flyout-host's flyout's content to the FlyoutPresenter's content... and, we have multiple "flyout" MenuFlyout, Tooltip, etc.

agneszitte commented 2 weeks ago

@kazo0, @Xiaoy312 what would be the priority of this issue please

Xiaoy312 commented 2 weeks ago

no idea, just a nice-to-have feature, not really requested by any entity... just not yet also, i dont really see a reasonable way to achieve this for windows atm... so it is kinda blocked