Skip to content

Commit

Permalink
Add [AvaloniaHotReload] example
Browse files Browse the repository at this point in the history
  • Loading branch information
Kir-Antipov committed Nov 25, 2024
1 parent 4b8e071 commit 2a7e05c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion samples/HotReloadDemo/Controls/ToDoItemControl.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
using System.Diagnostics;
using Avalonia.Controls;
using HotAvalonia;

namespace HotReloadDemo.Controls;

public partial class ToDoItemControl : UserControl
{
public ToDoItemControl() => InitializeComponent();
public ToDoItemControl()
{
InitializeComponent();
Initialize();
}

[AvaloniaHotReload]
private void Initialize()
{
// Let's pretend that we did something very important here.
int hashCode = GetHashCode();
Debug.WriteLine("Initializing {0}#{1}...", this, hashCode);
}
}

0 comments on commit 2a7e05c

Please sign in to comment.