diff --git a/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs b/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs index 760483ef..7cbe7188 100644 --- a/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs +++ b/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs @@ -35,8 +35,7 @@ namespace EpoxyHello.Avalonia11.ViewModels; [ViewModel] public sealed class MainWindowViewModel { - //public Command Ready { get; } - public Well ReadyWell { get; } + public Well MainWindowWell { get; } = Well.Factory.Create(); public bool IsEnabled { get; private set; } @@ -49,12 +48,13 @@ public sealed class MainWindowViewModel public MainWindowViewModel() { // A handler for window opened - //this.Ready = Command.Factory.Create(() => - this.ReadyWell = Well.Factory.Create("Opened", () => - { - this.IsEnabled = true; - return default; - }); + this.MainWindowWell.Add( + Window.WindowOpenedEvent, + () => + { + this.IsEnabled = true; + return default; + }); // A handler for fetch button this.Fetch = Command.Factory.Create(async () => diff --git a/playground/EpoxyHello.Avalonia11/Views/MainWindow.axaml b/playground/EpoxyHello.Avalonia11/Views/MainWindow.axaml index 6a62ff3b..52e177b9 100644 --- a/playground/EpoxyHello.Avalonia11/Views/MainWindow.axaml +++ b/playground/EpoxyHello.Avalonia11/Views/MainWindow.axaml @@ -27,21 +27,13 @@ xmlns:converters="clr-namespace:EpoxyHello.Avalonia11.Views.Converters" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="EpoxyHello.Avalonia11.Views.MainWindow" - Title="EpoxyHello.Avalonia11"> + Title="EpoxyHello.Avalonia11" + epoxy:Fountain.Well="{Binding MainWindowWell}"> - - - - -