Replies: 1 comment 3 replies
-
There is an interesting discussion about something similar for WPF, here: microsoft/microsoft-ui-xaml#674 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing a rotator component that updates some properties every frame. Obviously, I don't want to update properties when the component is not visible to avoid wasting CPU.
Issue
I'm trying to figure out how to manage if a
Control
changed its visibility, and it's being a little bit tricky because this component is not being hidden itself directly (it's part of the ControlTemplate). So the component is indirectly hidden when some of its parents is hidden.Workaroud
I noticed that there is an
IsEffectivelyVisible
property that is useful to determine the visibility in this scenario but was unable to be notified when the EffectivelyVisibility was changed.I made a sample application to test indirect visibility, and I noticed that when a control is indirectly set to visible/hidden, the property
TransformedBounds
is changed, so I wrote this ugly workaround:Questions
So I'm missing an
IsEffectivelyVisibleProperty
that would really be useful for this scenario.Beta Was this translation helpful? Give feedback.
All reactions