windows-phone-7

How to store an integer value in isolated storage in wp7?

百般思念 提交于 2020-01-03 01:34:05
问题 I want store an integer value in isolated storage in wp7 so that when i close and open the app again, the value should be retained. How can I obtained this? 回答1: If it's to store a single integer value, the easiest way is to use IsolatedStorageSettings.ApplicationSettings: // Store the value IsolatedStorageSettings.ApplicationSettings["Whatever"] = yourValue; // Retrieve it yourValue = (int)IsolatedStorageSettings.ApplicationSettings["Whatever"]; 来源: https://stackoverflow.com/questions

The given key was not found in the dictionary

风流意气都作罢 提交于 2020-01-02 23:50:32
问题 I'm developing windows phone 8 application. In this, I have to integrate Twitter. So I have followed the below tutorial. http://code.msdn.microsoft.com/wpapps/Latest-Twitter-integration-a42e8bb6 I've implemented successfully twitter in my application. I've tested this in Emulator and in device also. Everything was fine. Suddenly in the device the application is unable to open the twitter log in page. I'm getting the error in the below method at line started with **. void requestTokenQuery

IsolatedStorageSettings throws an IsolatedStorageFileStream when I try to get value

瘦欲@ 提交于 2020-01-02 19:45:45
问题 I'm trying to get a boolean value I saved using isolatedStoragesettings like this: IsolatedStorageSettings.ApplicationSettings.TryGetValue(KEYSTRING, out myBoolValue); but I get this exception only when I debug Operation not permitted on IsolatedStorageFileStream. when I use (run without debug) Ctrl+F5 it works just fine. any idea whats wrong here? 回答1: It appears that this exception can be the result of accessing IsolatedStorageSettings.ApplicationSettings from multiple threads (which would

Pinch and zoom behaviour for windows phone

◇◆丶佛笑我妖孽 提交于 2020-01-02 19:32:12
问题 Is it possible to create a behavior for Pinch and zoom to Image control in windows phone 8. I am trying to apply pinch and zoom along with rotation to Image in my application. In a forum I found that Gesture listener is deprecated and they are not promoting implementation with gesture. So can any one please suggest an alternative method for me. 回答1: If you're targeting only Windows Phone 8 you can use the new ManipulationDeltaEventArgs.PinchManipulation property from the ManipulationDelta

System.Net.Browser.ClientHttpWebRequest.EndGetResponse throw System.ArgumentException when header contains non-ascii content

让人想犯罪 __ 提交于 2020-01-02 17:46:50
问题 I have a function that written in my Windows Phone 7 project. It is going to trace the content header of each HttpWebRequest and if the content-type is document(like a pdf attachment in Web mail), it will download it. The function worked fine when the file name is English. However, when the file name is non-ascii, say Chinese and Japanese, it will throw an System.ArgumentException in (HttpWebResponse)m_responseRequest.EndGetResponse(m_responseCallbackAsyncResult). How to fix it? It is

Upload image using ASP.NET WebAPI using a model

核能气质少年 提交于 2020-01-02 17:46:49
问题 I am trying to upload an image from my windows phone 8 app to the SQL server database using a WebAPI. I am using a model class for the Images, which simply consists of an ID belonging to the item the image is for, the name of the image and a byte array to hold the image itself. I use a WebClient object to access the WebAPI method. When I try to upload the image, it throws the exception as shown below. Does anyone have an idea why it errors? Also, I am open to other methods of storing the

WP: AesManaged encryption vs. mcrypt_encrypt

橙三吉。 提交于 2020-01-02 17:41:06
问题 I'm trying to synchronize my encryption and decryption methods between C# and PHP but something seems to be going wrong. In the Windows Phone 7 SDK you can use AESManaged to encrypt your data I use the following method: public static string EncryptA(string dataToEncrypt, string password, string salt) { AesManaged aes = null; MemoryStream memoryStream = null; CryptoStream cryptoStream = null; try { //Generate a Key based on a Password, Salt and HMACSHA1 pseudo-random number generator

Unable to reference microsoft.xna.framework.media.phoneextensions.dll

心不动则不痛 提交于 2020-01-02 10:17:49
问题 I am trying to follow this answer to add some audio files to the windows phone emulator's media library. But I get the error The type or namespace name 'PhoneExtensions' does not exist in the namespace 'Microsoft.Xna.Framework.Media' (are you missing an assembly reference?)` I am unable to reference microsoft.xna.framework.media.phoneextensions.dll as it is not present at the location C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71 I installed

Unable to reference microsoft.xna.framework.media.phoneextensions.dll

房东的猫 提交于 2020-01-02 10:17:43
问题 I am trying to follow this answer to add some audio files to the windows phone emulator's media library. But I get the error The type or namespace name 'PhoneExtensions' does not exist in the namespace 'Microsoft.Xna.Framework.Media' (are you missing an assembly reference?)` I am unable to reference microsoft.xna.framework.media.phoneextensions.dll as it is not present at the location C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71 I installed

Load more items into ListBox when scrolled to bottom

老子叫甜甜 提交于 2020-01-02 10:06:59
问题 I've got ListBox bound to List. I want to load more items when scrolled to bottom of list so that some animation indicating loading is shown and bound list is expanded. If I understand correctly, I can use ObservableCollection instead of List and expand that collection. Also, I could wrap ItemPresenter into StackPanel with ItemPresenter and Image at bottom. But how do I detect that list has been scrolled to bottom and initiate expanding of collection? 回答1: Check tutorials: http://blog