Xamarin.Android: TextChangedEventArgs Properties

Nathan Sokalski 4,111 Reputation points
2021-03-07T21:49:16.8+00:00

I am converting an app from Xamarin.Forms to Xamarin.Android. The TextChangedEventArgs parameter of the AfterTextChanged, BeforeTextChanged, and TextChanged events contains the properties AfterCount, BeforeCount, Start, and Text as stated at:
https://learn.microsoft.com/en-us/dotnet/api/android.text.textchangedeventargs?view=xamarin-android-sdk-9
However, it gives no description of what these properties are. I can guess the Text property, but I am not sure what the others are. In Xamarin.Forms there was a NewTextValue & OldTextValue, which are very straightforward, but I could not find a description of the ones in Xamarin.Android. Is there anywhere with good documentation on what these properties are?

Developer technologies .NET Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. JarvanZhang 23,971 Reputation points
    2021-03-08T03:33:26.74+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    but I could not find a description of the ones in Xamarin.Android. Is there anywhere with good documentation on what these properties are

    The related doc doesn't provide the description about the properties. Xamarin.Android is based on the native Android sdk, the attributes have the same purpose.You could refer to this native tutorial to get the explanation.

    • Text: The text the TextView is displaying
    • Start: The offset of the start of the range of the text that was modified
    • BeforeCount: The length of the former text that has been replaced
    • AfterCount: The length of the replacement modified text

    Check the doc: https://developer.android.com/reference/android/widget/TextView#onTextChanged(java.lang.CharSequence,%20int,%20int,%20int)

    You can also report the missing attribute description to the prodcut team on github.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.