Skip to end of metadata
Go to start of metadata

The following sections will guide you through the process of building Windows Phone apps with Crosslight, particularly focusing on the data binding, MVVM pattern, and discussing the key features available in Crosslight for Windows Phone.

Understanding Crosslight Windows Phone Apps Building Block 

The easiest way to get started with a new Crosslight Windows Phone project is through the Crosslight Project Wizard which automatically adds the references and add the necessary building blocks to the project. For more information, see Using Intersoft Crosslight Project Wizard.

The components of a typical Crosslight Windows Phone project can be seen in the following illustration.


On this page:

One thing that you must remember, your Windows Phone app should have an application initializer implementation which typically contained in the AppInitializer.cs file under the Infrastructure folder. The application initializer class should implement the IApplicationInitializer Interface which is automatically discovered by Crosslight at runtime.

The AppInitializer class provides methods that connect the apps to the core services in the shared application layer and prepares the necessary configuration for your apps during startup. It looks like the following sample.

The most ideal place to initialize application-related configuration is in the InitializeApplication method, for instance, setting up the IoC container and other required registration. The other two methods are suitable for registering and initializing custom components and additional services required in the apps

Right now, your Windows Phone project should be ready, now you can start adding specific functionalities to your app.

Handling Rotation

In windows phone, when user rotate the phone it will change its orientation to landscape or portrait. For make it work just set SupportedOrientations property to PortaitOrLandscape like this code below 

Cuztomize Header or Footer Content

In Intersoft Form builder you can customize Header or Footer template. Below is example for using it to set header template, the same thing can be applied for footer also.

Use Command Binding in Application Bar Button

Normally in Windows Phone application bar button, you can only attach event handler, but with Intersoft’s BindingBehaviour you can use Command binding and Command parameter for Application Bar. The thing to remember is to set TextKey property with same value as Text property in ApplicationBarIconButton. The following code will help you to understand how to use it.

UpdateSource on Property Changed

Windows Phone will UpdateSource on lost focus, but if you want UpdateSource on Property Changed. Here’s how you do it.

 Code behind :