Mobile Zone is brought to you in partnership with:

Senthil Kumar is a Software Engineer who has around 3 years of experience in IT industry. He is currently working as a Software Engineer in Bangalore and works mainly on the Windows or Client Development technologies and has good working experience in C#/.NET, Delphi, Winforms and SQL Server. He is also a Microsoft Technology Certified Professional in ASP.NET. He Blogs at http://www.ginktage.com and http://www.windowsphonerocks.com. He enjoys learning as much as he can about all things related to technologies to get a well-rounded exposure of technologies that surround him. Senthil completed his Master of Computer Applications from Christ College (Autonomous), Bangalore in the year 2009 and is a MCA Rank Holder. He has passion for Microsoft technologies especially Windows Phone development. You can connect with him on Twitter at (http://twitter.com/isenthil) , on Facebook at (http://www.facebook.com/kumarbsenthil) and his blog (www.ginktage.com). Senthil is a DZone MVB and is not an employee of DZone and has posted 118 posts at DZone. You can read more from them at their website. View Full User Profile

ColorPicker Control for Windows Phone (Coding4Fun)

07.12.2012
| 2024 views |
  • submit to reddit

ColorPicker control is part of the Coding4Fun Toolkit for Windows Phone. You can easily add the color picker functionality to your Windows Phone App by downloading the Coding4Fun Toolkit for Windows Phone and using the ColorPicker control.

What is a ColorPicker?

ColorPicker is a control that displays the different colors and provides a slider kind of functionality for the user to pick the color from the control.

To add the ColorPicker control onto your Windows Phone App, follow the below steps

1. Download Coding4Fun Toolkit from CodePlex website.

2. Add the Coding4Fun controls to the toolbox by selecting the Coding4Fun.Phone.Controls.dll. This should list all the controls available in the Coding4Fun toolkit to your Visual Studio 2010 toolbox.

ColorPicker control for Windows Phone – Picture 1

3. Now, drag and drop the ColorPicker control to the Windows Phone Page.

Alternatively, you can also define the below namespace for the PhoneApplicationPage and reference the controls in your Page .

xmlns:my="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"

You could add the control in the XAML page with the following tag

<my:ColorPicker HorizontalAlignment="Left" Margin="6,6,0,0" Name="colorPicker1" VerticalAlignment="Top" Height="532" Width="444" />

ColorPicker control for Windows Phone – Picture 2

The ColorPicker has an event “ColorChanged” which can be used to retrieve the new selected color (is selected) via the argument of type “Color”.

private void colorPicker1_ColorChanged(object sender, Color color)
{
     textBlock1.Text = color.ToString();
}
Published at DZone with permission of Senthil Kumar, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)