windows-phone

How to pass an object to background project in Windows Phone?

北城以北 提交于 2019-12-20 03:14:53
问题 My problem is that I have an StorageFile object in foreground and want to play it in BackgroundMediaPlayer like this: mediaPlayer.SetFileSource(soundStorageFile); but it is not possible to use SetFileSource() in the foreground, you should call it in the background task, or initialize a third project in the background and call it from there. So how can I pass an object to the background project? (It's a Windows Phone Runtime app) 回答1: Communication between UI and BackgroundMediaPlayer can be

Phonegap +jquery mobile + windows phone: Back button issue

六月ゝ 毕业季﹏ 提交于 2019-12-20 03:11:45
问题 I'm developing an app for windows phone. The app itself is working fine except for the back button (of the device). The back button can navigate back correctly until a certain point where it stops. At this point it shows the AJAX loader. If the back button is pressed again, the app closes. The structure of my app is as follows (I'm using a multi-page structure): App loads -> user has to pick language -> main screen with buttons to other pages At the main screen the user can navigate further

GPS to calculate distance between two points on windows phone 7

感情迁移 提交于 2019-12-20 02:34:50
问题 i am using GPS to calculate distance between two points i.e. i am using windows phone as a tape measure but when i start i dont get the correct value infact even if i am standing still it gives me hundreds of meter here is my code myWatcher.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(myWatcher_StatusChanged); myWatcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(myWatcher_PositionChanged); myWatcher.MovementThreshold = 1; void

Specify Popup location, throughout page navigation

痴心易碎 提交于 2019-12-20 02:32:58
问题 Hello I have an issue with positioning a popup, in a WP8 app. My code is that I have instantiated a popup, where the child is a usercontrol, like: Popup CenterPopup = new Popup(); LayoutRoot.Children.Add(CenterPopup); CenterPopup = new UsercontrolElement(); This code would make my UsercontrolElement appear precisely in the middle, as it looks in the design view for the xaml code. The problem is that my UsercontrolElement is a waiting screen that I want to be visible during a page navigation

How to set different HorizontalAlignment to ListBoxItems

风格不统一 提交于 2019-12-20 02:13:35
问题 I posted a question yesterday but I think I failed to explain it correctly. Let me try again. So this is my goal: The red speech bubble represents an incoming message, and the blue bubble an outgoing message. I can describe this more precisely with the following xaml code. Note that the following code is only an explanation of what I expect to get when my actual xaml code (with some DataTemplates) compiles (WPF will populates the data automatically for me, using the DataTemplates). : <ListBox

Error DEP0001 : Unexpected Error: -2147009287 deploy Windows Phone Universal 10

↘锁芯ラ 提交于 2019-12-20 02:07:38
问题 When I try to deploy my application to Windows phone 10 I get this error: Error: -2147009287 from visual studio 2015 comunity. How can I solve that? 回答1: As Jay Zuo said in his comments (via a link). The easy way to solve this issue, seems to be to uninstall existing app (which is probably installed from the store) and then try to deploy the app again via Visual Studio. This worked for me. :) 回答2: I had the same problem. I was using a USB cable that was not in an excellent state, so to speak.

How do i add a pushpin to a Windows Phone 8.1 Map Control?

故事扮演 提交于 2019-12-20 00:53:17
问题 I've been looking for examples on how to perform this task however i haven't been able to find a clear one. Can someone please point me in the right direction. I'm lost... Edit/Update: Ive manage to add some markers following the following example: http://www.microsoftvirtualacademy.com/Content/ViewContent.aspx?et=8698&m=8686&ct=29035 However, as MSDN documentation states , The MapIcon is not guaranteed to be shown. It may be hidden when it obscures other elements or labels on the map. The

Windows Phone 8.1 check if password set else load new page

女生的网名这么多〃 提交于 2019-12-19 18:23:51
问题 I Have a very similar situation to this guys question in that I have a Login Page which is my MainPage.xaml file but I have another page called SetPassword.xaml that I want to load if a user has not set a password yet. Essentially this is the first time that the App loads after it has been installed. I've spent hours on SO trying various different solutions (including the one I linked to) but I'm just not getting anywhere and it seems that many of the solutions are either for WP7 or WP8 and

UIElement to image file (WP7)

孤街醉人 提交于 2019-12-19 17:27:26
问题 I have a StackPanel which includes a few Rectangles that I want put to an image file (e.g. PNG). I'm developing this on Windows Phone 7 and most of the information I found on the internet wasn't applicable (I think) to WP7. I think the System.Windows.Media.Imaging namespace is the key to this, but I'm not sure where to begin. This is basically what I want to do: StackPanel stack = new StackPanel(); List<Rectangle> recList = new List<Rectangle>(); add some rectangles to recList foreach(var x

ERROR: System.Environment.SpecialFolder' does not contain a definition for 'CommonApplicationData'

笑着哭i 提交于 2019-12-19 11:57:19
问题 I have the code to save a file in a folder in directory string timestamp = DateTime.Now.ToString("MM-dd-yyyy.HH-mm-ss"); var file = File.Create("Owe-Data.txt" + timestamp); var com = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase + timestamp + @"\Data" + file; MessageBox.Show(com); if (!Directory.Exists(com)) { Directory.CreateDirectory(com); } using (var sw = new StreamWriter(com)) { sw.WriteLine(InputData); } } i Displayed COM it gives path bt i cant see the Data