windows-phone-7

Issue with MVVMLight ViewModelBase public parameterless constructor in inherited base class for WP7 Tombstoning

柔情痞子 提交于 2019-12-31 01:46:10
问题 I am handling tombstoning in Wp7 by dumping my ViewModel into the PhoneApplicationService state (see this link for more info). My ViewModel (VM) inherits from the MVVM Light Toolkit (ViewModelBase) which has a protected parameterless constructor only. This causes the serilization to fail with: "The type 'GalaSoft.MvvmLight.ViewModelBase' cannot be deserialized in partial trust because it does not have a public parameterless constructor." Excuse my ignorance but serialization is new to me - I

Font size and family for a tile's title

百般思念 提交于 2019-12-31 01:01:10
问题 Simple question but I havent found the answer. What is the font name and size that is used for the tile's title (like the title "Internet Explorer" on that tile)? Does anyone know this? 回答1: I believe FontFamily is PhoneFontFamilySemiBold and FontSize is PhoneFontSizeNormal . The code snippet below is from the toolkit's HubTile control where you can pretty much find all the information about the style of the tile. :) <TextBlock x:Name="BackTitleBlock" Grid.Row="1" VerticalAlignment="Bottom"

Detect Scrolling Event of ListBox?

半城伤御伤魂 提交于 2019-12-31 00:57:51
问题 Is there an event fired when a ListBox begins to scroll? I currently have the following code to allow for a seamless drag and dropping from a listbox. <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" Margin="-5" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate > <DataTemplate> <Image ManipulationStarted="ListImage_ManipulationStarted" Tag="{Binding selfReference}" x:Name="ListImage" Margin="2.5" Stretch="Fill" Source="{Binding thumbnailURL}"

HttpClient and HttpGet Support in WP7

心已入冬 提交于 2019-12-30 14:44:45
问题 I am building an app which is already build in Android & other Mobile Platform. Since the App uses REST based Webservices build in JAVA, thus I need to use these Webservice URL. The code uses HttpClient and HttpGet for GET,POST,PUT & DELETE operation in Android . Can anyone guide me where to start with as I am new to this Platform. 回答1: I would recommend using the WebClient class for simple HTTP based communication. Here is the basic format I typically use when making a request to a web

Calling method of Map control with Caliburn Micro and WP7

对着背影说爱祢 提交于 2019-12-30 14:38:43
问题 I have a page (view) in my Windows Phone 7 application that uses the Silverlight Map control. I need to call the SetView method on the control, but I'd like to stick to the MVVM style of keeping functionality in the view model. I plan to call this method after clicking on an application bar button, so I don't have access to the Map via the EventArgs parameter. What's the best way to do this? 回答1: I haven't worked with the map control myself, but here's a couple of ideas off of the top of my

refreshing Value Converter on INotifyPropertyChanged

六月ゝ 毕业季﹏ 提交于 2019-12-30 13:39:30
问题 I know there are some similar topics here but I couldn't get any answer from them. I have to update background of a grid to either an image or a colour in my Windows Phone 7 app. I do this using my value converter , it works fine but I'd have to reload the collection so it updates the colour or image. <Grid Background="{Binding Converter={StaticResource ImageConverter}}" Width="125" Height="125" Margin="6"> The converter receives the object then gets the color and image from it, here is the

Change Background of WP7 Application if Theme is altered

坚强是说给别人听的谎言 提交于 2019-12-30 13:30:01
问题 I need to change the Background Image of my Application if user changes theme from "Light" to "Dark" or vice-vesa in code behind. I hope these should be done in Page Loded event 回答1: @TimDams pointed you to one of the nice ways to detect what-theme-is-now-set, but I didn't notice there any information how to detect a change to the theme during the application runtime. The user could start your app, then bump forward to the menu, change the theme, and get back to your app. While you may think

Windows Phone 7 UserExtendedProperties

故事扮演 提交于 2019-12-30 11:11:35
问题 After being directed here: http://msdn.microsoft.com/en-us/library/microsoft.phone.info.userextendedproperties.getvalue%28v=VS.92%29.aspx I tried the following code on my sideloaded application. All that was written out was the 000001 value. I knew that would be the case in the emulator , but I was hoping to get a real value when it was on my phone. Any ideas? int ANIDLength = 32; int ANIDOffset = 2; string result = string.Empty; object anid; if (UserExtendedProperties.TryGetValue("ANID", out

Image to byte[], Convert and ConvertBack

徘徊边缘 提交于 2019-12-30 11:06:28
问题 I have a service that converts images stored on a website to byte array HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("URLTOIMAGE"); myRequest.Method = "GET"; HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); Bitmap bmp = new Bitmap(myResponse.GetResponseStream()); myResponse.Close(); ms = new MemoryStream(); bmp.Save(ms, ImageFormat.Bmp); This code returns a byte array that I store in a database (SQL Azure). In my Windows Phone application, I try to

Image to byte[], Convert and ConvertBack

一个人想着一个人 提交于 2019-12-30 11:06:18
问题 I have a service that converts images stored on a website to byte array HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("URLTOIMAGE"); myRequest.Method = "GET"; HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse(); Bitmap bmp = new Bitmap(myResponse.GetResponseStream()); myResponse.Close(); ms = new MemoryStream(); bmp.Save(ms, ImageFormat.Bmp); This code returns a byte array that I store in a database (SQL Azure). In my Windows Phone application, I try to