我正在使用Frame进行fb登录,当我进入登录页面时,事件会按预期触发,但在此之后,即使我登录并转发,我也不会再收到任何事件。
这是我的代码: XAML:
<Frame x:Name="webFrame" Canvas.Left="12" Canvas.Top="72" Height="235" Width="542"
Navigated="frame_Navigated" Navigating="frame_Navigating"
>
C#:
webFrame.Source = loginUrl;
private void frame_Navigated(object sender, NavigationEventArgs e)
{
FacebookOAuthResult result;
if (FacebookOAuthResult.TryParse(e.Uri, out result))
{
if (result.IsSuccess)
{
var accesstoken = result.AccessToken;
}
else
{
var errorDescription = result.ErrorDescription;
var errorReason = result.ErrorReason;
}
}
}
private void frame_Navigating(object sender, NavigatingCancelEventArgs e)
{
FacebookOAuthResult result;
if (FacebookOAuthResult.TryParse(e.Uri, out result))
{
if (result.IsSuccess)
{
var accesstoken = result.AccessToken;
}
else
{
var errorDescription = result.ErrorDescription;
var errorReason = result.ErrorReason;
}
}
}