Make empty grid cells clickable
Hi
I'm trying to make the entire grid clickable - even the empty cells should fire a click event.
When I set the background attribute of the layoutroot (grid) to transparent (Background="Transparent"), the grid responds to the click event, but everything turns black!
In WPF this issue can be solved by setting AllowsTransparency="True", but this attribut seems not to exist in NoesisGUI.
How can this be solved in NoesisGUI?
Thank you for your help.
I'm trying to make the entire grid clickable - even the empty cells should fire a click event.
When I set the background attribute of the layoutroot (grid) to transparent (Background="Transparent"), the grid responds to the click event, but everything turns black!
In WPF this issue can be solved by setting AllowsTransparency="True", but this attribut seems not to exist in NoesisGUI.
How can this be solved in NoesisGUI?
Thank you for your help.
-
-
sfernandez
Site Admin
- Posts: 3197
- Joined:
Re: Make empty grid cells clickable
This is a problem we had in 1.1 version. It happens that we use the first element that draws to the surface to decide whether to do a Clear of the color buffer. If that first item fills the entire surface and has a background with a SolidColorBrush, then we do a Clear operation instead of drawing a quad.
That is what is happening in your sample, because the layoutRoot Grid is probably the first element being rendered and has the exact surface dimensions, then we are doing a Clear with a Transparent color, which means that everything gets black. If you want to avoid this, you can make your Grid a bit smaller or bigger using the Margin:
Because this is less than intuitive, we changed it in 1.2. In that version you don't have to worry about anything, we only do a Clear when rendering to texture, so you can start with a transparent texture.
That is what is happening in your sample, because the layoutRoot Grid is probably the first element being rendered and has the exact surface dimensions, then we are doing a Clear with a Transparent color, which means that everything gets black. If you want to avoid this, you can make your Grid a bit smaller or bigger using the Margin:
Code: Select all
<Grid x:Name="LayoutRoot" Background="Transparent" Margin="1">
...
</Grid>
Re: Make empty grid cells clickable
Thanks, this worked for me!
Thank you for your help.
Thank you for your help.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 12 guests