Hey Guys. Hope you liked my previous post for creating a simple Windows Phone 7 navigation application.

So in this post we will learn as how how can we optimize the virtual keyboard on WP7 for various input controls.

Open the solution we created in the previous post for creating a simple Windows Phone 7 navigation application or else you can download the solution here.

  • Now open contact.xaml in Expression Blend and go to the ContentPanel inside LayoutRoot. Now open the properties of ContentPanel and expand the layout properties and then set the VerticalScrollBarVisibility to Auto

 

VerticalScrollBar

VerticalScrollBar

  • Select ContentPanel in the design surface in the centr and then double click the grid contol in the toolbar. This will add a grid inside the ContentPanel. Now right click the grid and select AutoSize –> Fill.

 

VerticalScrollBar

VerticalScrollBar

  •  Now just just drang and drop TextBlocks and TextBoxes as show in the image below:

    TextBoxes & TextBlocks

    TextBoxes & TextBlocks

  • Now come the coolest feature in input controls. It is a property called InputScope. Now select the TextBox for Phone and go to properties –> common properties –> InputScope and set it to TelephoneNumber. Similarly change the testbox properties of other contols to below specified values and you will see the magic when you run the application and all this is done without writing any code.

            First Name textbox: Set InputScope to PersonalGivenName
Last Name textbox: Set InputScope to PersonalSurName
Email textbox: Set InputScope to EmailUserName
            Web Site textbox: Set inputScope to Uri
            Address textbox: Set InputScope to AddressStreet
            City textbox: Set InputScope to AddressCity
            State textbox: Set InputScope to AddressStateOrProvince

InputScope

InputScope

  • Now while setting the input scope you might have seen a large number of options but thats not the full list. The full list of the InputScope instances is below:

    InputScope instances

    InputScope instances

Download the source code by clicking on the button [button link=”http://minus.com/mV0RoTjnG” style=”download” color=”green”]Download Source Code[/button]
Do let me know your feedback on this post. Thanks

[highlight]Create a simple navigation application in Windiows Phone 7 ( WP7 ) [highlight]

In a Windows Phone application it is highly probable that you will have more than one screen in your application and you will need to navigate between them. We can make use of the navigation framework for the same. This navigation will be very similar to navigating from one web page to another. This navigation framework also supports query string.

So without much talk let’s go ahead and create a simple business information application of financial company ACME and learn navigation in WP7.

  • Goto visual studio 2010 and create new Windows Phone Silverlight and XNA Applicationand name it NavigationExample.

    Create Application

    Create Application

  • Add new folder to the NavigationExample named Views and inside Views add a new folder Locations.

    Add Folder

    Add Folder

  •  Now add Windows Phone Portrait Page named About and Contact in the Views folder

  • Similarly add Windows Phone Portrait Page named Corporate Office and Satellite office in the Locations folder.

    Windows Phone Portrait Page

    Windows Phone Portrait Page

  • Now lets open the pages and edit the default text on the pages.
  • Open MainPage.xaml and edit the text to as shown in the image below. Also drag and drop four HypelinkButton onto the MainPage.xaml

    MainScreen.xaml

    MainScreen.xaml

  • Now edit the HyperlinkButtons to point to the proper pages to be navigated. Use the image below to do the same.MainPage.xaml

    MainPage.xaml

    MainPage.xaml

  • Now open about.xaml, contact.xaml, corporateoffice.xaml, satelliteoffice.xaml and edit the headings.
  • Now run the application and you will see the screen as below. You can also navigate to different screens.
Navigation Example

Navigation Example

You can download the full source code here

Please remember to leave your feedback or appreciations or questions. Thanks

 

The skills that you learn in this 1st post will help you throughout the rest of the posts on WP7 Development.

So lets get started.

Before start writing code and understanding WP7 development, lets setup the enviorment for the development. The list of tools and the location from where they can be downloaded is listed below:

Now that you have installed the above softwares, lets see what these tools have to offer.

[highlight]Visual Studio 2010 Express[/highlight]

Visual Studio 2010 Express has its enviorment especially designed for developers. So if you are in the development team then this will be your favourite tool for development in sometime. But if you are a part of designer team this will be secondary tool after expression blend.

[highlight]Expression Blend[highlight]

If you are a designer and have not used Expression Blend before you are going to love this tool as this has got lot of drag and drop design options. Also you can easily create animations, styles, templates, vector graphics, sample data without writing any code. But if have already used Expression Blend, then ido not need to brag about it. 🙂

 [highlight]Windows Phone Emulator[highlight]

Windows Phone emulator will provide us with Virtual machine that emulates the Windows Phone 7 Operating System and will provide a test enviornment that is almost identical to the runtime of the Windows Phone devices.

[highlight]Also Included in download[highlight]

The following items will also be included in the download:

  • Silverlight 4 SDK
  • .NET Framework 4
  • XNA Game Studio 4

If youhave been in the .Net world then i do not need to say anything about the first two items. But let me tell you that XNA Game Studio framework is an alternate library for building WP7 applications but does not support layout controls and event driven inputs for line of business applications but instead uses input and graphics method useful for more complex games. If you want to learn XNA then follow the link below:

wp7trainingcourse_wp7xna_unit

 Below is the list of tutorials on WP7: