Reputation: 11712
I'm trying to implement custom label and iOS renderer for it using Xamarin.Forms. For some reason code from sample is using method which is not in a base class:
OnElementChanged
Any ideas how to fix?
Upvotes: 5
Views: 4177
Reputation: 1808
With me, it worked after an update of the Xamarin.Forms Library in the NUGET Package Manager. But you have to use ElementChangedEventArgs<> as Parameter type
Upvotes: 2
Reputation: 11712
It turned out that Xamarin.Forms SDK referenced by project template by default is not enough. You have to install additionally NUGET package Xamarin.Forms for your Touch Project:
Upvotes: 5
Reputation: 5234
Change the argument type to ElementChangedEventArgs
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
namespace XForms.Toolkit.iOS.Controls
{
public class MyLabelRenderer : LabelRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
{
base.OnElementChanged(e);
}
}
}
Upvotes: 5