Skip to content

Commit

Permalink
Merge pull request #25 from AvaloniaUI/SoftDataContext
Browse files Browse the repository at this point in the history
Use soft DataContext synchronization
  • Loading branch information
maxkatz6 authored Mar 17, 2024
2 parents 44d83f8 + e115bd5 commit 2242e47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Avalonia.Controls.ItemsRepeater/Controls/ViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void ClearElementToElementFactory(Control element)
// During creation of this object, we were the one setting the DataContext, so clear it now.
if (virtInfo.MustClearDataContext)
{
element.DataContext = null;
element.SetCurrentValue(Control.DataContextProperty, null);
}

if (_owner.ItemTemplateShim != null)
Expand Down Expand Up @@ -634,7 +634,7 @@ Control GetElement()
if (data != element)
{
// Prepare the element
element.DataContext = data;
element.SetCurrentValue(Control.DataContextProperty, data);
virtInfo.MustClearDataContext = true;
}

Expand Down

0 comments on commit 2242e47

Please sign in to comment.