diff --git a/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs b/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs index 760483e..ec38231 100644 --- a/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs +++ b/playground/EpoxyHello.Avalonia11/ViewModels/MainWindowViewModel.cs @@ -29,6 +29,7 @@ using EpoxyHello.Models; using EpoxyHello.Avalonia11.Controls; +using Avalonia.Input; namespace EpoxyHello.Avalonia11.ViewModels; @@ -36,7 +37,7 @@ namespace EpoxyHello.Avalonia11.ViewModels; 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 +50,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 6a62ff3..52e177b 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}"> - - - - -