Hi, I am trying to use javascript to log a click event but I can’t seem to make it happen no matter what I try. I am an absolute beginner and I’m sure I am (obviously) doing something wrong here. Can anybody lead me in the right direction? Thanks in advance.
Here is what I have
It results in the initial ‘handled1’ being logged but not the function with ‘handled2’.
Though the button does respond visually to a click, the function isn’t executed.
<App>
<JavaScript>
console.log("Handled1");
function f1(){
console.log("Handled2");
}
</JavaScript>
<StackPanel>
<Button Text="Click Me" Clicked="{f1}" />
</StackPanel>
</App>