I've just started looking at WPF after playing with C# for a while. As such I'm starting by using XAML to define my form and then use C# to do the interesting stuff behind. For my first example I have a button on a form - Window1 and I can capture the event in the cs file that sits behind the XAML - Window1.xaml.cs. From here I can modify the button if I want to using code like:
But say I want the button click to modify another control on the form? How would I change the background value of (say) Button2? I've looked around the web and on MSDN and I can't find anyone who seems to be able to answer this question. I guess it can't be that hard - it's childs play in a "normal" C# form!
I can't believe I have been so stupid! Accessing the control is EXACTLY the same as using a Windows Form! Apologies for wasting everyones time - and to think I spent an hour trying to work this out - D'Oh!
Hope this forum gets better than my daft questions!
Accessing the control is not exactly the same. You will learn. I am learning as well. Consider "attached properties" and "dependency properties". WPF is a completely different beast from your comfortable .net experience.