title: Property returning null unless It's bound?
body: <pre><code>         Window2 X = new Window2();
          var taskViewModel = (XViewModel)X.DataContext;
          taskViewModel.Name = Username;
          X.Show();
  </code></pre>
  
  <p>I struggled for hours thinking that the above code is not working properly while It was. 
  Because If I bind <code>Name</code> to a Textblock for example in the second form, the value is going to show. If I write it using <code>Console.Write</code> or try to show it in a <code>MessageBox</code> It returns null, nothing is shown. What is causing that?</p>
  
  <pre><code> public string Name
        {
            get { return _Name; }
            set
            {
                _Name = value;
                NotifyOfPropertyChange("Name");
            }
        }
  
       Public XViewModel()
      {
          MessageBox.Show(Name);
      }
  </code></pre>
  
  <p>As simpel as that, the above messageBox will be empty. If I do this however:</p>
  
  <pre><code>&lt;TextBlock FontWeight="Bold" Text="{Binding Name}" &gt;&lt;/TextBlock&gt;
  </code></pre>
  
  <p>It's going to show properly as soon as I open the window using the first code.</p>
  
  <p><strong>EDIT:</strong> I tried to make a button and binded a command that calls the MessageBox. In this case, Name is <strong>showing propertly</strong>.</p>
  
  <p>EDIT2: this is not working either:</p>
  
  <pre><code>        Window2 w = new Window2();
          XViewModel vm = new XViewModel ();
          vm.Name = Username;
          w.DataContext = vm;
          w.Show();
  </code></pre>