我的 WPF 项目中有以下结构(非常简化):
Button newProduct = new Button();
Grid newGrid = new Grid();
Button modify = new Button();
Button remove = new Button();
newGrid.Children.add(modify);
newGrid.Children.add(remove);
newProduct.Content = newGrid;
Run Code Online (Sandbox Code Playgroud)
每个按钮都有自己的点击事件。按钮内也有文本块。NewProduct 突出显示其内容,修改更改文本块信息并从视图中删除删除主按钮。
我的问题是,每当我单击较大按钮(修改、删除)中的按钮之一时,较大按钮 newProduct 的单击事件也会触发。newProduct 单击事件根据需要更改其大小,单击修改或删除时我不需要它执行任何操作。
我的问题是。如果单击主按钮内的按钮之一,我怎样才能做到这一点,只有它们各自的单击事件被触发,而不是来自主按钮的事件?
有没有办法告诉 newProduct 当鼠标悬停在它的一个孩子上时忽略它的点击事件?
谢谢你,如果这个问题得到了解答,我深表歉意,我搜索了很多,但没有找到我需要的。
每个人。我正在使用 gradle 版本 5.6.2。我像这样更新了我的 android studio 项目依赖项:
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.google.gms:google-services:4.3.2'
classpath "com.google.firebase:perf-plugin:1.3.1"
}
Run Code Online (Sandbox Code Playgroud)
我应用这样的插件:
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
但是现在当我编译我的项目时,这个错误出现了:
Illegal class file: Class module-info is missing a super type. Class file version 53. (Java 9)
Run Code Online (Sandbox Code Playgroud)
它说问题出在 app\build\intermediates\transforms\FirebasePerformancePlugin\bus\debug\9\module-info.class
里面是这样的:
module com.google.gson {
requires transitive java.sql;
exports com.google.gson;
exports com.google.gson.annotations;
exports com.google.gson.reflect;
exports com.google.gson.stream;
}
Run Code Online (Sandbox Code Playgroud)
我的猜测是 firebase 开始使用 Java 9,但我的项目目前正在使用 Java 8。我尝试将版本更改为 9,但出现此错误:
Could not target platform: 'Java SE 9' using tool chain: 'JDK 8 (1.8)'.
Run Code Online (Sandbox Code Playgroud)