-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi,
First of all thanks for this great tutorial. I implemented the facebook login button but after clicking and completing login OnSuccess,OnFail and OnError callbacks not triggered on viewModel. After some digging code realized that custom view bindable properties not set. So triggering callbacks in native side stopped because custom view's properties is null. So I changed little bit and putting one example for a Binding Property of custom login button.
Happy coding!
FacebookLoginButton.cs:
// this is the Bindable property. Added property changed property to set manually
public static readonly BindableProperty OnSuccessProperty =
BindableProperty.Create(nameof(OnSuccess), typeof(Command<string>), typeof(FacebookLoginButton), propertyChanged: OnSuccessPropertyChanged);
static void OnSuccessPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
((FacebookLoginButton)bindable).OnSuccessPropertyChanged((Command<string>)oldValue, (Command<string>)newValue);
}
void OnSuccessPropertyChanged(Command<string> oldValue, Command<string> newValue)
{
OnSuccess = newValue; //setting command value
}
fernandoschilipack
Metadata
Metadata
Assignees
Labels
No labels