windows-phone-8

Try/Catch not working for WP8 C# .NET with Azure Mobile Services

感情迁移 提交于 2020-01-25 12:58:47
问题 I'm playing around with this block of code: try { mscvUser = imstUser .Where(User => User.Id == intId) .Take(1000) .ToCollectionView(); } catch(MobileServiceInvalidOperationException f){ MessageBox.Show(f.ToString()); } It works fine normally, but I've been deliberately disconnecting my Internet for testing purposes, and I keep hitting MobileServiceInvalidOperationException, but it won't catch it in that block; it throws it back to App.xaml.cs, breaks, and shuts down the app. 回答1: I think you

VK Web API (simple)

百般思念 提交于 2020-01-25 12:30:07
问题 I would like to call the method "photos.get" and retrieve photos from a VK community.The problem is that I am unable to view the oid i.e owner_id( one of the parameters required for the request) when I visit the URL. For example, when I browse a certain community, I end up getting a URL like "http://vk.com/picsa".Instead of this picsa, I require a number that can be passed in as an argument. How do I get the owner_id instead from the URL? 回答1: You can use groups.getById API method. It does

VK Web API (simple)

不打扰是莪最后的温柔 提交于 2020-01-25 12:29:12
问题 I would like to call the method "photos.get" and retrieve photos from a VK community.The problem is that I am unable to view the oid i.e owner_id( one of the parameters required for the request) when I visit the URL. For example, when I browse a certain community, I end up getting a URL like "http://vk.com/picsa".Instead of this picsa, I require a number that can be passed in as an argument. How do I get the owner_id instead from the URL? 回答1: You can use groups.getById API method. It does

VK Web API (simple)

百般思念 提交于 2020-01-25 12:29:06
问题 I would like to call the method "photos.get" and retrieve photos from a VK community.The problem is that I am unable to view the oid i.e owner_id( one of the parameters required for the request) when I visit the URL. For example, when I browse a certain community, I end up getting a URL like "http://vk.com/picsa".Instead of this picsa, I require a number that can be passed in as an argument. How do I get the owner_id instead from the URL? 回答1: You can use groups.getById API method. It does

Windows Phone 8: How to show messagebox right before exiting the App if pressed Back key?

China☆狼群 提交于 2020-01-25 06:57:05
问题 I have an app that needs to get user's attention when user exit the app at least once. So I get the code below to show a messagebox. What I don't know is how do I really exit the app if user has read the message? Because it seems the back key event will always come to the call I setup (OnBackKeyPress) Or what is a good way to handle showing a messagebox without messing around overriding BackKey? Because if have another pop up on screen and user pressed back key, it seems I got some exception

How to check status of bluetooth in Windows Runtime?

天涯浪子 提交于 2020-01-25 03:55:30
问题 There are some odd ways, like checking for pair devices and catching exceptions to see it if is on or not. if ((uint)ex.HResult == 0x8007048F) { var result = MessageBox.Show("Bluetooth is turned off.\nTo see the current Bluetooth settings tap 'ok'", "Bluetooth Off", MessageBoxButton.OKCancel); } But I see there is a new BluetoothConnectionStatus api but don't know how to use it. How to check bluetooth status in Windows Phone Runtime apps? 回答1: It's probably something like this: using Windows

VS Express 2013 for Windows does not halt at the (async) line that throws an exception

泄露秘密 提交于 2020-01-25 02:17:25
问题 I am very new to async programming. When an exception is thrown, I am used to Visual Studio to halt at the erroneous line. In a code like the following, the debugger normally stops and highlights line 2 int[] array = new int[] { 0, 1, 2 }; int throwsException = array[3]; But when an exception occurs in a method that is called with await , than I am completely lost and the debugger simply stops at the await line. public async void ThrowException() { int[] array = new int[] { 0, 1, 2 }; int

How to install plugin in cordova. There is no Plugin folder for cordova, only in phoneGap

徘徊边缘 提交于 2020-01-25 00:23:48
问题 I have downloaded the latest Cordova 3.4.0-rc1. I can run it using Windows Phone emulator in Visual Studio 2013. Now how do I install plugin like Accelerometer, Battery that already included in the phoneGap framework? I cannot find the documentation about it. The reason why I use Cordova instead of phoneGap is because phoneGap has not updated their framework since 5th November 2013 and from what I have heard that there is not much different between these 2 frameworks update my question: I

Windows Phone 8 Http request with custom header

懵懂的女人 提交于 2020-01-24 10:09:05
问题 I want to send a HTTP PUT request to a WCF server from Windows Phone 8, and for identification I have to send a custom header. (assume "mycustomheader" = "abc") I was using WebClient so far, but the Webclient.Headers seems not to have an Add method, so it is not possible to send headers other then the ones in HttpRequestHeader enum. Is there any way to do this with WebClient ? I saw it is possible to set a custom header with HttpWebRequest class, but I just can't get it to do anything at all.

Windows Phone 8 Http request with custom header

孤者浪人 提交于 2020-01-24 10:06:27
问题 I want to send a HTTP PUT request to a WCF server from Windows Phone 8, and for identification I have to send a custom header. (assume "mycustomheader" = "abc") I was using WebClient so far, but the Webclient.Headers seems not to have an Add method, so it is not possible to send headers other then the ones in HttpRequestHeader enum. Is there any way to do this with WebClient ? I saw it is possible to set a custom header with HttpWebRequest class, but I just can't get it to do anything at all.