Now I think I understand why this happening so I guess my question is how can I modify the code to act how I want.
First the code.
private void btnLiveSignin_Click(object sender, RoutedEventArgs e)
{
var LoggedIn = Login();
busy.Visibility = System.Windows.Visibility.Visible; // Display the please wait message
if (LoggedIn.Result)
{
// Do something
}
}
public async Task<bool> Login()
{
try
{
var e = await lac.InitializeAsync(Scopes);
if (e.Status == LiveConnectSessionStatus.Connected)
{
client = new LiveConnectClient(e.Session);
// do some stuff now that we are connected
return true;
}
else
{
// not connected so do something
return false;
}
}
catch (Exception ex)
{
return false;
}
}
Basically when the user clicks a button it will log them in to their windows live account and while that is happening a message appears asking the user to please wait.
As you can guess the UI locks so the message never appears. How can I change it so the UI doesn't lock?
I done this with windows phone 7.5 before using events as the sdk didn't use async, and that worked perfectly fine. Would this require a mixture of asyncing and events?