Telerik UI for Windows Phone by Progress

The following article explains how the events fired by RadCloudLogin can be used in your application.

LoggingIn

The LoggingIn event is fired when a user tries to login. It is cancelable, so it can be used, for example to block specific users from access to your application. Here's an example:

CopyC#
private async void RadCloudLogin_LoggingIn(object sender, LoginEventArgs e)
{
    if (e.Identification == "user1")
    {
        e.Cancel = true;
        await RadMessageBox.ShowAsync("You are not allowed to access this application!");
    }
}

Success

The Success event is fired when the user has successfully logged in. It can be used to perform some initialization logic for example setting some properties in the ViewModel. Here's an example:

CopyC#
private void RadCloudLogin_Success(object sender, EventArgs e)
{
    MainViewModel.Instance.IsUserLoggedIn = true;
}

Failed

The Failed event is fired when the user login is unsuccessful. It can be used to notify the user that the login has failed and eventually to give some clues for the failure reason. Here's an example of how this event's usage:

CopyC#
private async void RadCloudLogin_Failed(object sender, LoginFailedEventArgs e)
{
    string message = "Login failed.";
    if (e.FailReason == LoginResult.WrongUsernameOrPassword)
    {
        message = "The provided credentials are not valid!";
    }
    await RadMessageBox.ShowAsync(message);
}