Create a custom multi-converter

Assignment Help Computer Engineering
Reference no: EM132175752

Value Converters in WPF C#

We often use data binding to display primitive data (ints, strings, even bools) directly to the UI. However, what if we want to bind a value to a dependency property of an incompatible type? Or what if the data value needs to be translated before it is displayed? WPF gives us the value converters in order to meet this need.

Let's build a color hex value translator.

Requirements

You will build a UI with the following qualities:

There will be eight text boxes. Four of them will represent the decimal values of the current color (each between 0 and 255 inclusive). The remaining four will be the hexadecimal values of the current color (each between 00 and FF).

You must build a custom value converter to convert between the decimal and hexadecimal values of each box. Changing the hex Red box should update the decimal Red box and vice versa.

There will be a checkbox for the option "Display Preview With Sliders". Clicking the checkbox toggles the visibility of a color control with 4 sliders and a preview panel.

While you will need a value converter for this, there is no need to build a custom one. You will use WPF's built-in value converter class BooleanToVisibilityConverter.

The preview panel will be bound to its sliders in order to display the currently selected color in real time.

You will create a custom multi-converter and use it in a MultiBinding in order to accomplish this.

The sliders themselves should be clearly labeled, slide only in whole number values, span a range of values from 0 to 255 inclusive, and have a non-editable label displaying the its current value.

Finally, you will bind the sliders of the preview control to the original decimal text boxes using two-way binding.

Reference no: EM132175752

Questions Cloud

What is the value of the boolean expression : What do the following hexadecimal values represent in ASCII: 43h, 42h, 41h, 31h, 32h, 33h?
Write a program that prompts the user for 5 numbers : Write a C++ program that prompts the user for 5 numbers. The values shall be stored in an array name "numb".
How does exploiting get you to remediation : Along those lines, what do you consider to be the ultimate goal of a penetration test? Can you stop short of actually exploiting?
How many different passwords are there : A valid password is a string of between 6 and 12 characters, inclusive, where each character can be an uppercase or a lowercase letter.
Create a custom multi-converter : There will be eight text boxes. Four of them will represent the decimal values of the current color (each between 0 and 255 inclusive).
Write a java console application that manages city names : Write a Java console application that manages city names. Use an array of size 30 to store the names.
Determine the sum of all integers that are evenly divisible : Use a For loop to determine the sum of all integers that are evenly divisible by 5 from A to 2*B.
What minimum number of clicks he has to make in order : Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer.
How long would it take the rover to transmit the pictures : Suppose NASA takes several pictures of the martian surface and wants to transmit them back to Earth. The total size of the pictures is 50 MB.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What implications does the business model have for systems

Do you agree with Dogster's view, or should companies aim for "zero-defect" operations? Why or why not? What implications does this business model have for systems analysts?

  Create a coherent issue paper using given details

Your final assignment is where you will weave the first two elements (the Cyber White Paper and Cyber Research Proposal) together, and incorporate.

  What are java predefined methods

What are java predefined methods

  Write the equivalent mips assembly code for the c-code

CI5220 Computer Organisation Coursework Assignment. Write the equivalent MIPS assembly code for the C-code shown above. You should assume the following: The number of scores, N, to be analysed is 50. The address of the first element in the marks arra..

  Write a program to allow him to find his fastest time

Write a program to allow him to find his fastest, slowest and average time of up to 10 races. Your program should ask for times for each race.

  What do you think about the increased use of rfid tags

What do you think about the increased use of RFID tags and how about tagging dogs and children in school?

  Design alternatives have to be thoroughly considered

Design alternatives have to be thoroughly considered. There must be a process to fairly evaluate the pros and cons of each option. Let's look at how the alternative matrix can help facilitate the design decision through creation of our own alterna..

  What are the different types of cloud services

The Discussion Board (DB) is part of the core of online learning. Classroom discussion in an online environment requires the active participation of students.

  Questionq1 assume that the ith operation on a data

questionq1 assume that the ith operation on a data structure takes thetaui time where ui is the number of units in the

  Question1 what are three goals of safety in computing for

question1. what are three goals of safety in computing? for each goal list two controls that be able to be implemented

  What is the speedup from improving both

Either make multiply instructions run four times faster than before, or make memory access instructions run three times faster than before.

  Find out the standard gauges of sheet metal

Find out the standard gauges of sheet metal for different materials and their corresponding thicknesses. For example, Gauge 10 for Aluminum is 3 mm.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd