Before reading this article, please go through the article, given below.
ColorPicker is a UI component, which displays a range of colors in a color space. It consists of a ColorSlider element as well as multiple Rectangle/Ellipse elements. As its name says, it is a kind of extended picker, which shows the selected color, via its Color property.
After reading this article, you will learn how to use Coding4Fun ColorPicker in Universal Windows apps development with XAML and Visual C# also enables the ColorPicker from the button control and changes the border background.
The important tools, given below are required to develop UWP.
- Windows 10 (Recommended).
- Visual Studio 2015 Community Edition (It is a free software available online).
Now, we can discuss step by step app development.
Step 1
Open Visual Studio 2015 -> Start -> New Project-> select Universal (under Visual C#->Windows)-> Blank app -> give the suitable name for your app (UWPC4FColorPicker)->OK.

After Choosing the Target and minimum platform version for your Windows, Universal Application will support it and the project creates App.xaml and MainPage.xaml.

Step 2
Add the TextBlock control, change the name and text property for the title.

Add the Button control, set the name and Tooltip property.

Add the Border control and change the name property.

Step 3
Open (double click) the file MainPage.xaml in Solution Explorer and add the Coding4Fun.Toolkit.Controls reference in the project.
To add the reference, right click on your project (UWPC4FColorPicker) and select Manage NuGet Packages.

Choose browse and search Coding4Fun.Toolkit.Controls. Select the package and install it.

The reference is added to your project.

Step 4
Add the tab in the Toolbox to add Coding4Fun Tool Kit controls.
Right click on the Coding4Fun Toolkit (Newly added tab) and select choose items.

Select the path given below.
C:\Users\<username>\.nuget\packages\Coding4Fun.Toolkit.Controls\2.1.8\lib\netcore451
Select the file Coding4Fun.Toolkit.dll and filter the Coding4Fun.Toolkit controls.

Step 6
Now, add ColorPicker Control, set the name and Visibility property to hide the ColorPicker control.

Step 7
Add Click Event method in the button control.

Step 8
Add ColorChanged Event method for ColorPicker.

Note
Automatically, the code given below will be generated in XAML code view, while we are finished in the design view.





Join the conversation! Your thoughts help the community grow.