Since Microsoft dropped the “7” from Windows Phone at MIX 11, i`m dropping it too 🙂

This roundup is all about MIX and it`s WP Sessions, which i enjoyed watching. So here they are…

All other session from MIX are on Channel9, just click HERE! They are worth watching.
As a little fun special of this blodpost, I recommend the “Developers” Song by Cory Smith featuring Steve Ballmer 😀
Advertisements

This is just another small but helpful tip for Windows Phone 7 developers. Imagine that you want your user to type in some input, that you need to proceed. One can handle the precessing by offering a “confirm”-Button or something like it or you can just react on the Enter-Key of the softkeyboard.which is presented, when a user clicks in a textbox.

So, how is this accomplished? The Textbox-Control does not provide a OnEnter-event, all one can be found is something called KeyDown-event. This event is what we will use for our need.

In the XAML of your appropriate TextBox you can add a method to the KeyDown which will be fired if a key enters the TextBoxControl.

I called mine OnEnter and you can easily check, which key of the softkeyboard was “entered” 🙂

It`s that simple 🙂

I`ve been really busy the last two weeks, so there`s just a new Dev.RoundUp FYI 🙂

WP7 Unleashed Session I – Hands on labs (Daniel N. Egan)

Video Series “Windows Phone 7  Development for Absolute Beginners” (Joey DeVilla)

Windows Phone Push-Notification server side helper library (Windows Teamblog)

Developing TWiT.tv for Windows Phone 7 : From concept to marketplace (Channel9 – Dmitry Lyalin)

Add User Controls (graphics) in background thread (Loek van den Ouweland)

Using LongListSelector-Control (.NET Zone – Den Delimarsky)

MEF for Windows Phone (Damon Payne)

 

So with the new update of the Silverlight tookit for WP7 there came along  a few new controls for us developers to play around! I chose the DatePicker-Control for this blogpost, cause it`s not that easy to implement it correctly in some ways and to give some answers for beginners.

Step-by-Step:

  • First of all, download the toolkit from CodePlex and place it on your harddrive. 🙂
  • Don`t forget to add a reference to Microsoft.Phone.Controls.Toolkit for your WP7-Project.
  • Open up your XAML of the appropriate PhoneApplicationPage in VisualStudio, where you want to implement the DatePicker-Control
  • Add the Namespace to your Page…

  • Using the Control on the page…

  • Now start your project for a first test. After clicking of the control, you you should see the following…

  • You will be presented a page for picking the date, like in the calendar-app, BUT this is no PhoneApplicationPage one hast access to!! I marked the buttons in the ApplicationBar. To fix this issue, so you have a “check” and a “cancel”-icon, you have to add a folder to your project called Toolkit.Content!
  • Now you have to add from your icons the ApplicationBar.Cancel.png and the ApplicationBar.Check.png to the folder.
  • The DatePicker control searches for exact this Folder with these two files!
  • After this, you`re done and it should look like this…

Have fun 🙂

Its been busy weeks since the last Developer Roundup, but nethertheless here are the “new” Links 🙂

 

Unit Converter Starter Kit WP7 (MSDN)

Gesture Service in depth (Windows Phone Geek)

Using Visual Studio to build VB WP7-Applications (VS Team Blog)

Using WCF on WP7 – walkthrough (Andy Pennell)

http://www.yourWindowsphone7.com (New Community and Forum)

Beginners guide SpriteBatch class for XNA & WP7 (EXHD)

How to implement Basic HTTP Authentification in WCF on WP7 (C is for Coder)

 

Here it is, the new WP7 Developer roundup for 11/25/2010! This time I provide more links then ever 🙂

Windows Phone 7 Development Best Practices Wiki

Windows Phone 7 Development for absolute beginners (channel9)

Is my XNA Game dead yet?! (Dark Genesis)

There and back again “A tombstoning Tale” – The returning of an Application (Dark Genesis)

My Photo App – sample project (Jeff Wilcox)

The taming of the phone [new SetterValueBindingHelper] (Delay)

Windows Phone 7 with Expression Blend (Chris Koenig)

Use concurrent programming techniques (Silveright Hack)

Use ShellTileSchedule to easily update your live-tiles (Kevin D. Holes)

How to: Encode a JPEG for Windows Phone and Save to Pictures Library (MSDN)

Windows Phone 7 Line of Business App dev: Network awareness (Rob Tiffany)

As the title suggests, this blog post is all about bulding a UserControl for Silverlight, Windows Phone 7 or WPF development projects. I want to show this with a really simple example, inspiried by Silverlight in Action 4 by Pete Brown!

Open up Visual Studio and choose the class library project template for your target (e.g. SL or WP7)

In the solution explorer, rightclick on your project and add a new item –> <silverlight or WP7,…> user control! Now you see an almost empty xaml-file of your control. For this example we simple build a lockable textbox, so delete the the default grid and add a StackPanel and put a TextBox and a CheckBox in it.

Like in the picture, give your Text- and CheckBox a name. Cause we`re building a “lockable” Textbox, we want to set the IsReadOnly-Property of the TextBox to TRUE, if the user checks the CheckBox. This for example can be accomplished by DependencyProperties and binding in the code-behind or by writing  a simple converter-class, which we will be doing!

Now add a new class to your project and name it IsLockedConverter.cs or any other name you wish :). Cause it`s a converter we have to inherit from the IValueConverter interface, which provides us two methods, Convert() and ConvertBack(). We also have to inherit from the TextBox class, because we want to have access to the IsReadOnly-property of our TextBox.

In the Convert() method we have to return wether the given value is true or false. Just have a look at the implementation.

After this, we only have to add our new converter to our UserControl and using it! The first step is to add the appropriate xmlns in the header of the UserControl, in this case its something like this:

xmlns:converters=”clr-namespace:CustomControls.Converters”

Maybe your namespace is slighly different than mine. The second step is to add our converter to the UserControl.Resources specified by x:Key for “calling” it later on.

<UserControl.Resources>

<converters:IsLockedConverter x:Key=”IsLockedConverter” />

</UserControl.Resources>

You can name your converter whatever you like. So now the interesting part of using our converter. Go to your TextBox declaration in the xaml and add the IsReadOnly-Property and add the following binding:

…IsReadOnly=”{Binding ElementName=myCheckBox, Path=IsChecked, Converter={StaticResource IsLockedConverter}}”

With this line of code you bind the CheckBox to the IsReadOnly-Property of your TextBox. ElementName is the specified name of your Checkbox and the Path is the CheckBoxs property. After the Path you see the “Converter=” there you have to add our converter as a static resource. So whenever the user checks the checkbox this boolean value is passed to our converter and sets the IsReadOnly property of the textbox.

That`s easy isn`t it?! I hope that this is useful for the one or the other.

—UPDATE

You can grab the code here on GitHub…  https://github.com/cordellcp3/Various/tree/master/CustomControls/

Here it is, the third WP7 Developer Roundup which aggregates information of interest to Windows Phone 7 developers. I want to share every good article, link or video which I come across over the week. I was really busy this week so…

Loading quickly on Windows Phone 7 – Twitter example [eng] (identitymine)

Inside Windows Phone #11 Obfustication and Analytics [eng] (channel9)

How to move your line of business apps to phone + cloud [eng] (Bruce Kyle)

More under the hood, but hidden or locked [eng] (xda developers)

At the weekend I spend some time testing aroung with geolocation and coordinates wihtin Windows Phone 7 development  and wrote a Method,  which calculates the distance of two given geocoordinates (Point A –> LatitudeA | LongitudeA and Point B –> LatitudeB | LongitudeB ) in kilometer (km).

It works just fine and  I want to share the code with everyone, so here it is

Grab the code here –> https://gist.github.com/61dc8a65f9fc8fb662e3

Maybe it`s helpful for one or the other.

Here it is, the second WP7 Developer Roundup which aggregates information of interest to Windows Phone 7 developers. I want to share every good article, link or video which I come across over the week…

Improving Windows Phone 7 Application Performance [eng] (David Anson)

Silverlight for Windows Phone Toolkit – Nov 2010 [eng] (CodePlex)

WP7 Serialization Comparison [eng] (Kevon Marshall)

How I made the ‘myChannel9′ wp7 app (source code included) – Part 1 [eng] (Sigurd Snorteland)

Sterling Isolated Storage Database with LINQ for Windows Phone 7 [eng] (CodePlex)

Windows Phone 7 Fundamentals [ger] (Sascha Wolter)