November 2011 Blog Posts

Create an SMS Task Using the Contact’s Name in Windows Phone

You can use the SmsComposeTask to create an SMS with Windows Phone. As the code below shows, it is very easy to do. 1: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> 2: <Button Content="Number Only" Height="72" HorizontalAlignment="Left" Margin="12,6,0,0" Name="btnNumberOnly" VerticalAlignment="Top" Click="btnNumberOnly_Click" /> 3: <Button Content="Name Only" Height="72" HorizontalAlignment="Left" Margin="12,84,0,0" Name="btnNameOnly" VerticalAlignment="Top" Click="btnNameOnly_Click" /> 4: <Button Content="Name and Number - Contact" Height="72" HorizontalAlignment="Left" Margin="12,162,0,0" Name="btnNameAndNumber" VerticalAlignment="Top" Click="btnNameAndNumber_Click" /> 5: <Button Content="Name and Number - No Contact" Height="72" HorizontalAlignment="Left"...

posted @ Thursday, November 24, 2011 9:00 AM | Feedback (0)

Querying Contacts After Converting to WP7 Mango

If you are working in an application that has been converted from WP7 to WP7.1 (Mango) and are trying to query the contacts like the code below you might get a helpless exception of type System.Exception with the message “Exception”, no InnerException and a StackTrace similar to: at Microsoft.Phone.UserData.QueryDataEnumerable`1.EnsureInteropInit() at Microsoft.Phone.UserData.QueryDataEnumerable`1.GetNextBatch(Int32 nextIndex) at Microsoft.Phone.UserData.QueryDataEnumerator`1.MoveNext() at Microsoft.Phone.UserData.Contacts.GetContacts(Object state) at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ...

posted @ Wednesday, November 23, 2011 9:03 AM | Feedback (1)

Debugging Tombstoning with WP7 (Mango)

A new feature of Mango (WP 7.5) is fast app switching, a much needed feature, which every developer should implement in their apps. Before mango, every time the application was deactivated the developer had to maintain state and restore it once the application was re activated. That resulted in very slow transitions between apps and a bad user experience. With fast app switching and the WP 7.1 SDK, the phone maintains all state of the app when it is deactivated and when the user activates it again the app starts right away. It is a much better user experience! Windows...

posted @ Friday, November 18, 2011 11:44 AM | Feedback (1)