I have the following snippet of code in an .xaml file:

&lt;TreeView MouseDoubleClick="TreeView_MouseDoubleClick" ItemsSource="{Binding MyList}"&gt;
  &lt;TreeView.ItemContainerStyle&gt;
    &lt;Style TargetType="{x:Type TreeViewItem}"&gt;
      &lt;Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /&gt;
      &lt;Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /&gt;
      &lt;Setter Property="FontWeight" Value="Normal" /&gt;
      &lt;Style.Triggers&gt;
        &lt;Trigger Property="IsSelected" Value="True"&gt;
          &lt;Setter Property="FontWeight" Value="Bold" /&gt;
        &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
    &lt;/Style&gt;
  &lt;/TreeView.ItemContainerStyle&gt;


As you can see, when you "MouseDoubleClick" on an item in the TreeView it will execute the code in the code behind...namely...

private void TreeView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
    try
    {
        MessageBox.Show(((TreeViewWithViewModelDemo.LoadOnDemand.HtmlFileViewModel)(((System.Windows.Controls.TreeView)(sender)).SelectedValue)).HtmlFileName);
    }
    catch
    {
    }
}


I'm trying to follow the Model-View-ViewModel Design Pattern and would like to move the implementation of this MouseDoubleClick event away from the View and into the ViewModel.

I understand that if I was using a command I would use {Binding Command="Select"} (or something similar that implements the ICommand interface) but I cannot seem to find the syntax for this particular issue since it is not a command button.

Can someone help me out?

Thanks


Question: Update ExtJS Panel with HTML that will render iframe
Answer: Did you try out the ux: miframe.js? The documentation is available here. I have been using it for embedding iframes in Panels for quite some time with ExtJS 3.x. I don't know if it has been ported for ExtJS4 though.