windows-phone-7

Navigate to another page when orientation changed

孤者浪人 提交于 2020-01-21 12:34:52
问题 I will explain what I'm trying to do on following instance: I have two pages - MainPage.xaml (orientation Portrait) and LandscapeLeft.xaml (orientation LandscapeLeft). I want to navigate from MainPage.xaml to LandscapeLeft.xaml when user rotate phone on Lanscape position. I've done as follows: XAML: SupportedOrientations="PortraitOrLandscape" Orientation="Portrait" code behind: protected override void OnOrientationChanged(OrientationChangedEventArgs e) { switch (e.Orientation) { case

How to reuse BackgroundAudioPlayer after Close method called

可紊 提交于 2020-01-21 09:50:20
问题 I’m using MediaElement for playing videos and BackgroundAudioPlayer for playing audio. Here is a case. I’m playing remote audio via BackgroundAudioPlayer. Then I want to play video and before MediaElement begins playing video I’m calling BackgroundAudioPlayer.Close as suggested in BackgroundAudioPlayer best practices. MediaElement and the BackgroundAudioPlayer Care must be taken when mixing BackgroundAudioPlayer and MediaElement for audio playback. 1. Close() must be called before switching

WP7 ScrollViewer Bug When Content Height > 2000px

纵然是瞬间 提交于 2020-01-21 08:57:45
问题 In my project, I use ScrollViewer to show some long height infomation. I use like this: <Grid Grid.Row="1" Height="630"> <ScrollViewer Background="Red" Grid.Row="1"> <Grid> <Rectangle Height="3000" Fill="LightBlue" Width="440"/> </Grid> </ScrollViewer> </Grid> But,unfortunately, the rectagnle don't show completely when scrollView bar's vertical height > 2000. I have tested without Grid as ScrollViewer's content, only with Rectangle, the result is the same. And the bug is also happens with

Finding the exact position of a graphical object in relation to some other Canvas

余生颓废 提交于 2020-01-17 04:49:08
问题 I have a ListBox, and when I select an item in that ListBox I want to duplicate the image and place it on the Canvas containing all the other objects in my app. This works fine for the most part, however if the item in the ListBox is further in, such that I have to scroll to see the item, the coordinates are no longer accurate. Is there a function such as Canvas.getGlobalPosition(UIElement), which would allow me to then set Canvas.SetTop(uiElement, globalCoordinateSpace.Y) and allow me to

multi language feature support windows phone 7

旧巷老猫 提交于 2020-01-17 02:58:13
问题 I just wonder if we could take advantage of multiple language support in windows phone 7, 7.5 in any mean to enhance user's experience. For example says that how I can detect what language user use on the phone (this appear in start up setting) to auto change my app language. Or perhaps, what is a best way to provide user with multiple language support? 回答1: You can do this with Resource Files http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff637520(v=vs.105).aspx There is some

How to trigger datatemplate selector in Windows Phone?

冷暖自知 提交于 2020-01-17 02:22:27
问题 I have a property and depending upon it's state (say A and B) I either show a usercontrol of animation or a image. Now, if the property changes, I want to trigger the datatemplate selector again. On searching, I found that in WPF I could have used DataTemplate.Trigger but it's not available in WP. So, my question is Is their a way to trigger datatemplate selector so when property changes from state A to B, then appropriate usercontrol gets selected. If yes, then please give some example how

Why Launch Page can not be fired up when reminder is displayed

雨燕双飞 提交于 2020-01-17 01:20:10
问题 I used the sample code below for testing. I could not figure out what went wrong. Appreciate if you can point out what I need to do on setting up or using Reminder. 1) ShowParams.xaml is setup 2) Below is the code to add reminder: Uri navigationUri = new Uri("/ShowParams.xaml" + queryString, UriKind.Relative); Reminder reminder = new Reminder(name); reminder.Title = titleTextBox.Text; reminder.Content = contentTextBox.Text; reminder.BeginTime = beginTime; reminder.ExpirationTime =

Loading an .ico from web and convert to BitmapSource

有些话、适合烂在心里 提交于 2020-01-16 19:36:33
问题 Im trying to load a file of type .ICO from web and use it as an image in my windows phone. But I get an error when trying to set the source of the BitmapImage. Here is my code: WebClient client = new WebClient(); client.OpenReadCompleted += (s, e) => { if (e.Cancelled) return; if (null != e.Error) throw e.Error; BitmapImage image = new BitmapImage(); image.SetSource(e.Result); this.Favicon = image; }; client.OpenReadAsync(new Uri(@"http://mysite/myimage.ico", UriKind.RelativeOrAbsolute));

which language set for NeutralResourcesLanguageAttribute?

∥☆過路亽.° 提交于 2020-01-16 19:30:13
问题 i am developing arabic and urdu app(in same application) so which language i set for NeutralResourcesLanguageAttribute(in assemble info page). 回答1: A Visual Studio project will generally have: Neutral resource files (e.g. MyResources.resx) that are compiled into the main assembly ( MyAssembly.dll ) Culture-specific resource files (e.g. MyResources.de-DE.resx) that are compiled into a satellite assembly in a culture-specific subfolder (e.g. de-DE/MyAssembly.Resources.dll ). You should set

Add php web service on windows phone 7 application

冷暖自知 提交于 2020-01-16 12:04:18
问题 I am beginner in windows phone 7. today I create one application in windows phone 7. and develop hello world app. Now I want to start with my main app. And I added a PHP web service reference. But it show me below error to me. The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'http://mydomain.com/webservices/getLogin.php'. The content type text/html of the response message does not match the content type of the binding