28 lines
899 B
C#
28 lines
899 B
C#
|
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<GuestProductViewModel>
|
||
|
{
|
||
|
public GuestProductControl()
|
||
|
{
|
||
|
this.WhenActivated(disposables => disposables(ViewModel!.ShowDialog.RegisterHandler(DoShowOrderDialogAsync)));
|
||
|
AvaloniaXamlLoader.Load(this);
|
||
|
}
|
||
|
|
||
|
private async Task DoShowOrderDialogAsync(InteractionContext<OrderShowDialogViewModel, bool> interaction){
|
||
|
var dialog = new OrderShowDialog();
|
||
|
dialog.DataContext = interaction.Input;
|
||
|
var result = await dialog.ShowDialog<OrderShowDialogViewModel>(TopLevel.GetTopLevel(this) as Window);
|
||
|
interaction.SetOutput(true);
|
||
|
|
||
|
|
||
|
}
|
||
|
}
|