I have a text box:
<TextBox Text="{Binding Greeting}" TextInput="OnTextInput"/>
And I'm trying, as you can see, to bind to the TextInput event so that I can do something when the user types some text. However no matter what I do, I get this error on the binding:
Unable to find suitable setter or adder for property TextInput of type Avalonia.Input:Avalonia.Input.InputElement for argument System.Private.CoreLib:System.String, available setter parameter lists are: System.EventHandler`1[[Avalonia.Input.TextInputEventArgs, Avalonia.Input, Version=0.10.0.0, Culture=neutral, PublicKeyToken=c8d484a7012f9a8b]]
I've tried defining a method called OnTextInput on my view model, and also on the code-behind for the view containing the text box. It looks like this:
public void OnTextInput(object sender, TextInputEventArgs e)
{
}
I also tried using RoutedEventArgs in place of TextInputEventArgs. But no matter what I do, I still get that error. How can I set up this binding so that I can do something when the user types some text?
Avalonia.Input.TextInputEventArgs eorusing Avalonia.Input;. This should fix the error you get.TextInputdoes not what you would like to achieve. Instead I think you want to check for changed Text on your Binding. I could provide an anwer to that...using Avalonia.Input. Changed text on my binding? How would I do that?