Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display UIElement but without UI interactions (to touches, clicks, ...)

I would like to add some kind of watermark over a page in my application : The watermark is a UIElement (a Canvas for instance with partial opacity) which is on top of all others controls.

And I want it to be "transparent" to any touches/clicks/gestures. As "transparent", I mean that controls that are behind should act normally for touches/clicks/gestures. For instance if my watermark is above some kind of document viewer, I can still use swipe to navigate my document viewer (across the watermark canvas).

In my different attempts (I tried with ManipulationMode, PointerPressed, ...) my watermark is either not visible or either blocking touches/clicks/gestures.

like image 381
arnaud del. Avatar asked Nov 01 '22 03:11

arnaud del.


2 Answers

Unfortunately, there isn't a way in a Windows 8.1 application to place XAML content OVER a WebView without obstructing the mouse/gestures that would normally be passed. While using IsHitTestVisible is normally the correct choice, due to the nature of how WebView is integrated, it simply does not work.

(This also does not work in the current builds of Windows 10.)

The only other option that may not be desirable would be to manipulate the HTML content, which you could do by InvokingScriptAsync and adding an HTML img element to the BODY dynamically.

like image 187
WiredPrairie Avatar answered Jan 04 '23 13:01

WiredPrairie


I believe property IsHitTestVisible is what you are looking for. This way control will ignore mouse and other interaction and let's them "through".

like image 22
Filip Avatar answered Jan 04 '23 13:01

Filip