On Windows Phone 7 to get the current control one would use
FocusManager.GetFocusedElement()
Wherea on Winform it is just ActiveControl.
Why use 2 semantics which is a nuisance for portability ? Is there any difference of behavior you can see between the two ? If yes that makes sense, otherwise that doesn't.
...
Here is the code-
private void getImageIDs()
{
Uri serviceUri = new Uri("https://api.sqlazureservices.com/NasaService.svc/MER/Images?missionId=1&$format=raw");
WebClient recDownloader = new WebClient();
recDownloader.Headers["$accountKey"] = "<enter your key>";
recDownloader.He...
In Windows Phone 7 / Silverlight, is the following code safe or is it a race condition?
//Snippet 1
foreach(var item in list)
{
Deployment.Current.Dispatcher.BeginInvoke( () => { foo(item); });
}
Surely (?) this alternative is racy?
//Snippet 2
Deployment.Current.Dispatcher.BeginInvoke( () =>
{
foreach(var item in li...
I am trying to expose an editable Azure Table Storage table. (If it matters: to Win Phone 7 via the OData Client Lib CTP.) On the server side, I have a DataServiceContext : TableServiceContext, IDataServiceUpdateProvider
I can add and delete objects, but when I try to update a resource, SaveChanges() does not appear to "pick up" the val...
Hi there,
Whenever my program is closed via tombstoning, when it is reactivated I would like the application to Navigate back to the start screen.
I would like to do something like this
private void Application_Activated(object sender, ActivatedEventArgs e)
{
NavigationService.Navigate(new Uri("/Start.xaml", UriKind.Relative));
}
but...
I have a ListBox with dates.
Each ListBoxItem (date) have another ListBox with that date's events.
When I select an event it gets highlighted (SelectedIndex/SelectedItem) and I navigate to another Pivot. This works fine.
My problem is that every ListBox has it's own SelectedItem. I want to clear the SelectedItem from each ListBox, but ...
I'm using the TransitioningContentControl to create animations for navigating between pages. I used this blog post as my guide: http://wildermuth.com/2010/07/16/Bring_Back_Page_Transitions_to_the_Windows_Phone_List_Application_Template
I also found this post that does something very similar: http://www.slickthought.net/post/2010/04/26/S...
I need to launch my WP7 application from the phone's browser and pass some arguments. For example, the following url would be a link on an html page. Clicking the link would start my application. iPhone and Android both have these capabilites by the name of 'url schemes'.
appName://my.arguments.here
How can I accomplish this on WP7...
I'm having some difficulty trapping an exception during my testing. I actually disconnect the service so that the endpoint is not available, and I am attempting to modify my application to handle that possibility.
The problem is that no matter where I put try/catch blocks, I can't seem to catch this thing before it gets to unhandled.
...
Back in the good ol' Windows Mobile day (CE based) one good get a rough estimate of battery life using the CE CoreDll.dll. Well sometimes at least depending on your hardware. This was exposed via GetSystemPowerStatusEx.
WP7 being SilverLight based I'm assuming these sorts of Interop approaches will no longer work. Is there an API that e...
Icons have been provided in the SDK for either "Light" or "Dark" depending on the theme set on the phone. On the application bar when the theme changes the icons automatically change with it. Also, when you press the button the image is reversed (so it's still visible) no matter which theme you're on. I can easily figure out how to chang...
In the CE based Windows Mobile you could prevent the screen back-light from timing out using the SetPowerRequirement and ReleasePowerRequirement API's like so:
IntPtr handle = SetPowerRequirement("BKL1:", PowerState.FULL, 1, IntPtr.Zero, 0);
// screen won't timeout while you do stuff in here
ReleasePowerREquirement(handle);
Is a simil...
I'm trying to include a text file that contains some static data that I need to read in when the app starts up. I've added the file and marked the Build Action to "Resource" but I'm unsure of how to actually read it in as a stream. Anyone know how to do this?
...
I have an ObservableCollection, which holds a Person object. I have a search feature in my application, and would like to display the most relevant results at the top. What would be the most efficient way of doing this? My current search method simply calls the contains method:
var results = (from s in userList
where s.N...
Hi!
I'm having problems with horizontal scrolling inside Pivot control in WP7. I have a Grid with ScrollViewer and ten or more buttons inside. Since all buttons don't fit on the screen i need to be able to horizontally scroll. But when i click and drag on buttons the whole Pivot page starts moving and eventually switches to next pivot pa...
Is there any way in Phone7 to rename a file? I don't see anything in IsolatedStorageFile that exposes this functionality but perhaps I'm missing something? It seems like the best way to rename a file is to read its contents and write them to another file and then delete the original.
...
I'm using Expression Blend 4 to prototype a Windows Phone 7 app. I have a page that is supposed to display a news story. I'm having difficulty getting it to scroll down all the way in the emulator. I can only scroll the see some of the text box. Sometimes, when I make the ScrollViewer taller, I can actually scroll less in the emulator.
...
Hi!
How can I get CPU and memory usage statistics in Windows Phone 7?
Well any statistics about particular WP7 device would be helpful.
...
I have the tools installed for windows phone 7 development.
But, when I run the any of the sample apps I have to manually refresh my emulator's app window to see any changes.
Any ideas what I'm doing wrong? Or maybe a setting is wrong?
Thanks
...
This use to work, I can't tell what I broke... but I suspect it is something to do with the WMAAppManifest / Guid...
When I attempt to Deply/Debug to the WP7 Emulator from VS I get the following popup message: "The application could not be launched for debugging. Verify that the application is installed on the target device."
What I ac...