StackPanel does not trigger event related to drag when there is no background brush in WPF

Soya Ohnishi 1 Reputation point
2022-08-07T03:31:54.523+00:00

Hi,
I don't know other elements and triggers rather than drag also have same behavior, but events related to drag of StackPanel are not triggered when there is no background brush.
Accurately, if there are elements in StackPanel and drag to those, drag events are triggered even if no brush.
However, if dragging to other positions like empty space of stackpanel, drag events are not triggerd.
When background color is set, above problems are solved, i.e. events are triggered at anywhere in stackpanel.

Is this a expected behavior or bug?

My Environment:
OS: Windows 10 21H2 19044.1826
IDE: Visual Studio Community 2022 Version 17.2.6
Target Framework: .NET 6.0
Output type: Windows Application(WPF)

Thanks.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
{count} votes