WPF,XAML: How to set the ZIndex of a particular control to the topmost.
- by Sudhakar Singh
how do i set any control to the topmost of the screen. For e.g. i have a textblock in a datatemplate or a hierarchichal data template..etc... now i would like to set this textblock to the topmost on mouseover. Setting the Grid.ZIndex value to 1 in the trigger for IsMouseOver doesn't work many times. In order to do that i set the ZIndex value for all the contols to -1 in the window. it worked in one scenario but doesn't work other times.
If anyone can get me the details of ZIndex and how to set the control to the topmost without worrying about the other controls, it would be of great help.
Note: setting the value of ZIndex to a higher value e.g. 99999 also doesn't work.