-
Notifications
You must be signed in to change notification settings - Fork 21
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
Adding Click event to a button in axaml file disables preview update #257
Comments
Check the logs from the previewer process, do they contain any errors? |
Yes they do, but they always has this error
|
This means that a socket connection was terminated, perhaps by the IDE process. Are there any error messages from the IDE? In the IDE logs, perhaps? |
Thanks for quick response! I found this
|
I would guess that the compiled assembly doesn't contain the method in question, and that's why the previewer breaks (it cannot resolve a method and thus trying to resolve a property with a string parameter, which also fails). Anyway, this is likely to be an upstream previewer issue, but I'll have to check how other previewers handle this. |
Thank you for your suggestion. Building both Avalonia.Desktop and main Avalonia projects solved the issue |
I can't see how it is supposed to help anything. I am very confused now. |
You said that compiled assembly doesn't contain the method in question but after building it now does so it helps i guess? |
How would building of |
Honestly, i have no idea. rider64_fZ9yAj0fIL.mp4 |
Ah, so it is not Avalonia.Desktop, but some of your libraries. Yes, this makes sense. |
I have investigated the issue, and, yeah, it is not an AvaloniaRider problem: AvaloniaVS behaves the same. This is because of a fundamental problem: it's impossible to apply any XAML changes that require DLL update on-the-fly. I would recommend using MVVM command binding instead, it should work much better. You can, of course, open an issue in the upstream repository, but honestly I doubt it's solvable. |
I have thought about that more, and opened #262 to track further progress. |
Describe the bug
After adding Click event to any button live preview update in rider disables (no further updates whatsoever)
To Reproduce
Create a new cross-platform application (avalonia.xplat)
Add and a Click event to it
Live preview no longer updates
Expected behavior
I expect preview to update
Screenshots
Before adding click
![](https://camo.githubusercontent.com/1acfae3d48152682ed56d4cfb50e2cdd305c26f387b317c361daecc49074cf8e/68747470733a2f2f692e696d6775722e636f6d2f524462563539362e706e67)
After adding click event
![](https://camo.githubusercontent.com/7af6577c6be17714f7741bc3429372cbf8630edfea5d02bc4f780940dc297ba5/68747470733a2f2f692e696d6775722e636f6d2f50315772336c432e706e67)
Desktop (please complete the following information):
Windows 10
Rider 2022.3.1
AvaloniaRider 1.0.2
Avalonia 11.0.0-preview
I didn't notice this issue before so i'm open to suggestions why this might have happened
The text was updated successfully, but these errors were encountered: