本文整理匯總了C#中System.App.NavigateToProfile方法的典型用法代碼示例。如果您正苦於以下問題:C# App.NavigateToProfile方法的具體用法?C# App.NavigateToProfile怎麽用?C# App.NavigateToProfile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.App
的用法示例。
在下文中一共展示了App.NavigateToProfile方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: FacebookPageRenderer
public FacebookPageRenderer()
{
var activity = this.Context as Activity;
var auth = new OAuth2Authenticator(
clientId: "476292725915235",
scope: "",
authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));
auth.Completed += async (sender, eventArgs) => {
if (eventArgs.IsAuthenticated)
{
var accessToken = eventArgs.Account.Properties["access_token"].ToString();
var expiresIn = Convert.ToDouble(eventArgs.Account.Properties["expires_in"]);
var expiryDate = DateTime.Now + TimeSpan.FromSeconds(expiresIn);
var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me"), null, eventArgs.Account);
var response = await request.GetResponseAsync();
var obj = JObject.Parse(response.GetResponseText());
var id = obj["id"].ToString().Replace("\"", "");
var name = obj["name"].ToString().Replace("\"", "");
App app = new App();
await app.NavigateToProfile(string.Format("Olá {0}", name));
}
else
{
await App.Current.MainPage.DisplayAlert("Alerta", "lOGIN CANCELADO", " OK");
}
};
activity.StartActivity(auth.GetUI(activity));
}