title: Accessing View from Viewmodel
body: <p>I know that's bad design, but I need access to the view from my viewmodel. This is because I have some old controls, e.g. Winforms controls, that don't support binding and need to be filled by code.</p>
  
  <p>I'm using the MVVM model of AvalonDock 2.0 and have something similar to this:</p>
  
  <pre><code>   &lt;ad:DockingManager x:Name="dockManager" 
                    DocumentsSource="{Binding Files}"
                    AnchorablesSource="{Binding Tools}"
          ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={StaticResource ActiveDocumentConverter}}"&gt;
          &lt;ad:DockingManager.LayoutItemTemplateSelector&gt;
              &lt;local:PanesTemplateSelector&gt;
                  &lt;local:PanesTemplateSelector.NavigationViewTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;tvext:TreeViewExtended /&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/local:PanesTemplateSelector.NavigationViewTemplate&gt;
              &lt;/local:PanesTemplateSelector&gt;
          &lt;/ad:DockingManager.LayoutItemTemplateSelector&gt;
  </code></pre>
  
  <p>So the template NavigationViewTemplate is bound to one item of the collection Tools, which is my ViewModel of type NavigationViewModel.</p>
  
  <p>I have no problem binding e.g. a TextBox to a property of my viewmodel. But I don't know how I can get access from my NavigationViewModel to the tvext:TreeViewExtended control inside the template in order to fill it.</p>
  
  <p>TIA Michael</p>