I have the following WPF control
And it looks like this when the app is running.
The problem is - that the popup - is Closed when my mouse is between the buttons. (the gap between the U, B & NB buttons)
As You can see - Popup.IsOpen property is bound to the stackPanel - IsMouseOver
How can I solve this ? So that the Popup would be open while my mouse is between the mentioned buttons ? (preferably without any code-behind)
Set the StackPanel to Transparent (or whatever color works for you). For some reason, setting the Background brush (even to Transparent) allows the IsMouseOver to work as you would expect. Likely some WPF magic with layout and rendering optimization.
<Grid>
<StackPanel x:Name="ThePanel" Background="Transparent">
<TextBox Margin="5">WOOT</TextBox>
<TextBox Margin="5">WOOT</TextBox>
<TextBox Margin="5">WOOT</TextBox>
</StackPanel>
<Popup IsOpen="{Binding ElementName=ThePanel, Path=IsMouseOver, Mode=OneWay}">
<!--stuff-->
</Popup>
</Grid>
The default value for the backgound for all panels is null, and when the background is null the touch and mouse events will not work. Set the stackpanel background to transparent or other color.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With