我有一个问题,我在WP7应用程序中使用encode4fun dll来显示弹出消息。 我使用:MessagePrompt在第一次启动应用程序时崩溃
- Micrsoft.Phone.Controls.Toolkit
- Coding4fun.Phone.Controls
在首次启动时对设备部署其崩溃说,值不能为空(参数名元素)而在仿真器上运行良好。我试过这个DLL的最新版本,但结果是一样的。
虽然添加最新版本1.4.8的Micrsoft.Phone.Controls.Toolkit会给出警告,添加Silverlight库可能会导致意想不到的后果。
虽然我试过其他版本的这个DLL仍然没有成功。
我在堆栈跟踪变得异常
- Clarity.Phone.Extensions.DialogService.InitializePopUp
- Clarity.Phone.Extensions.DilaogService.Show
基本上我使用内部的弹出mainpage.xaml(第一页)的构造函数在InitializeComponent()之后,并且在部署时首次启动时引发null引用类型,但是应用程序正在安装。再次如果我在设备上运行应用程序,那么它显示正确。 我的代码是:
notificationPrompt = new MessagePrompt();
notificationPrompt.Title = "Notification"
notificationPrompt.Body = "";
notificationPrompt.ActionPopUpButtons.Clear();
Button btnDisclaimer = new Button() { Content = "Yes" };
btnDisclaimerContinue.Click += new RoutedEventHandler(btnNotificationPromptYes_Click);
Button btnDisclaimerCancel = new Button() { Content = "No" };
btnDisclaimerCancel.Click += new RoutedEventHandler(btnNotificationPromptNo_Click);
notificationPrompt.ActionPopUpButtons.Add(btnDisclaimerContinue);
notificationPrompt.ActionPopUpButtons.Add(btnDisclaimerCancel);
notificationPrompt.Show();
我用最新的coding4fun库试过这个代码,它工作正常,也许你可以提供更多的代码或细节。参考警告,是否可以尝试包含Silverlight工具包而不是Windows Phone工具包?这两个都可以在http://silverlight.codeplex.com/ –
找到这工作正常模拟器,但在设备中引发空引用异常,并且还添加最新版本的dll,它是版本1.4.8,它在添加微软时发出警告。 phone.controls.toolkit(silverlight警告)。 – pan4321
基本上我在mainpage.xaml(第一页)的构造函数内使用InitializeComponent()后面的弹出框,并且在部署时首次启动时引发空引用类型,但是安装了app。再次如果我在设备上运行应用程序,那么它显示正确。 – pan4321