Subscribe to Feed

Posts Tagged ‘Xaml

There are several occasions where you want keep the current element in focus and disable application scrolling when user is trying to type in using the onscreen keyboard. It is little bit tricky to achieve this. here is some sample code on how to do this in Xaml/C#

[...]

When you compile your windows phone app, it might build fine but throw an “unspecified error” when you try to deploy your app either onto your phone or to the emulator. The most probable reason that causes this is that there is style incompatibility in your xaml that the parser failed to resolve.
To fix the [...]

On windows Phone, you can easily use templates to change the default UI for most of the controls. In this post, I am giving an example of how to change the color of a scroll bar in a list box. The template I provided here is extensive and can use used to change many things [...]

Accelerometer; Simulating accelerometer data in the Windows Phone 7 Emulator
http://blogs.silverarcade.com/silverlight-games-101/27/silverlight-simulating-accelerometer-data-in-the-windows-phone-7-emulator/

Animation; Ptorr Slides, Video and Code (Page Turn animation etc.)
http://blogs.msdn.com/ptorr/archive/2010/03/18/slides-video-and-code.aspx

Audio; Audio Recording in WP7
http://mobileworld.appamundi.com/blogs/peterfoot/archive/2010/03/26/audio-recording-in-wp7.aspx

Comms; Accessing WCF Data Services from WP7 CTP
http://blogs.msdn.com/priozersk/archive/2010/03/19/accessing-wcf-data-services-from-wp7-ctp.aspx

Comms; Calling Web Services with Silverlight 2 (general example)
http://timheuer.com/blog/archive/2008/03/14/calling-web-services-with-silverlight-2.aspx

DB; Siaqodb on [...]

One of the requirements in publishing media related apps for windows phone is that you have to prompt user a message asking his permission to continue if a media file is already being played in the background.
Here is the actual text from the app requirements
6.5.1 Initial Launch Functionality When the [...]

One weird issue I ran into the other day when trying to write an app for Windows Phone is a Grid control I placed inside a data bound Listbox refused to stretch 100% and is always being defaulted to the “auto” width. I running around all the internet for a day and failing to find [...]

There are several situations where in you might want to change the font style or font color etc. styles to the default phone styles when developing for  Windows Phone. This is very easy and straight forward to achieve in xaml. All you have to do in xaml is set the style property to the static [...]

Text color of a TextBlock control in SilverLight, WPF is defined by the Foreground property. You can set this either in xaml or code behind. To set this value in Code Behind, all you have to do is as follows..
// Using pre defined Colors
myTextBlock.Foreground = new SolidColorBrush(Colors.Red);

// Using colors from ARGB
myTextBlock.Foreground = new SolidColorBrush(Color.FromArgb(255,255,0,0));
 

Note:
[...]

Converter is an IValueConverter type we often use to set styles or templates for a UIElement based on some value. Usually we will end up in a situation where we have to pass-in a value from the data source to the Converter in order to decide on which template to use. IValueConverter type allows to [...]

You can force an application to only show up in either landscape  mode or portrait mode in Windows Phone 7 by setting the SupportedOrientations property either in xaml or in code.
Setting Supported orientations:
XAML (This property is set on PhoneApplicationPage)
SupportedOrientations="PortraitOrLandscape"

Code
this.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
 
You can also change the current orientation of an application by setting the [...]