title: How to bind Variables of View to ViewModel in WPF MVVM?
body: <p>I have a created a window ( WPF and MVVM ) - say PrintWidow ( so I have PrintWindow.xaml , PrintWindow.xaml.cs , PrintWindowViewModel.cs- viewmodel)</p>
  
  <p>Now I am going to use(call) this <code>PrintWindow</code> obj from some other class on  button click or on some command trigger , I want to set Document Source  for this PrintWindow(following  MVVM).</p>
  
  <p>How would I do this ? I created a <code>PrintDocument</code> object in PrintWindow.xaml.cs and tried to bind it as follows : (obviously just a blank try - as I cannot do this declaration in XAML)</p>
  
  <pre><code>private PrintDocument printDocuementView;
  
  public PrintDocument PrintDocuement
  {
      get { return printDocuementView; }
      set { printDocuementView = value; }
  }
  
  //constructor
  public PrintWindow()
  {
      InitializeComponent();
      this.DataContext = new PrintViewModel();
  
      Binding b = new Binding();
      b.Source = printDocuementView;
      b.Path = new PropertyPath("PrintDocumentCommand"); // "PrintDocumentCommand" is defined in View Model class and is responsible to set the `PrintDocument` object there.
  
  }
  </code></pre>
  
  <p>This code (obviously) doesn't work. How should I go about it.
  Summary : I want to open <code>PrintWindow</code> from another window and eventually set some Property of <code>PrintWindow</code> from code behind of the 'other widow' object.The query is - where should this property go? View ? ViewModel? ?? <em>puzzzeled</em></p>
  
  <p>I have googled for answers - but couldn't relate any to my problem.</p>
  
  <p>I am a Freshman for <code>WPF</code> and a Rookie for <code>MVVM</code>. </p>