How to make a cololered led in xaml (wpf c#) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to make a cololered led in xaml (wpf c#)

I want to make a colered led in WPF. I use mvvm, so I like to bind the xaml via a method or a variable. I know I can use a checkbox, but I want it to be a bit more fancy then that. I tried using a elipse control making the color red or green The problem I have is in the binding, how can I change the color of the elipse.

18th Apr 2018, 7:34 AM
sneeze
sneeze - avatar
5 Answers
+ 2
Hi @Sneeze, I don't know if this may help, but this article discuss about binding background color: https://stackoverflow.com/questions/1962149/how-can-i-bind-a-background-color-in-wpf-xaml
22nd Apr 2018, 3:28 AM
Ipang
+ 2
I suppose you've already solved that, but I wrote something anyways: https://code.sololearn.com/ca19qCuofqub/?ref=app
25th Apr 2018, 7:57 PM
Mante
Mante - avatar
+ 1
You're welcome!
30th Apr 2018, 5:26 AM
Mante
Mante - avatar
0
Thanks for your reply. It is not what I was looking but it is a nice project and nice pieco of code.
21st Apr 2018, 9:29 PM
sneeze
sneeze - avatar
0
@Mante Thanks for your answer. No I have not solved it yet, been busy coding other things. But your solution looks pretty neat, thank you. I am going to test it.
29th Apr 2018, 8:49 PM
sneeze
sneeze - avatar