diff --git a/components/TokenizingTextBox/src/TokenizingTextBox.cs b/components/TokenizingTextBox/src/TokenizingTextBox.cs index d3972b4e..a90f2dfe 100644 --- a/components/TokenizingTextBox/src/TokenizingTextBox.cs +++ b/components/TokenizingTextBox/src/TokenizingTextBox.cs @@ -499,9 +499,17 @@ internal async Task AddTokenAsync(object data, bool? atEnd = null) return; } - if (data is string str && TokenItemAdding != null) + if (TokenItemAdding != null) { - var tiaea = new TokenItemAddingEventArgs(str); + TokenItemAddingEventArgs tiaea; + if (data is string str) + { + tiaea = new TokenItemAddingEventArgs(str); + } + else + { + tiaea = new TokenItemAddingEventArgs(null) { Item = data }; + } await TokenItemAdding.InvokeAsync(this, tiaea); if (tiaea.Cancel)