Xamarin.forms: EntryRenderer Obsolete: Please provide guide how to use new EntryRenderer

Created on 23 Nov 2018  路  2Comments  路  Source: xamarin/Xamarin.Forms

Description

Inheriting EntryRenderer shows "Obsolete since version 2.5.... Please use EntryRenderer(Context) instead"

Steps to Reproduce

  1. Create new renderer class
  2. Inherit EntryRenderer
  3. You should see the warning above

Expected Behavior

If you change implementation, provide some instructions how to use it. It looks like Context is also obsolete,

Actual Behavior

No warnings should happen, or instructions should be provided

question

Most helpful comment

You can simply add a constructor that takes a Context object and pass that to the base, like this:

public MyEntryRenderer(Context context) : base(context)
{
}

It also documented here: https://www.davidbritch.com/2017/11/xamarinforms-25-and-local-context-in.html

All 2 comments

You can simply add a constructor that takes a Context object and pass that to the base, like this:

public MyEntryRenderer(Context context) : base(context)
{
}

It also documented here: https://www.davidbritch.com/2017/11/xamarinforms-25-and-local-context-in.html

@jfversluis Thanks, that works

Was this page helpful?
0 / 5 - 0 ratings