windows-phone-7

How to detect if the main app is running from a background agent

蓝咒 提交于 2020-01-16 08:54:48
问题 I'm working on a WP7.5 app where I use a background agent to update tiles in the background (when the app is not running). In the OnInvoke method of the agent, is there a way to know if the main app is currently running ? I'd like to detect that in order to NOT updating the tiles if the app is running because I already udpate them when the app exits. Thank you. 回答1: Your only choice is to write use isolated storage to communicate, since it's shared by both agent and application. Have the main

ListBox does not highlight generated items(itemsSource) works fine for ListBoxItems aded during design

独自空忆成欢 提交于 2020-01-16 07:18:10
问题 I have a ListBox in a popup. It’s bound to a simple Dictionary. I also have a ItemContainerStyle to theme listbox highlights. If I add ListBoxItems at design time, the selection style works, but the same style does not work when I assign ItemsSource. To troubleshoot I stripped it to barebones, and problem persists. Below is the code I have, Launch it, and click on ShowPopup to open Popup, first you will see items added in design time, and if you click on “Add ItemsSource” it will show run

Posting file on Background Agent / HttpWebRequest stream buffer keeps growing?

陌路散爱 提交于 2020-01-16 04:27:06
问题 I need to POST a 5MB file from within a ResourceIntensiveTask, where the OS sets a max memory usage of 5MB. So trying to stream the file directly from storage, but the Stream associated to the HttpWebRequest keeps growing in size. This is the code: public void writeStream(Stream writer, string filesource, string filename) { var store = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication(); var f = store.OpenFile(filesource, FileMode.Open, FileAccess.Read); store.Dispose()

Will apps developed for WP 7.1 work on WP8?

此生再无相见时 提交于 2020-01-16 01:54:12
问题 I have already developed an app targeting Windows Phone 8, but it doesn't work on Windows Phone 7.5. To get it working on both platforms, I have decided to target Windows Phone OS 7.1 via Microsoft Visual Studio 2012 instead. Will my app works on both WP 7.5 and WP 8 if I target WP OS 7.1 in VS 2012? 回答1: Windows Phone applications are forward compatible. This means that applications built for Windows Phone 7.x should work on Windows Phone 8. However, this is not a guarantee. Some

Fastest way to load data

蹲街弑〆低调 提交于 2020-01-16 00:38:32
问题 I have over 500 pieces of data (each containing 4 strings) which I want to load in my WindowsPhone application in several pages, using a ScrollViewer + Grid to display the information in TextBlocks. I thought of doing this with XML, but it didn't seem too appealing regarding speed. Is there a faster or officially preferred way to do this? 回答1: Although results can vary depending on the object graph being used, Binary Serialization is often a good way to go. The trade off is that it's not as

FormatException with IsolatedStorageSettings

≡放荡痞女 提交于 2020-01-15 09:22:10
问题 I have a problem when serializing a Dictionary<string,Person> to IsolatedStorageSettings. I'm doing the following: public Dictionary<string, Person> Names = new Dictionary<string, Person>(); if (!IsolatedStorageSettings.ApplicationSettings.Contains("Names")) { //Add to dictionary Names.Add("key", new Person(false, new System.Device.Location.GeoCoordinate(0, 0), new List<GeoCoordinate>() { new GeoCoordinate(35.8974, 14.5099), new GeoCoordinate(35.8974, 14.5099), new GeoCoordinate(35.8973, 14

Is it possible to use CollectionView with LongListSelector for grouping?

亡梦爱人 提交于 2020-01-15 06:26:10
问题 I am trying to use LongListSelector in conjunction with CollectionView. It seems like CollectionView has all the "stuff" needed, but when I connect the two, nothing happens. Here's what I have so far: In my control's ctor (the guy that contains the LLS), I construct the CollectionView: GroupDescription group = new PropertyGroupDescription("FullName", new FirstLetterConverter(true, true)); m_view.GroupDescriptions.Add(group); Then, whenever the relevant dependency property (the one that

Deployment schema problem

血红的双手。 提交于 2020-01-15 05:47:06
问题 I have changed my app name and namespaces as well from FooXXX to FooYYY. VS applied changes to all files. I've checked all namespaces, names etc, project compiles but when I want to deploy it to emulator or to a device it crashes straight away. No warring, no message, no exception. Only spash screen is shown and then OS gets back to start screen. I made a copy of this solution and I've changed all names, namspaces again and now app compiles and deploys, but I have two messages: Message 2

How to get dates/appointments from app into windows phone calender?

丶灬走出姿态 提交于 2020-01-15 05:41:15
问题 I'm building an app that receives data about events (meetings etc.), and my task is to give the user the possibility for adding them (or some of them) to his device calendar. Since there is no way in the windows phone API for write access to the user's calendar, how would you guys solve such a problem? Is there any recommended way to offer a file, data set or whatever to the user which he can store/add easily? 回答1: You could create a web service that outputs iCalendar (.ics) files and open

Unit Testing Logs in WP7 application testing

China☆狼群 提交于 2020-01-15 04:01:06
问题 I m using Silverlight Unit Test framework for testing my application. The unit testing framework gets executed successfully and displays the result in the phone application page. I would like to get the results stored in a log file inside the device itself instead of displaying it on the phone application page on the device. Please find the image below which shows the results displayed for an application http://www.jeff.wilcox.name/wp-content/uploads/2010/03