using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; using Avalonia.ReactiveUI; using demo_trade.ViewModels; using ReactiveUI; using System.Reactive.Disposables; using System.Threading.Tasks; namespace demo_trade; public partial class GuestProductControl : ReactiveUserControl { public GuestProductControl() { this.WhenActivated(disposables => disposables(ViewModel!.ShowDialog.RegisterHandler(DoShowOrderDialogAsync))); AvaloniaXamlLoader.Load(this); } private async Task DoShowOrderDialogAsync(InteractionContext interaction){ var dialog = new OrderShowDialog(); dialog.DataContext = interaction.Input; var result = await dialog.ShowDialog(TopLevel.GetTopLevel(this) as Window); interaction.SetOutput(true); } }