-
Hi to yall, over the past 3 to 4 weeks I've been working on an Avalonia UI app which I'll be using, once completed, to manage audio and images in DnD sessions. Today, I decided to update the Avalonia packages from 11.0.6 to 11.2.2. In this program I'm using ReactiveUI's interactions to make the ViewModel do operations which requires some sort of reference to the Window ( e.g. opening a file selection dialog ). And my code looks like this: Inside the Window.LoadedHandler which is called when the Loaded event is raised ( this is in MainWindow.axaml.cs ): ((MainWindowViewModel)this.DataContext).SelectFilesInteraction.RegisterHandler(this.SelectFilesInteractionHandler); and this is the SelectFilesInteractionHandler: private async Task SelectFilesInteractionHandler(InteractionContext<string?, List<IStorageFile>?> context) Moving to the ViewModel, the Interaction is initialized as follows: this._selectFilesInteraction = new Interaction<string?, List<IStorageFile>?>(); So, when I'm calling the Interaction.RegisterHandler method I was calling, before the update, the overload with this signature: public IDisposable RegisterHandler(Func<IInteractionContext<TInput, TOutput>, Task> handler) And now, after the update, even if this overload is still in the file I get directed to when I click on "Go to source/definition", the only overloads I'm able to call are those: public IDisposable RegisterHandler<TDontCare>(Func<IInteractionContext<TInput, TOutput>, IObservable<TDontCare>> handler)
public IDisposable RegisterHandler(Action<IInteractionContext<TInput, TOutput>> handler) And now I'm getting this error: This appears on line 52, which is the line of code I wrote at the beginning of this post. ( I translated this from my machine language ( italian ), but the meaning is the same ) For intellisens and the compiler it seems like the overload I was using ceased to exist. So I'm asking you: am I doing something wrong? Or is it just ReactiveUI and/or Avalonia that changed the implementation? ( Before the update everything worked as expected and without any problem. ) I know I could just go back to the older version, but I don't want to be limited forever by this thing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
ReactiveUI had a breaking change here which we weren't aware of. It uses now IInteractionContext instead (notice the leading I for the interface). |
Beta Was this translation helpful? Give feedback.
ReactiveUI had a breaking change here which we weren't aware of. It uses now IInteractionContext instead (notice the leading I for the interface).