Skip to content

Commit 10e3fc7

Browse files
fixes(DataGrid): Warning CS0414 The field 'CellEditBinding.SubjectWrapper._settingSourceValue' is assigned but its value is never used
1 parent 7ee5446 commit 10e3fc7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Avalonia.Controls.DataGrid/Utils/CellEditBinding.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using Avalonia.Data;
22
using Avalonia.Reactive;
33
using System;
4-
using System.ComponentModel.DataAnnotations;
54
using System.Collections.Generic;
65
using System.Reactive.Subjects;
7-
using System.Text;
86

97
namespace Avalonia.Controls.Utils
108
{
@@ -67,11 +65,14 @@ public SubjectWrapper(ISubject<object> bindingSourceSubject, CellEditBinding edi
6765

6866
private void SetSourceValue(object value)
6967
{
70-
_settingSourceValue = true;
68+
if (!_settingSourceValue)
69+
{
70+
_settingSourceValue = true;
7171

72-
_sourceSubject.OnNext(value);
72+
_sourceSubject.OnNext(value);
7373

74-
_settingSourceValue = false;
74+
_settingSourceValue = false;
75+
}
7576
}
7677
private void SetControlValue(object value)
7778
{
@@ -157,4 +158,4 @@ public void CommitEdit()
157158
}
158159
}
159160
}
160-
}
161+
}

0 commit comments

Comments
 (0)