I have the following XAML code:
<Grid Background="Blue"> <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown"> <CheckBox MouseLeftButtonDown="CheckBox_MouseLeftButtonDown_1"></CheckBox> </Grid> </Grid>
When I click the checkbox with the left mouse button, the declared event does not fire. Can anyone explain this behavior? thanks in advance
The event is handled by something else (perhaps it is consumed by the event Checked).
Checked
If you change the event to PreviewMouseLeftButtonDown(tunnel version MouseLeftButtonDown), it will fire correctly.
PreviewMouseLeftButtonDown
MouseLeftButtonDown
CheckBox ButtonBase, (OnMouseLeftButtonDown). UIElement.MouseLeftButtonDown ( ):
. , , . Mouse . , , . , .
ClickMode ClickMode.Hover, , , , . , , , , .
PreviewMouseLeftButtonDown. , , , , MouseDown - , , AddHandler .
Franci ... MouseLeftDownEvent, clickMode = hover . MouseleftDownEvent, .
Source: https://habr.com/ru/post/1716045/More articles:How to rotate an object in Java 3D? - javaASP.NET get viewstate in global.asax - asp.netlu. [TableName] instead of dbo. [TableName]? - sql-serverHow to create a SQL Server agent without using a graphical interface? - command-lineHow to serialize an object in C # and prevent fake? - c #Additional property Readonly in the VB.Net interface - propertiesGet the first n lines matching a specific pattern (with Linux commands) - linuxhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1716048/bash-script-to-automatically-create-symlinks-to-subdirectories-in-a-tree&usg=ALkJrhjN6goNe7yS-hAjgumoMvBY1n2fbQHow can I make an interface property read-only in VB.NET? - oopIs there an easy way to calculate quantiles using bash? - bashAll Articles