我正在尝试按照facebooksdk.net上的教程将Facebook登录集成到我的应用程序中.我正在尝试使用Facebook按钮控件.
当我点击按钮时出现以下错误:
应用程序配置不允许使用URL.或者应用程序的设置不允许使用更多给定的URL.必须与网站URL或Canvas URL匹配,或者域必须是App的域之一.
截图供参考 -
根据一些 消息来源,如果您在应用设置的"高级"部分的"有效OAuth重定向URI"字段中没有任何条目,则目前存在一个错误,该错误将阻止Facebook登录Windows Phone.这可以通过在此字段中添加" https://m.facebook.com/dialog/return/ms " 来解决.
但是,这并没有解决问题,那么我还可以尝试解决这个问题呢?
我需要使以下代码异步和等待.
我需要从Web服务器获取大量数据,然后这些数据将用于填充我的应用程序中的xaml页面.
所以,我需要DefLogin()方法是等待的.
可能吗?
public void DefLogin()
{
postData = "My Data To Post";
var url = new Uri("Url To Post to", UriKind.Absolute);
webRequest = WebRequest.Create(url);
webRequest.Method = "POST";
webRequest.ContentType = "text/xml";
webRequest.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), webRequest);
}
public void GetRequestStreamCallback(IAsyncResult asynchronousResult)
{
webRequest = (HttpWebRequest)asynchronousResult.AsyncState;
Stream postStream = webRequest.EndGetRequestStream(asynchronousResult);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
postStream.Write(byteArray, 0, byteArray.Length);
postStream.Close();
Debug.WriteLine("Start BEGINGetResponse");
webRequest.BeginGetResponse(new AsyncCallback(GetResponseCallback), webRequest);
}
public void GetResponseCallback(IAsyncResult asynchronousResult)
{
try
{
HttpWebRequest webRequest = (HttpWebRequest)asynchronousResult.AsyncState;
HttpWebResponse response;
response = (HttpWebResponse)webRequest.EndGetResponse(asynchronousResult);
Stream streamResponse …
Run Code Online (Sandbox Code Playgroud) 我为Windows通用平台(Win 10 UWP)创建了一个类库。
该库中包含一些UserControls。
当我从该库中将dll添加到Win 10 UWP应用程序并使用UserControls时,它给出了XamlParseException,如我在发布的另一个问题中所述
但是,当我引用整个项目时,也没有例外,我可以使用UserControl。据说发生这种情况是因为有些xbf文件在我仅引用dll文件时没有添加到Win 10应用程序项目中。
在某个项目中,我需要将xbf文件手动添加到Win 10应用程序项目中,我不能引用整个项目,只能引用dll并添加所需的文件。
我尝试在Visual Studio项目中创建一个文件夹并添加xbf文件,还尝试创建具有不同名称的文件夹,然后通过Windows资源管理器将xbf文件复制到“ bin”目录中。但是没有成功。
因此,如何手动将xbf文件添加到Windows 10 UWP项目?
更新1:-XAML和代码供参考
public sealed partial class CustomPopupControl : UserControl
{
internal CustomPopupControl()
{
this.InitializeComponent(); //-------CRASHES HERE-------
}
internal CustomPopupControl() : base()
{
Debug.WriteLine("CustomPopupControl");
//
//do some stuff
//
//
}
private void OnPopupLoaded(object sender, RoutedEventArgs e)
{
this.Popup_Container.HorizontalOffset = (Window.Current.Bounds.Width - Grid_Child.ActualWidth) / 2;
this.Popup_Container.VerticalOffset = (Window.Current.Bounds.Height - Grid_Child.ActualHeight) / 2;
}
internal void OpenPopup()
{
Debug.WriteLine("OpenPopup");
Popup_Container.IsOpen = true;
var currentFrame …
Run Code Online (Sandbox Code Playgroud) c# windows-8 windows-store-apps win-universal-app windows-10
在我的Windows Phone应用程序中,我需要从一个页面导航到同一页面的新实例.
我怎样才能做到这一点?
如果我导航如下: -
第1页 - >第2页 - >第1页
它创建了一个新的Page1实例.
我想创建一个新实例,如下所示: -
第1页 - >第1页
我试过了
NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.Relative));
Run Code Online (Sandbox Code Playgroud)
在Page1.xaml上 - 它不会导航.