title: Changing window properties in Visual C# from code-behind (WPF)
body: <p>I want the background of my WPF window to change in a specific situation (but could as well be any other property). Let's suppose the name of the window is <code>myWindow1</code>. If I treat the window just like any other item (like you would do in Windows Forms), myWindow1 doesn't seem to have a Background property to set; only read-only properties are shown in auto-complete. If I try creating a new object like this:
  <code>myWindow1 w1 = new myWindow1();</code>
  then w1 seems to have all the right properties available for changing in autocomplete, including background, and the IDE shows no errors. But when I try starting the program, it hangs.</p>
  
  <p>What am I doing wrong, and what is the best practice for changing WPF windows properties from code-behind in Visual C# 2013?</p>