Skip to content

Commit

Permalink
Merge pull request #288 from stalexig/master
Browse files Browse the repository at this point in the history
Fixing a problem with updating data in CheckBoxColumn
  • Loading branch information
grokys authored Dec 13, 2024
2 parents 1cd818d + bdf88bc commit f2a71d5
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.ComponentModel;
using Avalonia.Controls.Models.TreeDataGrid;
using Avalonia.Controls.Selection;
using Avalonia.Input;
Expand Down Expand Up @@ -70,6 +71,21 @@ public override void Realize(
}

base.Realize(factory, selection, model, columnIndex, rowIndex);
SubscribeToModelChanges();
}

public override void Unrealize()
{
UnsubscribeFromModelChanges();
base.Unrealize();
}

protected override void OnModelPropertyChanged(object? sender, PropertyChangedEventArgs e)
{
base.OnModelPropertyChanged(sender, e);

if (e.PropertyName == nameof(CheckBoxCell.Value) && Model is CheckBoxCell checkBoxCell)
Value = checkBoxCell.Value;
}

protected override void OnPointerPressed(PointerPressedEventArgs e)
Expand Down

0 comments on commit f2a71d5

Please sign in to comment.