Closed bitpoke-YT closed 3 months ago
Can you share your full code for your code behind? It's likely a signature problem.
Here is the Code it is the same as in the Guide
using Avalonia.ReactiveUI;
using ReactiveUI;
using MusicApp.ViewModels;
using System.Threading.Tasks;
namespace MusicApp.Views;
public partial class MainWindow : ReactiveWindow<MainWindowViewModel>
{
public MainWindow()
{
InitializeComponent();
this.WhenActivated(d => d(ViewModel!.ShowDialog.RegisterHandler(DoShowDialogAsync)));
}
private async Task DoShowDialogAsync(InteractionContext<MusicStoreViewModel,
AlbumViewModel?> interaction)
{
var dialog = new MusicStoreWindow();
dialog.DataContext = interaction.Input;
var result = await dialog.ShowDialog<AlbumViewModel?>(this);
interaction.SetOutput(result);
}
}
How about the ViewModel, specifically the definition of ShowDialog?
Describe the bug
When following the Guide and i get to Open a Dialog Vscode with the extension flags
this.WhenActivated(d => d(ViewModel!.ShowDialog.RegisterHandler(DoShowDialogAsync)));
for DoShowDialogAsync underlined with read This is what is said Argument 1: cannot convert from 'method group' to 'System.Action<ReactiveUI.IInteractionContext<MusicApp.ViewModels.MusicStoreViewModel, MusicApp.ViewModels.AlbumViewModel? and getting some error when trying to run or buildTo Reproduce
Copy the code from the Guide on the website https://docs.avaloniaui.net/docs/tutorials/music-store-app/opening-a-dialog
Expected behavior
No response
Avalonia version
11.1.0
OS
Windows
Additional context
Sorry if it is not written well.