Replies: 2 comments
-
You can just assign the root of the date template to TeachingTip.Target (doc is WinUI 3, but applies to WinUI 2 as well) when a navigation item is clicked. |
Beta Was this translation helpful? Give feedback.
-
Hi @roxk - I'm not sure what you mean by "root of the data template". However, I was able to get the TeachingTip to work when I did it this way:
I didn't realize I could assign the target on the fly like that. Although this works, there is a side effect from another handler that causes the TeachingTip to dismiss when I move off the item. In my PointerExited handler, I change the visibility attribute of an image on that item. If the TeachingTip is showing, it will then close automatically. Trying to reopen it causes weird problems (wrong placement in particular). Anyway, I'll play with it a bit more and will probably go back to using the Popup. I do appreciate your quick response and help. Best regards, |
Beta Was this translation helpful? Give feedback.
-
Hello -
I've learned enough of using xaml TeachingTip elements to make them open from buttons. However, I would like to also use TeachingTip elements with NavigationViewItems that are implemented using a DataTemplate that binds an ObservableCollection class.
The problem is that a targeted TeachingTip must have a named target; else you don't get the little arrow poking out of the side of the tip. Is there a way to obtain the name of a NavigationViewItem implemented in this fashion so that it can be used as the target of a TeachingTip? I was not able to find a non-null name in the NavigationViewItem Invoked handler args.
For now, I'm using a xaml Popup, which I can open at a desired vertical location by counting down the navigation item list and multiplying by the item height to obtain the y offset for the popup. Not perfect, but seems to work OK (I keep track of expanded items to add in those item heights when computing y offset).
But ideally, I would hope to use the TeachingTip, so any guidance that can be provided would be most appreciated.
Thank you.
Robert
Beta Was this translation helpful? Give feedback.
All reactions