AvaloniaUI / Avalonia.Xaml.Behaviors

Port of Windows UWP Xaml Behaviors for Avalonia Xaml.
MIT License
385 stars 46 forks source link

11.0.9.1 and 11.0.9.2 Breaks Avalonia #151

Closed nixtar closed 6 months ago

nixtar commented 6 months ago

Hello,

I noticed that that this package has been updated and I updated from 11.0.6 to 11.0.9.2 and Avalonia's source generators appear to have stopped working.

My project lit up with Avalonia errors such as: The name 'InitializeComponent' does not exist in the current context The name 'txtUsername' does not exist in the current context Unable to resolve type Interaction from namespace clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity Line 1, position 2.

I thought "ahh my obj cache is confused" as this has happened to me a few times in the past with multiple nuget packages with dependencies on Avalonia.

So I cleared my bin and obj folders, restored the nuget packages and tried rebuilding and it was still giving me the same errors.

I can see in this repo that no actual code changes happened until 11.0.9.1 so I rolled back to 11.0.9 and everything started working. I tested 11.0.9.1 and it also seems to be broken also.

In the meantime, I'll stay on 11.0.9, don't have time to dig deeper this very second but wanted to log something.

When I get a chance, I'll try and reproduce in a new avalonia hello world app.

Running on macOS using Rider, dotnet 8.0, macOS 14.3.1 x86_64.

My current use case for this library is very small:

xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
...
<i:Interaction.Behaviors>
  <ia:EventTriggerBehavior EventName="Closing">
    <ia:InvokeCommandAction Command="{Binding ClosingCommand}"
                            PassEventArgsToCommand="True"/>
  </ia:EventTriggerBehavior>
</i:Interaction.Behaviors>

Please let me know if there is anything in particular you want me to test and I'll have a look when I get a chance.

Cheers, Nick

wieslawsoltes commented 6 months ago

This seems unrelated to Behaviors as it does nothing with InitializeComponent and other