windows-phone-7.1

WP7 dragging a pushpin on a map

大城市里の小女人 提交于 2019-12-20 05:48:06
问题 Does anyone have any insight into how to implement a draggable pushpin on a map on a WP7 client running Mango? I have a pushpin bound to a geo-location on a map and I want the user to be able to drag it on a map and record its new location. I've seen some resources, but they're for non-WP7 Bing Maps control. Any help would be appreciated. Thanks! 回答1: e.GetPosition(element) gives the position relative to the element passed on the parameter. Also, the point to convert using

Windows Phone Image Binding

扶醉桌前 提交于 2019-12-20 04:58:16
问题 I want to put images in my ListBox using Binding. Below is the object containing the URI's: _roomView.Room = new Room { Items = new List<Item> { new Item {ItemType = ItemType.BlueKey, ImageUri = "/Escape;component/Images/Items/a.jpg"}, new Item {ItemType = ItemType.Bracelet, ImageUri = "/Escape;component/Images/Items/b.png"}, new Item {ItemType = ItemType.Money, ImageUri = "/Escape;component/Images/Items/b.png"}} }; DataContext = _roomView; Below is the XML: <ListBox x:Name="Mylist"> <ListBox

Change custom color for Rectangle.Fill or Grid.Background

吃可爱长大的小学妹 提交于 2019-12-20 03:17:22
问题 i can change custom color Rectangle with something like : "#A125AA" in xaml. But i don't know where to find code change custom color i have i just know code for color arealy have this.gridgcolor.Background = new SolidColorBrush(Colors.Blue); 回答1: you can set the color through RGB. This isn't done in hex like you're doing in your xaml. Color color = new Color() { R = 255, G = 255, B = 255 }; Brush brush= new SolidColorBrush(color); the hex values you have in your example #A125AA are also RGB R

Making UI Thread wait using Thread.sleep

吃可爱长大的小学妹 提交于 2019-12-20 03:09:28
问题 I have written this code in C# for WP7 : public void btn_handler(object sender, EventArgs args) { Button btn_Pressed = (Button)sender; ImageBrush br = new ImageBrush(); br.ImageSource = new BitmapImage(new Uri("/images/cat.png" , UriKind.Relative)); btn_Pressed.Background = br; Thread.Sleep(5000); SolidColorBrush sBrush = new SolidColorBrush(); sBrush.Color = System.Windows.Media.Colors.White; btn_Pressed.Background = sBrush; } Whenever the user clicks the button, I want the background of the

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

Change focused textbox background/foreground in WP7

落爺英雄遲暮 提交于 2019-12-20 02:01:25
问题 Whenever the textbox is focused, the border and foreground of the text is changed according to the current theme: theme light ->border:black, text:white, background:transparent theme dark ->border:white, text:white, background:white I want the textbox always have border:white, text:white, background:transparent I can control these settings when the textbox is not focused, but I cannot change background when it has focus. The XML of the textbox is: <TextBox InputScope="EmailSmtpAddress" Height

How to Use BinaryFormatter in windows phone 7

前提是你 提交于 2019-12-19 19:51:45
问题 How can I use BinaryFormatter in Windows Phone 7. I use this using System.Runtime.Serialization.Formatters.Binary in service1.svc.cs but I can't use this Reference in windows phone 7. Is there any solution to this? My Code For DeserializeObject public static T DeserializeObject<T>(byte[] xml) { BinaryFormatter xs = new BinaryFormatter(); MemoryStream memoryStream = new MemoryStream(xml); return (T)xs.Deserialize(memoryStream); } BinaryFormatter gives error in windows phone 7. So how can I

System.Linq.GroupBy Key not binding in silverlight

余生颓废 提交于 2019-12-19 19:45:15
问题 list.ItemsSource=db.Templates.GroupBy(t=>t.CategoryName); in xaml: <DataTemplate> <TextBlock Text="{Binding Key}" /> </DataTemplate> After this code. Don't show any text in TextBlock. I'm changing Text binding like this <DataTemplate> <TextBlock Text="{Binding}" /> </DataTemplate> TextBlock Text shown like this System.Linq.Lookup^2+Grouping[System.String,Model.Template] I'm debugging and checking Key property. this is not null. Why Key don't bind in TextBlock? How to show group title in

Logging out from facebook using facebook c# sdk in WP7

大城市里の小女人 提交于 2019-12-19 11:05:55
问题 I want to implement logout from facebook using facebook C# sdk in my windows phone app My primary question is how do we logout using Facebook C# SDK in WP7 I found this article in search Article link there he is trying to find the logout url using regex, but that did not working in my app when i try that the browser navigated event is going into infinite loop you can share any samples/posts related to facebook logout in windows phone 7. I want logout should happen with out user intervention,

Is there any easy way to downgrade an wp OS 8 app to OS 7.1? [duplicate]

放肆的年华 提交于 2019-12-19 10:25:33
问题 This question already has answers here : How to downgrade a Windows Phone 8 app? (2 answers) Closed 6 years ago . I've created an app for windows phone OS 8 but I'm wanting to support OS 7.1 as well, is there any easy way I'm able to do this? Thanks 回答1: Create a new project for windows phone 7.1 and then import all your files of the application to that project. Make sure you do not import the WMAppManifest.xml file. That file needs to be the actual one from 7.1 project. Now compile the