Using WP7 Toolkit Controls in Windows Phone 7.1 Mango
published on: 6/9/2011 | Views: N/A | Tags: Mango WP7Toolkit
by WindowsPhoneGeek
In this article I am going to talk about using the Windows Phone 7 Toolkit controls in a Windows Phone 7.1 Mango application.
NOTE: Previously we covered all WP7 Toolkit controls in 21 In Depth Articles + 3 more additional articles related to the Feb 2011 Update. So you can check them for reference.
If you go to the official WP7 Toolkit Page you will see that the latest available project there is change set 61620 published by Jeff Wilcox on Feb 18. This means that there is no Mango build available i.e. WP7 Toolkit Controls are still build under Windows Phone 7.
How to upgrade Microsoft.Phone.Controls.Toolkit project to Mango
However you can easily make a custom Windows Phone 7.1 build and use these controls in Mango as well. Here are the steps of creating the Mango build:
Step1: Before we begin at first make sure that you have installed the Windows Phone Developer Tools 7.1 Beta(Mango). You can also take a look at our previous post: Switching between Windows Phone 7.1 Mango and 7.0 RTW developer tools and vice versa
Step2: Download and extract WP7 Toolkit:
Step3: Start Phone.Toolkit.sln
Step4: All controls are in Microsoft.Phone.Controls.Toolkit project. By default Microsoft.Phone.Controls.Toolkit project file is read only. To fix this Right click the project in VisualStudio and select Open Folder in Windows Explorer. Find Microsoft.Phone.Controls.Toolkit.csproj right click on it and verify that the file is not Read-Only(The Read-Only CheckBox have to be empty):
Step5: Go to Microsoft.Phone.Controls.Toolkit project, right click and select Properties:
Step6: Go to Application Tab and change the Target Windows Phone Version to 7.1:
Step7: After that press OK to convert the project to Windows Phone 7.1.
Step8: Rebuild Microsoft.Phone.Controls.Toolkit project.
Step9: Go to Bin->Debug folder and you will see the updated Windows Phone 7.1 Mango assemblies there:
Using WP7Toolkit Controls in Mango
We testes all controls basic features. (We can not guarantee that the controls are working in all cases).
Here are the results form our Tests. The following control seem to be working: AutoCompleteBoxm, LongListSelector, ListPicker, WrapPanel, ToggleSwitch, Transitions, TiltEffect, ContextMenu, PerformanceProgressBar.
DatePicker and TimePicker controls are not working properly. As you can see the the next screen shots, the first time when you try to select a Date/Time the text is invisible. Once you touch the control or scroll it the text appears.
Feel free to post in the comments any further issues that you find inconsistent/not working in Mango!
I hope that the post was helpful. You can download the converted Microsoft.Phone.Controls.Toolkit project as well as all assemblies here:
You can also follow us on Twitter @winphonegeek
Comments
Transitions
posted by: MikeS on 6/9/2011 4:54:26 PM
I can't seem to get transitions to work, anyone else have any issues?
Thank you for posting one more great post...
posted by: Toman on 6/9/2011 7:33:55 PM
I just wanted to thank you for posting one more great post...
RE:Transitions
posted by: Jan Libenberg on 6/9/2011 7:38:42 PM
In my app transitions are working as before. I use the XAML approach.
Cannot use WrapPanel, exception in 7.1
posted by: Bill on 7/26/2011 11:01:59 AM
Hi, i'm having a problem with the WrapPanel control in mango (in 7.0 it works just fine). In mango I get this exception:
System.NullReferenceException {"Invalid pointer"}
StackTrace :
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at Microsoft.Phone.Controls.WrapPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight)
and I'm using it like this:
<ItemsControl x:Name="itemsControl" ItemsSource="{Binding Items}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel HorizontalAlignment="Left" Margin="5,5,0,0" Orientation="Horizontal" Height="105">
<Image Source="{Binding ImgThumbObject}" Stretch="None" VerticalAlignment="Center" Width="105" Height="105"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.Template>
<ControlTemplate>
<Grid>
<ScrollViewer Height="600">
<ItemsPresenter Margin="0,0,0,5"/>
</ScrollViewer>
</Grid>
</ControlTemplate>
</ItemsControl.Template>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
any ideas? thanx Bill
Transitions
posted by: anon on 8/25/2011 3:00:17 AM
I also can't get transitions to work.
Invalid pointers
posted by: somewp7dev on 9/22/2011 12:35:27 AM
I keep getting "invalid pointer" on longlistselector. Same code was working fine on the toolkitversion for 7.0. Any ideas?
I tried this and it works
posted by: Robbie on 9/29/2011 12:28:51 AM
http://blogs.msdn.com/b/jonasd/archive/2011/09/28/invalid-pointer-after-upgrade-to-mango-toolkit-wp7.aspx
is good job
posted by: kaki104 on 1/9/2012 3:15:21 PM
thank you this post have a good day
Our Top Articles & Free books
- Our FREE e-book: "Windows Phone Toolkit In Depth" 2nd edition
- 400+ Windows Phone Development articles in our Article Index
- 21 WP7 Toolkit in Depth articles covering all controls
- 12 WP7 Coding4Fun Toolkit in Depth articles covering all controls
- Performance Tips when creating WP7 apps
- Creating a WP7 Custom Control in 7 Steps
- WP7 working with VisualStates: How to make a ToggleSwitch from CheckBox
- What makes a WP7 App successful
- Creating theme friendly UI in WP7 using OpacityMask
- Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector
- All about Splash Screens in WP7 – Creating animated Splash Screen
- Getting Started with Unit Testing in Silverlight for WP7
- WP7 WatermarkedTextBox custom control
Our Top Tips & Samples
- All about WP7 Isolated Storage series
- WP7 Dynamically Generating DataTemplate in code
- 5 tips for a successful WP7 Marketplace submission
- WP7: Navigating to a page in different assembly
- WP7 ContextMenu: answers to popular questions
- WP7 ListBox: answers to popular questions
- WP7 working with Images: Content vs Resource build action
- WP7 Element Binding samples
- WP7 working with XML: reading, filtering and databinding
- Drawing in WP7: #2 Drawing shapes with finger
- WP7 TextBox Light theme problems - the solution
- Changing the WP7 Panorama Background Image dynamically with Animation

