Browse Source

Allow null item in BindingHelper.Evaluate.

Fixes #11220.
pull/12193/head
Steven Kirk 3 years ago
parent
commit
c7da9c4bb8
  1. 4
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

4
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@ -1395,10 +1395,8 @@ namespace Avalonia.Controls.Primitives
public object Evaluate(object? dataContext)
{
dataContext = dataContext ?? throw new ArgumentNullException(nameof(dataContext));
// Only update the DataContext if necessary
if (!dataContext.Equals(DataContext))
if (!Equals(dataContext, DataContext))
DataContext = dataContext;
return GetValue(ValueProperty);

Loading…
Cancel
Save