Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to set IsHitTestVisible Property from code behind?

$
0
0

Hi everyone. I am trying to get/set the IsHitTestVisible property from code behind. Looking over http://msdn.microsoft.com/en-us/library/system.windows.uielement.ishittestvisible(v=vs.110).aspx, I know its set to true by default for every UIElement, however I want to be able to set IsHitTestVisible to true for only "one canvas" and false to all others to prevent capturing specific mouse-related events (clicks, etc) I haven't yet figured out a way but believe it could be accomplished via triggers and overriding the default property. Could somebody please point me in the right direction?

This is the code I have so far in the .xaml:

<InkCanvas Name="DisplayCanvas" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="{Binding Path=IsItemEnabled}" EditingMode="None"/> 

Thanks,

Michael

 

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>