Replies: 2 comments
-
I tested with a NavigationView and PaneDisplayMode="Top" for X (same thing with "Left" for Y) |
Beta Was this translation helpful? Give feedback.
-
Hi @castorix - Thanks for the reply. It looks like you're using VisualTreeHelper.FindElementsInHostCoordinates(). Rather than try to refactor what I've already got to work, I'm going to store this idea away and go back to it if I should need to. I vaguely remember trying to use VTH but was unsuccessful. Probably just my ignorance of VTH. Anyway, if your idea works, it looks easier than what I did (count the number of items open down to where my cursor is, using the item tag to determine when to stop, and then multiply by the element ActualHeight). Not pretty, but what the heck? Once again, thanks very much for the help. Best regards. |
Beta Was this translation helpful? Give feedback.
-
Hello -
I'm looking for a way to determine the vertical offset of a NavigationViewItem relative to its parent. This is so I can place an element over the item. When I examine the ActualOffset value of the item in a PointerEntered handler, it is always (0,0,0). This is in a C# WinUI3 desktop app using WindowsAppRuntime 1.0.
The reason for wanting to do this is to get a workaround for an apparent bug with NavigationViewItem in that if I modify its contents (such as to make an image on that item invisible), I lose the item selection when the cursor moves off the item.
Hopefully, somebody can give me some guidance on these questions. I just want to enable visibility on the item when the cursor is over the item and disable visibility when the cursor moves off. That part works fine.
Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions