Skip to content

Commit

Permalink
Add event handler example
Browse files Browse the repository at this point in the history
  • Loading branch information
Kir-Antipov committed Nov 25, 2024
1 parent cadeec0 commit 44717f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/HotReloadDemo/Controls/ToDoItemControl.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
x:DataType="m:ToDoItem"
x:Class="HotReloadDemo.Controls.ToDoItemControl">

<CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Description, Converter={StaticResource TitleCaseConverter}}" Margin="4"/>
<CheckBox IsChecked="{Binding IsChecked}"
Content="{Binding Description, Converter={StaticResource TitleCaseConverter}}"
Click="CheckBox_Click"
Margin="4"/>

</UserControl>
7 changes: 7 additions & 0 deletions samples/HotReloadDemo/Controls/ToDoItemControl.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using Avalonia.Controls;
using Avalonia.Interactivity;
using HotAvalonia;

namespace HotReloadDemo.Controls;
Expand All @@ -19,4 +20,10 @@ private void Initialize()
int hashCode = GetHashCode();
Debug.WriteLine("Initializing {0}#{1}...", this, hashCode);
}

private void CheckBox_Click(object? sender, RoutedEventArgs e)
{
int hashCode = GetHashCode();
Debug.WriteLine("Clicked {0}#{1}", this, hashCode);
}
}

0 comments on commit 44717f3

Please sign in to comment.