How I can bind colour of rectangle and my bool in c# code if i arledy have converter? I dont have rectange in xaml, I just creating it in code and adding on grid.
To add a binding in code:
Binding binding = new Binding("State");
binding.Converter = new BooleanToBrushConverter();
_rectangle.SetBinding(Rectangle.FillProperty, binding);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.