I’m currently migrating from WinForms over to WPF and I’m really struggling with the binding aspects. All i need to do is match the fill property of a rectangle to a textblock.background and keep them in sync. I know I can do this with ‘classic’ event handlers, but I have 24 textboxes and 24 rectangles, and I’d prefer a more WPF solution. I’ve toyed with the binding properties but I can’t seem to get any type of results since I have no clue with type of binding I even need! Do i need an event, or use a convertor, or possibly a style trigger? Maybe just stick transparent tape on the screen and call it a day?
I know the following doesn’t work but this is my level of understanding at this point.
<Rectangle Fill="{Binding Source="textBlock.Background"} />
I’ve read various articles on databinding but they are all much more advanced, and typically deal with data.
Can someone please shed some light on this helpless n00b!
That’s the easy way if you are creating them in XAML.