Coding4Fun Toolkit for WP7 Overview and Getting Started
published on: 1/21/2011 | Views: N/A | Tags: C4FToolkit
by WindowsPhoneGeek
This post is an overview of the new Coding4Fun Windows Phone Toolkit. It offers developers additional controls and helper classes for Windows Phone 7 application development, designed to match the rich user experience of the Windows Phone 7. The official Coding4Fun tools were released yesterday by the Microsoft Coding4fun team, as always the full source code and a sample test project are also available (the whole toolkit is completely FREE). Some of the "geeks" involved in this cool project are: Jeff Wilcox, Thomas Claudius Huber, Kevin Marshall, Stephanie Hertrich and others.
This is the first in a series of articles that run through the new components from the Coding4Fun toolkit. In the last few months we covered all controls from the Silverlight for Windows Phone 7 Toolkit in a collection of "21 Toolkit in Depth articles", so it is time for a new one.
Coding4Fun Toolkit Included Components
The initial set includes the following:
Controls:
- About Prompt
- Input Prompt
- Progress Overlay (+ ProgressBar)
- Round Button
- Round Toggle Button
- Memory Counter
- TimeSpan Picker
- AboutPersonItem
Abstract Classes:
- PopUp class for things like an Input Prompt that can be GPU accelerated unlike the built in Popup control.
Converters:
- Boolean to Visibility
- String To Visibility
- Themed Image Converter
- Inversed Theme Image Converter
- Visibility to Boolean
Binding Helpers:
- Textbox update
Example: <TextBox Text="{Binding FooBar, Mode=TwoWay}" local:TextBoxBinding.UpdateSourceOnChange="True" />
Data Helpers:
- PhoneHelper for getting data out of the WMAppManifest file
Example: PhoneHelper.GetAppAttribute("Title")
Future Control ideas
- Slider Control
- Color Picker Control
- Indeterminate Progress Control with less CPU than the progress bar
Getting Started
NOTE: These controls are available for download including the source code but it is not included in the default download package (at least for now only some dlls are in), however you can download the full source code and the sample project from the Source Code section under Change Set 61253.
To begin with using the toolkit, first add some references to Coding4Fun.Phone.Controls.Toolkit.dll,Coding4Fun.Phone.Controls.dll, Coding4Fun.Phone.Site.Controls.dll. It depends on your need whish of these assemblies you will use.
You have to include the following namespace for most of the controls (other than TimeSpan):
xmlns:Controls="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
For TimeSpan the following namespace is needed:
xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls.Toolkit;assembly=Coding4Fun.Phone.Controls.Toolkit"
Here are some examples of how to use these controls in a Windows Phone 7 application.
About Prompt
private void About_Click(object sender, RoutedEventArgs e)
{
var about = new AboutPrompt();
about.Completed += about_Completed;
about.Show();
}
AboutPersonItem
<Controls:AboutPersonItem
WebSiteUrl="www.twitter.com/clintrutkas"
AuthorName="Clint Rutkas"
EmailAddress="foo@bar.com"
Role="me" />
Buttons
<Controls:RoundButton
HorizontalAlignment="Center"
Click="RoundButton_Click"
ImagePath="/Coding4Fun.Phone.TestApplication;component/Media/icons/{0}/appbar.check.rest.png" />
<Controls:RoundButton
HorizontalAlignment="Center"
Content="With Text"
Click="RoundButton_Click"
ImagePath="/Coding4Fun.Phone.TestApplication;component/Media/icons/{0}/appbar.check.rest.png" />
<TextBlock>Round Toggle Button</TextBlock>
<Controls:RoundToggleButton
HorizontalAlignment="Center"
ImagePath="/Coding4Fun.Phone.TestApplication;component/Media/icons/{0}/appbar.check.rest.png" />
<Controls:RoundToggleButton
HorizontalAlignment="Center"
Content="With Text"
ImagePath="/Coding4Fun.Phone.TestApplication;component/Media/icons/{0}/appbar.check.rest.png" />
Input Prompt
This is a kind of popup control that prompt user to enter input.
private void Input_Click(object sender, RoutedEventArgs e)
{
var input = new InputPrompt();
input.Completed += input_Completed;
input.Title = "Basic Input";
input.Message = "I'm a basic input prompt";
input.Show();
}
Memory Counter
<Controls:MemoryCounter />
Overlays
This is an overlay control which basically exposes two properties:Content, HasGesturesDisabled. Its ControlTemplate consists of PerformanceProgressBar element and Contentcontrol.
<Controls:ProgressOverlay Name="progressOverlay" >
<Controls:ProgressOverlay.Content>
<TextBlock>Loading</TextBlock>
</Controls:ProgressOverlay.Content>
</Controls:ProgressOverlay>
Progress bar
This is the well knows Jeff Wilcox progress bar with a small adjustment.
<Controls:PerformanceProgressBar Name="ToggleProgressBar" />
TimeSpan Picker
You need to include the following namespace:
xmlns:c4fToolkit="clr-namespace:Coding4Fun.Phone.Controls.Toolkit;assembly=Coding4Fun.Phone.Controls.Toolkit"
This control is based an the Silverlight Toolkit and modified so that it has Max and Step properties which can be used in order to set a timespan interval. This control can display data in varies ways and you can control this using the ValueStringFormat property like for example: ValueStringFormat="{}{0:hh} - {0:mm} - {0:ss}".
<c4fToolkit:TimeSpanPicker
Max="{Binding TimeSpan2Hour}"
Step="{Binding TimeSpan10Min}"/>
That was all about Coding4Fun Windows Phone Toolkit in short. In the next few posts I will describe each one of the controls in depth.
I hope that the article was helpful.
You can also follow us on Twitter @winphonegeek
Comments
Thanks a lot for sharing this info.
posted by: Kate on 1/21/2011 4:19:52 PM
The toolkit has just been released and you already have a pretty cool article. Thanks a lot for sharing this info. I really appreciate this. Keep up with the good work. Cheers!
quite interesting
posted by: Khimoty on 1/21/2011 5:33:31 PM
Quite interesting, it seems that this is another set of nice controls. I am looking for the in depth articles.
Many thanks
posted by: Ramesh on 1/22/2011 8:31:28 AM
Would really appreciate to keeping us up to date :)
Many thanks for it. Cheer up!
With Best Regards,
Ramesh
RE:@Khimoty
posted by: winphonegeek on 1/25/2011 12:35:30 PM
Here is the first Coding4fun Toolkit in depth article: WP7 TimeSpanPicker in depth
Second coding4fun toolkit in depth article
posted by: winphonegeek on 1/27/2011 9:46:19 PM
Here is the second Coding4fun Toolkit in depth article: WP7 ProgressOverlay control in depth: features and customization
Thanks for posting the links
posted by: Rahmed Davii on 1/27/2011 9:50:04 PM
Thanks for posting the links to the "in depth" articles. Keep up with the good work, I am looking forward to your next articles.
Third coding4fun toolkit in depth article
posted by: winphonegeek on 1/31/2011 7:20:01 PM
Here is the third Coding4fun Toolkit in depth article: WP7 RoundToggleButton and RoundButton in depth
Coding4Fun Toolkit About Control
posted by: Dick Heuser on 2/3/2011 4:57:50 AM
How do you use the AboutPrompt control and the AboutPersonItem? Where does the AboutPersonItem go? I am very confused by this control.
RE:About Control
posted by: winphonegeek on 2/4/2011 6:04:17 PM
For now you can download the example that comes with the Coding4fun toolkit source code. Our next article will cover these controls and we will explain everything in details. Of coerce we will provide sample code as well.
Improving Coding4Fun's AboutPrompt
posted by: Radu Poenaru on 2/6/2011 2:37:57 PM
Hi,
I created a small article on my website about how to customise the AboutPrompt to behave also as errors/warnings messagebox : http://www.radupoenaru.com/improving-coding4fun-aboutprompt/.
Can I join the Codeplex page to move this contribution in a proper Prompt control(after polishing and add an example in the test WP7 app) ?
Two more in depth articles
posted by: winphonegeek on 2/8/2011 9:12:32 AM
Here are the latest two Coding4fun Toolkit in depth articles:
Talking about Converters in WP7 | Coding4fun toolkit converters in depth
Two more in depth articles
posted by: winphonegeek on 2/10/2011 12:50:52 PM
Here are the latest two Coding4fun Toolkit in depth articles:
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
