windows-phone-7

Keep same layout when orientation changes

我与影子孤独终老i 提交于 2020-01-14 10:44:51
问题 I have a Silverlight page that I would like to have below appearance in portrait and landscape mode. Essentially, there are three images arranged in a grid. The big image spans two columns. When the phone rotates, the images rotate, but the overall layout does not. The small images remain close to the back/windows/search button and the large image remains towards the top of the phone. I have tried a number of methods to achieve this effect, but they have all proved unsatisfactory in one way

WatermarkedTextBox for Windows Phone 7?

ε祈祈猫儿з 提交于 2020-01-14 10:25:49
问题 I am looking for some kind of WatermarkedTextBox for Windows Phone 7? But I need a custom control not how to implement Watermark behavior or how to handle the GotFocus/LostFocus events. 回答1: This has been added to the official Windows Phone 7 Silverlight Toolkit, and as covered here. It's called PhoneTextBox and can be used like: <toolkit:PhoneTextBox Hint="Your Text Hint"/> 回答2: You could try this Watermark TextBox for Silverlight control, or this one. It's a popular control with many

How to remove accent from string in WP7

烈酒焚心 提交于 2020-01-14 09:58:48
问题 I want to remove accent (diacritic) from string in Windows Phone 7. The solution here works for .NET (desktop version). However, WP7 string has no Normalize method. Someone suggest change from string to byte, but I dont know what he means. How to remove accent ? 回答1: I use this: public static string RemoveAccents(this string accentedStr) { byte[] tempBytes = Encoding.GetEncoding("ISO-8859-8").GetBytes(accentedStr); return Encoding.UTF8.GetString(tempBytes, 0, tempBytes.Length); } Edit: this

How do we set background image of TextBlock in Windows Phone?

我与影子孤独终老i 提交于 2020-01-14 09:46:06
问题 I am facing problem in setting the background of textblock in Windows Phone. <TextBlock Text="Forget Password" Height="19" Width="156"> 回答1: You can try this: <Grid> <Grid.Background> <ImageBrush ImageSource="MyImage.jpg" /> </Grid.Background> <TextBlock Text="Forget Password" /> </Grid> 回答2: The TextBlock element cannot display a background image. You can display an image behind your TextBlock as follows: <Grid> <Image Source="..."/> <TextBlock Text="Forget Password" Height="19" Width="156">

How do I hook the hardware search button on WP7

假装没事ソ 提交于 2020-01-14 07:59:07
问题 I have a WP7 app that has a search page. I would prefer to hook the hardware search button rather than having to add search icons to the menu bar. Has anyone figured out how to do this? 回答1: The hardware search button is not available for third-party applications in the current release. (Please refer this thread for a similar question already answered) 来源: https://stackoverflow.com/questions/3952256/how-do-i-hook-the-hardware-search-button-on-wp7

“Unable to determine application identity of the caller” for ViewModelLocator

馋奶兔 提交于 2020-01-14 06:42:52
问题 In app.xaml, i have an error while defining ViewModelLocator. App launches and runs fine, but it annoys me in Studio. Wondering, what can be a reason. Highlighted line is <vm:ViewModelLocator x:Key="ViewModelLocator" d:IsDataSource="True"/> Error: Error 1 Unable to determine application identity of the caller. If to get inside of vm:ViewModelLocator, there's no sign of errors there. Should i re-check all my viewmodels and add IsoStorage designtime protection? if (!System.ComponentModel

“Unable to determine application identity of the caller” for ViewModelLocator

和自甴很熟 提交于 2020-01-14 06:42:11
问题 In app.xaml, i have an error while defining ViewModelLocator. App launches and runs fine, but it annoys me in Studio. Wondering, what can be a reason. Highlighted line is <vm:ViewModelLocator x:Key="ViewModelLocator" d:IsDataSource="True"/> Error: Error 1 Unable to determine application identity of the caller. If to get inside of vm:ViewModelLocator, there's no sign of errors there. Should i re-check all my viewmodels and add IsoStorage designtime protection? if (!System.ComponentModel

Bring back mobile version of website in WebBrowser control for wp7?

限于喜欢 提交于 2020-01-14 06:20:32
问题 Is it possible to bring back web pages in a mobile format, if available, before showing the normal rendering of a web page? I noticed I was getting both when I used it. Or is this enabled by default? EDIT: For example in ie on the phone you can request to recieve webpages in a mobile version or desktop version. Is this option available to developers and if not what is the default for the control? 回答1: Sadly, there's no API for toggling this setting - and no easy way to intercept the outgoing

get form proterty `cannot explicitly call operator or accessor`

让人想犯罪 __ 提交于 2020-01-14 05:28:06
问题 I'm makeing a small app for wp7, and I'm haveing an error when I try to get from a reference. The code in something like this: private void refreshExistingShellTile() { using (IEnumerator<ShellTile> enumerator = ShellTile.get_ActiveTiles().GetEnumerator()) { while (enumerator.MoveNext()) { ShellTile current = enumerator.get_Current(); if (null != current.get_NavigationUri() && !current.get_NavigationUri().ToString().Equals("/")) { Black_n_Gold.Entities.Tile tile = App.CurrentApp.tileService

How do I choose files from the local filesystem in Windows Phone 7

血红的双手。 提交于 2020-01-14 04:44:09
问题 I'm trying to choose some files to upload in Windows Phone 7 (in the emulator), and any attempt to ShowDialog of the OpenFileDialog leads to a Security Exception. The open file dialog is being called from an event on a button click but I get a SecurityException [FileDialog_ActiveScripting] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=3.0.40806