Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routed Attached Event Won't Compile #4009

Closed
seanocali opened this issue May 28, 2020 · 4 comments
Closed

Routed Attached Event Won't Compile #4009

seanocali opened this issue May 28, 2020 · 4 comments

Comments

@seanocali
Copy link

seanocali commented May 28, 2020

v0.9.10

Per this documentation:
https://avaloniaui.net/docs/input/events

I couldn't get it to compile.

Error XAMLIL Unable to resolve suitable regular or attached property Click on type Avalonia.Controls:Avalonia.Controls.Button (line 16 position 6) Line 16, position 6. AvaloniaApplication1

I was able to recreate the problem in a brand new project using the example code.

<Border>
  <StackPanel Orientation="Horizontal" Button.Click="CommonClickHandler">
    <Button Name="YesButton">Yes</Button>
    <Button Name="NoButton">No</Button>
    <Button Name="CancelButton">Cancel</Button>
  </StackPanel>
</Border>
public void CommonClickHandler(object sender, RoutedEventArgs e)
{
    // Handle
}
@grokys
Copy link
Member

grokys commented May 28, 2020

Ah yes, looks like that feature isn't yet implemented, sorry @seanocali - my bad, I thought it was implemented.

We hope to have this feature working for 0.10, but in the meantime you'll have to add a click handler to each button separately.

@rstm-sf
Copy link
Contributor

rstm-sf commented Jun 25, 2020

Sounds like a duplicate of this #3898

@yankun
Copy link
Contributor

yankun commented Feb 4, 2022

Does still not work as of 02/2022. Wouldn't it be nice to update the documentation? Wasted some time to figure out, that I was trying to use a feature which is not yet implemented...

@maxkatz6 maxkatz6 changed the title Button.Click Routed Event Won't Compile Routed Attached Event Won't Compile Aug 13, 2022
@maxkatz6 maxkatz6 added enhancement and removed bug labels Aug 13, 2022
@maxkatz6
Copy link
Member

Closing in favor of a more specific issue - #9507. Documentation was updated.

@maxkatz6 maxkatz6 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants