windows-phone-7

Easy way to excecute method after a given delay?

放肆的年华 提交于 2020-01-11 19:56:26
问题 Is there a easy way to perform a method after a given delay like in iOS out of the box? On iPhone I would do this: [self performSelector:@selector(connectSensor) withObject:nil afterDelay:2.5]; It will then schedule the method connectSensor on the main thread (UI thread) to be executed after 2,5 seconds. And because it is automatically scheduled on the main thread, you don't have to worry about cross thread issues. (There is also a performSelectorOnBackground version) So how would I do this

Easy way to excecute method after a given delay?

瘦欲@ 提交于 2020-01-11 19:55:34
问题 Is there a easy way to perform a method after a given delay like in iOS out of the box? On iPhone I would do this: [self performSelector:@selector(connectSensor) withObject:nil afterDelay:2.5]; It will then schedule the method connectSensor on the main thread (UI thread) to be executed after 2,5 seconds. And because it is automatically scheduled on the main thread, you don't have to worry about cross thread issues. (There is also a performSelectorOnBackground version) So how would I do this

Tutorial for learning xaml for windows phone 7

拈花ヽ惹草 提交于 2020-01-11 19:50:25
问题 I want to develop mobile applications for the WINDOWS PHONE 7 using silverlight. Can anybody suggest me suitable tutorial please. Thanks in advance. 回答1: Well you should probably start at MSDN on the Phone Platform section. Then I would recommend you go and download the Windows Phone 7 Developer Training Kit which contains some introductory tutorials on getting started with WP7 and building your first app. From there you can check out a couple of different things like the following: This

Adjusting image brightness

别说谁变了你拦得住时间么 提交于 2020-01-11 11:42:49
问题 For windows phone app, when I am adjusting brightness by slider it works fine when I move it to right. But when I go back to previous position, instead of image darkening, it goes brighter and brighter. Here is my code based on pixel manipulation. private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { wrBmp = new WriteableBitmap(Image1, null); for (int i = 0; i < wrBmp.Pixels.Count(); i++) { int pixel = wrBmp.Pixels[i]; int B = (int)(pixel & 0xFF); pixel

Adjusting image brightness

浪子不回头ぞ 提交于 2020-01-11 11:42:23
问题 For windows phone app, when I am adjusting brightness by slider it works fine when I move it to right. But when I go back to previous position, instead of image darkening, it goes brighter and brighter. Here is my code based on pixel manipulation. private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { wrBmp = new WriteableBitmap(Image1, null); for (int i = 0; i < wrBmp.Pixels.Count(); i++) { int pixel = wrBmp.Pixels[i]; int B = (int)(pixel & 0xFF); pixel

Adjusting image brightness

时光毁灭记忆、已成空白 提交于 2020-01-11 11:42:14
问题 For windows phone app, when I am adjusting brightness by slider it works fine when I move it to right. But when I go back to previous position, instead of image darkening, it goes brighter and brighter. Here is my code based on pixel manipulation. private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { wrBmp = new WriteableBitmap(Image1, null); for (int i = 0; i < wrBmp.Pixels.Count(); i++) { int pixel = wrBmp.Pixels[i]; int B = (int)(pixel & 0xFF); pixel

Access list of installed apps

眉间皱痕 提交于 2020-01-11 10:35:08
问题 I need to get the installed apps of a Windows Phone. Do you know if this is available from the SDK? 回答1: It's possible to list third party applications installed on the phone, but only from your desktop machine (ie. not from an app running on the device) and thus might not be what you are after. Firstly, you need to add a reference to this assembly: c:\Program Files (x86)\Common Files\microsoft shared\Phone Tools\CoreCon\10.0\Bin\Microsoft.Smartdevice.Connectivity.dll Then the following code

Silverlight Background Thread using WebClient

徘徊边缘 提交于 2020-01-11 07:57:18
问题 I'm using a WebClient to get infos asynchronously from my web service : wc.DownloadStringCompleted += DownloadStringCompleted; wc.DownloadStringAsync(service); I works fine, but I think the DownloadStringCompleted method is working on the UI Thread, and since i'm doing a lot of parsing there, my page takes a few seconds to appear. However, since I have so fixed data and a progress bar, I would'nt mind have it appearing instantly. How could I perfom this ? Thanks ! 回答1: Use HttpWebRequest

How to change start page at startup?

狂风中的少年 提交于 2020-01-11 06:41:48
问题 my application, currently, goes to the MainPage.xaml at startup (I don't know where it has configured though). I want to be able to start with another page in some conditions. I think I can add this code to Application_Launching() in App.xaml.cs page: NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.Relative)); but NavigationService is not available in App.xaml.cs. How can I start the application with another page if foo == true ? 回答1: Changing start page in App.Xaml.cs :

Opening a PDF file in Windows Phone

旧街凉风 提交于 2020-01-11 06:34:56
问题 I'm developing an app for Windows Phone 7 and I'm using a Phonegap template for it. Everything looks perfect, but now I’m stuck trying to open a PDF file in the browser. I tried the following but that doesn’t work because the url of the PDF exceeds the 2048 character limit (it’s a data url). This code runs after the deviceReady event was fired. var ref = window.open('http://www.google.com', '_blank', 'location=no'); ref.addEventListener('loadstart', function () { alert(event.url); }); Now, I