Tilt effect for Windows Phone controls


An enjoyable feature found in Windows Phone is a neat interactive effect that our designers have dubbed “tilt”. Tilt gives a little motion to standard controls during manipulations (when they’re being touched).



Related Links:


Passing WCF Exception to Silverlight

Since it is not possible to catch regular exception from a WCF service in a silverlight application, there is another way to do it by using BehaviorExtensionElement.

1. On Server-side First create a behavior like this:

public class MyFaultBehavior : BehaviorExtensionElement, IEndpointBehavior
        public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
            SilverlightFaultMessageInspector inspector = new SilverlightFaultMessageInspector();
        public class SilverlightFaultMessageInspector : IDispatchMessageInspector
            public void BeforeSendReply(ref Message reply, object correlationState)
                if (reply.IsFault)
                    HttpResponseMessageProperty property = new HttpResponseMessageProperty();

                    // Here the response code is changed to 200.
                    property.StatusCode = System.Net.HttpStatusCode.OK;
                    reply.Properties[HttpResponseMessageProperty.Name] = property;
            public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
                // Do nothing to the incoming message.
                return null;
        // The following methods are stubs and not relevant.
        public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
        public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        public void Validate(ServiceEndpoint endpoint)
        public override System.Type BehaviorType
            get { return typeof(MyFaultBehavior); }
        protected override object CreateBehavior()
            return new MyFaultBehavior();

2. On Server-side Modify you web.config:

		<!--Add a behavior extension within the service model-->
				<add name="myFault" type="SilverlightWCF.Web.MyFaultBehavior, SilverlightWCF.Web, Version=, Culture=neutral, PublicKeyToken=null"/>
			<!--Add a endpointBehavior below the behaviors-->
				<behavior name="myFaultBehavior">
				<behavior name="SilverlightWCF.Web.MyCoolServiceBehavior">
					<serviceMetadata httpGetEnabled="true"/>
					<!--For debugging, it might be cool to have some more error information.
       to get this, set includeExceptionDetailInFaults to true-->
					<serviceDebug includeExceptionDetailInFaults="true"/>
		<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
			<service behaviorConfiguration="SilverlightWCF.Web.MyCoolServiceBehavior" name="SilverlightWCF.Web.MyCoolService">
				<!--Set the behaviorConfiguration of the endpoint-->
				<endpoint address="" binding="customBinding" bindingConfiguration="customBinding0" contract="SilverlightWCF.Web.MyCoolService" behaviorConfiguration="myFaultBehavior"/>
				<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>

3. On Server-side Throw you FaultException

        public void Foo()
            throw new FaultException("this is my Exception");

4. On Client-side Catch the Exception like this:

        void serviceClient_FooCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
            if (e.Error == null)
                // In case of success
            else if (e.Error is FaultException)
                FaultException fault = e.Error as FaultException;
                string text =  e.Error.Message;

via http://www.codeproject.com/KB/silverlight/SilverlightWCFService.aspx

Microsoft Advertising SDK for Windows Phone 7

Ad SDK for developers who want to monetize their WP7 applications via advertising.

There are developers who want to sell their apps, some who want them to be free, and even more still who will want to put ads inside of their apps. The Mobile Advertising SDK is available today making is very easy for developers to generate ad revenues from their apps. The team has also released the first real-time, bid-based mobile ad exchange, allowing for revenue maximization of ad placements when they are served. Raj Kapoor has a great post talking about this release.

The SDK allow easy integration of text and banner ads into your application, and consumes ads served by Microsoft’s mobile Ad Exchange, the first bidded ad exchange for mobile.


Windows Phone 7 Developer Tools and Windows Phone 7 Toolkit


Windows Phone 7 Developer Tools

You can download them here.

The following is installed with the download:

  • Visual Studio 2010 Express for Windows Phone – Free edition of VS 2010 for Phone development.
  • Express Blend 4 for Windows Phone – Free version of Blend for Windows Phone 7 Development.
  • Silverlight for Windows Phone 7 – Rich framework for building great applications for Windows Phone 7.
  • XNA Game Studio for Windows Phone 7 Rich framework that enables you to build great 2D and 3D games for Windows Phone 7.
  • Windows Phone Emulator – A hardware accelerated emulator that allows you to run and debug your applications and games without requiring a phone.
  • Phone Registration Tool – When you get a device, this allows you to “unlock” the device so you can run/debug your application on it, using your Marketplace account.

This release adds support for new Panormana and Pivot controls and associated project templates that you can use to create applications.

Windows Phone 7 Toolkit

image image image

You can download here.

It includes the following additional Silverlight controls and components that are customized for the Windows Phone 7 experience:

  • ContextMenu
  • DatePicker
  • TimePicker
  • WrapPanel
  • ToggleSwitch
  • GestureService – adds events for Tap, DoubleTap, Hold, Drag (DragStarted, DragDelta, DragCompleted), Flick and Pinch

You can learn more about using some of the cool controls in the Toolkit from:

Silverlight 4 Theme refresh including RIA Services templates


Download the refreshed Silverlight 4 themes (inlcuding RIA Services templates) here.

At the link above you’ll find 3 files to download:

  • README_FIRST.txt – please read this 🙂 but basically I’m writing the same thing here.
  • SL4Themes-templates.zip – this includes a folder for Expression Blend and Visual Studio templates.  The VS folder also has a sub-folder for the RIA Services templates.
  • SL4Themes-rawassets.zip – this is another (optional) zip that includes the resource dictionaries for each template on their own without any Silverlight project.

Sample preview of themes
New – JetPack Theme: http://www.silverlight.net/content/samples/sl4/themes/jetpack.html
Windows 7 Theme: http://www.silverlight.net/content/samples/sl4/themes/windows7.html
Cosmopolitan Theme: http://www.silverlight.net/content/samples/sl4/themes/cosmopolitan.html
Accent Color Theme: http://www.silverlight.net/content/samples/sl4/themes/accent.html

Via Silverlight 4 Theme refresh including RIA Services templates

Introducing the Microsoft Web Farm Framework


The Microsoft Web Farm Framework is a free product that enables you to easily provision and mange a farm of web servers.  It enables you to automate the installation and configuration of platform components across the server farm, and enables you to automatically synchronize and deploy ASP.NET applications across them.  It also supports integration with load balancers – and enables you to automate updates across your servers so that your site/application is never down or unavailable to customers (it can automatically pull servers one-at-a-time out of the load balancer rotation, update them, and then inject them back into rotation).