windows-phone-7

How to detect a Pivot item is selected in Windows Phone 7

♀尐吖头ヾ 提交于 2020-01-23 04:37:08
问题 I am implementing the Pivot control in Windows Phone 7. I want to know which Pivot item is selected and active after the user does a swipe gesture. How to detect the swipe gesture event related to Pivot control? Which delegate method should I use ? 回答1: SelectionChanged is the event to wire up to for detecting Pivot item changes. As kP suggests, SelectedIndex/SelectedItem are the properties you can access to see which item is currently selected. Here's an example event handler to show the

How to enable enter button on keyboard on wp7?

走远了吗. 提交于 2020-01-23 01:20:10
问题 I was noticing on certain application for wp7, that they were able to use the enter key on the keyboard to submit, but by default when you hit the enter key it goes to the next line. I was even noticing the enter key is different from the default enter key. How do you submit, and if possible how do you change the way the enter key looks? Any tips, answers or resources would be appreciated. Thanks. 回答1: You need to change the InputScope from "Text" and then capture the enter key on the KeyDown

Windows Phone 7 Hiding the Application Bar

北城余情 提交于 2020-01-22 17:42:48
问题 I would like to be able to press a button to disable the menu bar in my application. If you go menubar.IsVisible = false; it throws a null reference exception. The menu bar is declared in XAML. Anyone know if its possible to hide it on the fly like this? 回答1: You can access this as a static member on ApplicationBar. i.e. ApplicationBar.IsVisible = true/false; Some background here on why ApplicationBar doesn't play like normal silverlight elements. Why are the ApplicationBar objects not

Is it possible to develop Windows Phone 7 apps without a Windows machine?

落花浮王杯 提交于 2020-01-22 10:39:06
问题 I don't have a Windows machine, just a Mac and a Linux box. Windows it pretty expensive, and I don't want to pirate it either. Is it possible to develop Windows Phone 7 apps in Mac OS X or Linux? Is Visual Studio required? 回答1: No. That being said maybe it is possible to run Visual Studio for Windows Phone (which is free) on Linux via Wine but I doubt it. You can do some Silverlight development on Linux and learn some of the XAML and C# concepts and apply them later on Windows Phone but you

How to represent Line Break or new line in silverlight textBox

爷,独闯天下 提交于 2020-01-22 05:18:04
问题 I am having hard time to match Special characters set in Silverlight. I only on the following: To represent a LineBreak in Silverlight TextBlock: use : > lineBreak < But What do I use to represent a New Line or LineBreak In Silverlight TextBox?? Example : I want this one line mag : This is line one. This is line two into this : This is line one. This is line two. it seems this \r\n is not working. This is line one \r\n 回答1: The bottom line at the top <TextBox Text="This is line one! This is

Independent width in a WPF Grid

夙愿已清 提交于 2020-01-22 00:38:46
问题 I have a grid with 2 rows and 2 columns in WPF. I would like that the column widths are independent for each row. I tried "auto", but no success. Here is a picture in order to explain: How can I accomplish this using grid? 回答1: If you must use a grid layout, then you have a couple of options: Option 1: Make each row a single column and then nest a grid in each row you would like independent columns: XAML <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions>

Independent width in a WPF Grid

可紊 提交于 2020-01-22 00:38:11
问题 I have a grid with 2 rows and 2 columns in WPF. I would like that the column widths are independent for each row. I tried "auto", but no success. Here is a picture in order to explain: How can I accomplish this using grid? 回答1: If you must use a grid layout, then you have a couple of options: Option 1: Make each row a single column and then nest a grid in each row you would like independent columns: XAML <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions>

Design advices for quick navigation between view

て烟熏妆下的殇ゞ 提交于 2020-01-22 00:25:29
问题 Usually, when a View requires a lot of bindings, or some UI Elements like a Bing Map, it takes a "while" to load (like between half a second and a second). I don't want a delay between a "tap" action (like tapping an element on a ListBox) and the navigation action (displaying a new page). I don't mind displaying the page progressively. For example, for a Bing Map, I don't mind displaying a black page with only a title, and a second later, having the Map appear. What are the best practices ?

Design advices for quick navigation between view

丶灬走出姿态 提交于 2020-01-22 00:25:06
问题 Usually, when a View requires a lot of bindings, or some UI Elements like a Bing Map, it takes a "while" to load (like between half a second and a second). I don't want a delay between a "tap" action (like tapping an element on a ListBox) and the navigation action (displaying a new page). I don't mind displaying the page progressively. For example, for a Bing Map, I don't mind displaying a black page with only a title, and a second later, having the Map appear. What are the best practices ?

Navigate to another page when orientation changed

微笑、不失礼 提交于 2020-01-21 12:35:08
问题 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