Most of the source code I’m sharing with you can’t fit in the same line so i think i need to widen the main column by at least 30%..
Wohooo… more work to do! 😀
edit: Done, but i need more spaaaace 😀 too bad the max blog width is 1000px, i need 24 more 😀
There is only one way to close the SIP (Soft Input Panel) by default in Windows Phone 7, and it is by changing focus from the TextBox that is being edited to something else on the screen. As an android user, I am used to close it by hitting the enter key once the text editing is done so I’m gonna show you how to do it and hope it will become a practice.
What we need to do here is change the focus to something other than the TextBox we are currently editing, and for that purpose the PhoneApplicationPage that contains this TextBox will do just fine. All we have to do first is make this page a TabStop so we can enable it to recieve the focus.
Next thing to do is add the KeyUp event handler to the TextBox and implement it.
private void TextBox_KeyUp(object sender, KeyEventArgs e)
if (e.Key == Key.Enter)
And that’s it! The SIP is now closed when Enter key is typed in!
Hope you find it useful..
Every Windows Phone 7 application needs to support both dark and light themes, so it is sometimes needed to change the image displayed depending on the current phone theme. At the moment, there is only one way to find out the theme that is currently being used and it is achieved by examining the PhoneLightThemeVisibility resource. Its not the most clever way to go, but its all we have for now.
Visibility v = (Visibility)Resources[“PhoneLightThemeVisibility”];
String url = v==Visibility.Visible?
“/MYAPP;component/Icons/Light/checkWithCircle.png” : “/MYAPP;component/Icons/Dark/checkWithCircle.png”;
Uri imgURI = new Uri(url, UriKind.Relative);
UniversalImage.Source = new BitmapImage(imgURI);
Hope it helps!
P.S. if you are trying to access Resources from something other that UIElement (e.g. from the ViewModel class), you could use Application.Current.Resources to get the PhoneLightThemeVisibility resource.