Custom flag in silverlight

How to create your own checkbox that looks like the one shown below. Flags are displayed dynamically and can have custom colors.

+6
source share
2 answers

Ok, you can just create a style. Take the style here and change it. A key component in the style of VisualStateManager , make sure you understand what it does.

You can also create a custom control, you can read about it, for example here .

+1
source

What would I do, create a custom ImageCheckBox control that inherits from the default CheckBox class, add three dependency properties of the ImageSource type, called CheckedImage, IndeterminateImage and UncheckedImage. Just switch their Visibility or Opacity based on the CheckStates control, i.e. Checked, Unchecked, and Indeterminate.

0
source

Source: https://habr.com/ru/post/899089/


All Articles