uwpplatformuno

The Uno Platform button cannot be clicked


I'm still trying on the Uno Platform, but there's a reaction

I wrote the following code in MainPage.xaml: <Grid> <Button Content="点击" Click="buttonIngerprintRecognition"></Button> <TextBlock Name="textBlock" Text="not clicked"></TextBlock> </Grid> I wrote the following code in MainPage.xaml.cs: public void buttonIngerprintRecognition(object sender, RoutedEventArgs e) { textBlock.Text = "clicked"; } I run a windows program. Now I put a breakpoint on the first line of the method and click the button, but the program fails to stop at the first line of the method.


Solution

  • The reason why the button click event cannot respond is that the textblock blocks the button. It is recommended to use StackPanel or RelativePanel to avoid the controls from overlapping.