Search Results For : windows phone

Windows Phone 7 – Textbox On Focus Color

Was browsing around Stackoverflow and saw a question that someone asked, (WP7DEV) Textbox background changes when typing

Thought it will be useful for someone who needs it.

Explaination:
By default, a textbox on Windows Phone 7 will look at the one you see in the screenshot on the left, below, but when you were to focus on it, it will turn into slightly white-ish, as seen on the right.

Some of the scenarios for your development do not allow that and requires them to be the same. Written this quick guide in case someone needs it.

1. Attach a GotFocus event handler to the textbox you want to have the effect on.
2. Add this code in the method.

textBox2.Background = (SolidColorBrush)Resources[“PhoneTextBoxBrush”];
textBox2.BorderBrush = (SolidColorBrush)Resources[“PhoneTextBoxBrush”];

*Please remember to change textBox2 to the correct id of the textbox that you want the effect on.

For those of you who are curious where I get the Resources from, you can view a list of the available resources here : http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff769552(v=vs.92).aspx#BKMK_BrushResources

You can download the solution here too:
https://skydrive.live.com/redir?resid=29F099C37B76CA59!2793&authkey=!ACBRpIRyDopM5Lo

Using Toggle Control to disable/enable idle detection – Windows Phone 7

Saw a question on Dream Build Launch on how can one use toggle control to disable / enable idle detection and from there, enable/disable it idle detection accordingly.

I believe he needed it in his setting page. Did up a quick demo.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Resources
1. I used the toggle control from the silverlight toolkit for Windows Phone on codeplex (Can be found here : http://silverlight.codeplex.com/releases/view/75888) for the toggle control.

2. Do read this msdn article for

Things I did
1. Added the toggle controls in the toolkit into Visual Studio (if you have yet to do so)
2. Pull in the toggle controls and attached the checked event handler onto the control.
3. Add the following code (I included the method signature here).

private void toggleSwitch1_Checked(object sender, RoutedEventArgs e)
{

if (toggleSwitch1.IsChecked == true)
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;
else
PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Enabled;
}

You can download the demo file here : https://skydrive.live.com/redir?resid=29F099C37B76CA59!2752&authkey=!AOBimFuXpsh6oog

Comprehensive guide to development resources for Windows Phone

AppHub had just created 22 scenario focused web pages for developers. It provides a comprehensive view of all the resources available for Windows Phone 7 development. I figured that this will be interesting and useful for developers like you and me.

We can see this here, http://create.msdn.com/en-us/education/basics/developer_resources

Silverlight for Windows Phone
XNA Game Studio and XNA Framework
Windows Phone Developer Tools and Device Unlock
User Experience and User Interface
Application and Execution Model
Input, Touch and Gestures
Launchers and Choosers
Security
Frame and Page Navigation
Isolated Storage
Performance
Advertising Services
Camera and Photos
Media – Audio and Video
Push Notifications and Live Tiles
App Bar and Controls
Location and Mapping
Networking and Web Services
Sensors
Globalization and Localization
Porting Your App or Game to Windows Phone 7
Application Publishing and Marketplace

Detecting theme on Windows Phone 7

This blog post is going to teach you how do we detect if we are on dark or light theme on Windows Phone 7. I realised that this will be useful because I have quite some friends who are asking me about it because they didn’t get the right resources online. If you happened to come across a resource that asks you to get from App.xaml, that doesnt work anymore as its removed after the RC build.

Based on Theme Resources for Windows Phone, under Theme Visibility and Opacity.
By checking Resources, I am able to check if its Visible or Collapsed for the dark or White theme by doing this

Visibility isLight = (Visibility)Resources[“PhoneLightThemeVisibility”]; // for light theme
Visibility isDark = (Visibility)Resources[“PhoneDarkThemeVisibility”]; // for dark theme

Then we use if else to check,

if (isLight == System.Windows.Visibility.Visible)
{
//We are on light theme
}

Light Theme

or

if (isDark == System.Windows.Visibility.Visible)
{
//We are on dark theme
}

Dark Theme

Attached is a sample code to show how do I detect Windows Phone 7 theme, before the Mango buuild ( I am unsure if there is a change after Mango ).
Detect Theme on Windows Phone 7 Sample

Interesting fan-made “We Love Windows Phone” video!

Was watching it this morning! Cool. Video done by Brandon Foy! 🙂