protected override void OnElementChanged(ElementChangedEventArgs <View> e) { if (Control == null) { var fbLoginBtnView = e.NewElement as FacebookLoginButton; var fbLoginbBtnCtrl = new Xamarin.Facebook.Login.Widget.LoginButton(_ctx) { LoginBehavior = LoginBehavior.NativeWithFallback }; fbLoginbBtnCtrl.SetReadPermissions(fbLoginBtnView?.Permissions); fbLoginbBtnCtrl.RegisterCallback(MainActivity.CallbackManager, new MyFacebookCallback(this.Element as FacebookLoginButton)); SetNativeControl(fbLoginbBtnCtrl); } }
#pragma warning disable CS0809 // Obsolete member overrides non-obsolete member protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.View> e) //Android.View ? #pragma warning restore CS0809 // Obsolete member overrides non-obsolete member { if (Control == null) { var fbLoginBtnView = e.NewElement as FacebookLoginButton; var fbLoginbBtnCtrl = new Xamarin.Facebook.Login.Widget.LoginButton(ctx) { LoginBehavior = LoginBehavior.NativeWithFallback }; fbLoginbBtnCtrl.SetReadPermissions(fbLoginBtnView.Permissions); fbLoginbBtnCtrl.RegisterCallback(MainActivity.CallbackManager, new MyFacebookCallback(this.Element as FacebookLoginButton)); SetNativeControl(fbLoginbBtnCtrl); } }