Tag: windows phone 7

Windows phone 7芒果开发链接

我是Windows Phone开发的新手。 我从学习C#和Silverlight开始。 有没有人有学习Windows Phone Mango的链接/资源?

WP7中的UnhandledException

制作WP7应用程序时,我遇到了这个奇怪的错误,我看不出原因。 我得到的唯一输出/错误消息是“UnhandledException:参数不正确。::: ProgramName.App” 此错误随机发生,我没有从调试器获得有关如何解决它的任何信息。 当我运行相同的代码两次,一次得到错误,另一次没有。 所以,你们之前有没有遇到过这个错误,也许可以告诉我它为什么会发生这种情况? 这太令人沮丧了,因为它是随机发生的。 任何建议将受到高度赞赏:) 编辑:这是完整的堆栈跟踪: at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value) at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value) at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value) at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value) at System.Windows.PresentationFrameworkCollection`1.Add(UIElement value) at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 index, DependencyObject container, Boolean needPrepareContainer) at System.Windows.Controls.ItemsControl.AddContainers() at System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj) at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at […]

我无法保存到隔离存储?

我正在尝试将模型保存在独立存储中: var settings = IsolatedStorageSettings.ApplicationSettings; CurrentPlaceNowModel model = new CurrentPlaceNowModel(); settings.TryGetValue(“model”, out model); if (model == null) { MessageBox.Show(“NULL”); settings.Add(“model”, new CurrentPlaceNowModel()); settings.Save(); } else MessageBox.Show(“NOT NULL”); 当我启动emu i ofcourse时“NULL”,但是如果我关闭emu上的应用程序并从菜单中再次启动它(为什么我在Visual Studio中再次启动它),为什么还要继续使用它。 第二次我不应该得到“NOT NULL”吗?

如何将此行从C#转换为VB.net(Windows Phone 7)

嗨,我正在研究一些未来项目所需的网络代码,但我无法将此代码从C#更改为VB.net。 有人可以帮忙请求吗? this.btnAdd.Click += btnAdd_Click;

如何在wp7中更改列表框项的可见性属性?

例如:有一个列表框: 如何以编程方式更改TextBlocks的可见性属性?

我们可以控制wp7屏幕的亮度吗?

如何让屏幕在几秒钟后变暗,点击后应该很亮。这可能吗?

如何从64位应用程序连接到Windows Phone 7

我有一个32位程序(用C ++编写)可以连接到一些不同的设备,只要它是32位一切正常。 但是,现在我需要将其构建为64位程序,但后来我遇到了Windows Phone 7的一些问题。 我发现我重建为64位的dll(用C#编写)会在此行抛出exception: MultiTargetingConnectivity connectivity = new MultiTargetingConnectivity(CultureInfo.CurrentUICulture.LCID); 例外是: An unhandled exception of type ‘Microsoft.SmartDevice.Connectivity.DatastoreException’ occurred in Microsoft.SmartDevice.Connectivity.dll Additional information: Retrieving the COM class factory for component with CLSID {349AB2E8-71B6-4069-AD9C-1170849DA64C} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). (例如,如果我尝试运行此示例程序,它以32位工作,但在同一行中以64位引发该exception) 当我在注册表中搜索该CLSID时,我找到了“C:\ Program Files(x86)\ Common Files \ […]

在WP7中将照片上传到picasa时未经授权的访问exception

我有以下代码试图将图片上传到picasa网站。 当我试图上传时,我获得了未经授权的访问exception。 我不知道如何获得AuthToken。 这是我的代码。 如果您有任何线索,请告诉我。 public delegate void UploadPhotoCallback(bool success, string message); public static void UploadPhoto(string albumId, string originalFileName, byte[] photo, UploadPhotoCallback callback) { string Username = “mailmugu”; string AuthToken = “”; try { var url = string.Format(“http://picasaweb.google.com/data/feed/api/user/{0}/albumid/{1}”, Username, albumId); var request = WebRequest.Create(new Uri(url)) as HttpWebRequest; //request.ContentType = HttpFormPost.ImageJpeg; //request.Method = HttpMethods.Post; request.ContentType = […]

如何使用全景项目选择

我试图检测用户当前所在的当前全景项目,然后相应地切换应用程序栏图标按钮isenabled属性。 我没有运气如何实现这样的function,或正确检测当前的全景项目。 具体来说,我想使用selectedItem属性并检测全景项的名称而不是selectedIndex属性,因为全景项可能会更改它们的顺序。 有没有办法做到这一点? 到目前为止,我所拥有的是以下内容: MainPage.xaml中 … … … … MainPage.xaml.cs中 private void PanoramaItemSelectionChanged(object sender, SelectionChangedEventArgs e) { string currentPanoramaItem = e.AddedItems[0] as string; switch (currentPanoramaItem) { case “statuses”: //show application bar button? break; case “mentions”: //show application bar button? break; case “messages”: ((ApplicationBarIconButton)ApplicationBar.Buttons[0]).IsEnabled = true; break; case “favorites”: //show application bar button? break; default: […]

Windows Phone中的WebBroswer查询

我有以下代码,但是当我构建它时,我在WebBrowserDocumentCompletedEventArgs上收到错误,告诉我无法找到类型或命名空间。 我一直在网上搜索并尝试添加DLL超过一个小时。 有人可以帮忙吗? private void b_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser b = sender as WebBrowser; string response = b.DocumentText; // looks in the page source to find the authenticity token. // could also use regular expressions here. int index = response.IndexOf(“authenticity_token”); int startIndex = index + 41; string authenticityToken = response.Substring(startIndex, 40); // unregisters […]