Verfin
Topic Author
Posts: 7
Joined: 07 Jun 2016, 11:46

MouseUp on "empty" Border/Grid does not fire

20 Jun 2016, 13:20

Noesis seems to have a different behaviour than wpf when it comes to visually empty containers:
<Border BorderBrush="Black" BorderThickness="1" MouseUp="Border_MouseUp">
    <Grid MouseUp="Border_MouseUp">
        <TextBlock />
    </Grid>
 </Border>
in wpf the Border_MouseUp fires when the area contained by grid/border is clicked but in Noesis it doesn't. Only when the Textblock actually has text does the event fire as it should. Assigning text and then hiding the textblock doesn't work either.

Is there a way around this, or do I have to make a "ghost" textblock and set its margin to -9999?
 
User avatar
ai_enabled
Posts: 231
Joined: 18 Jul 2013, 05:28
Contact:

Re: MouseUp on "empty" Border/Grid does not fire

20 Jun 2016, 13:29

Hello!

Hit testing is produced only on controls with a background - the same behaviour as WPF.
If you set Background="Transparent" for the border it will resolve the issue.

It seems the NoesisGUI Border default style uses Background="{x:Null}" - so hit testing is not working by default (mouse down/up events are missing when you click on empty space of the border).

Regards!
AtomicTorch Studio Pte. Ltd. http://atomictorch.com

Who is online

Users browsing this forum: Ahrefs [Bot] and 11 guests