Showing Canvas Outside UserControl boundary
I've found several threads on various sites vaguely related this, but no solid answers.
Here's a simplified example: I want to create a usercontrol that has a textbox and a small icon beside it. 开发者_开发问答 If you click the image, I want to have a canvas appear under the control that has information in it. The canvas would be outside the usercontrol's boundary.
I have gotten this "sorta" working. If I put the textbox, graphic, and just a canvas on the control, with the canvas outside the clip of the usercontrol - I can make the canvas visible/invisible as desired.
When I add stackpanels and such, it starts exhibiting odd behavior - sometime simply vanishing.
So, here's the question - what is the right way to do this? Or, is there a "right way"?
what you need to do is put your canvas into a <Popup>
control. then, show the popup when needed. Here is a video showing how to use a <Popup>
control, Here is the MSDN documentation.
精彩评论