title: Opening a file from ListView on a MouseDoubleClick event
body: <p>I am trying to create a windows explorer.
  I have succeeded in populating the treeView and listView like windows explorer, but i am having a problem opening the file on double click from the listView.</p>
  
  <p>This is what i have so far:</p>
  
  <pre><code>try
          {
              //clears the collection so the listview has only the files of the folder thats clicked on
              _fileDetails.Clear();
  
  
              DirectoryInfo dirInfo = new DirectoryInfo( SelectedImagePath );
              FileInfo[] info = dirInfo.GetFiles();
  
              foreach (FileInfo fileInfo in info)
              {
                  //adds files to the collection with its properties
                  _fileDetails.Add( new Details
                  {
                      FileName = fileInfo.Name,
                      Size = fileInfo.Length.ToString(),
                      DateCreated = fileInfo.CreationTime.ToString(),
                      DateModified = fileInfo.LastWriteTime.ToString(),
                      RevNumber = "?",
                      User = "?"
                  } );
  
              }
          }
  </code></pre>
  
  <p>where fileDetails is my ObservableCollection.</p>
  
  <p>The mouse event:</p>
  
  <pre><code>protected void HandleDoubleClick( object sender, MouseButtonEventArgs e )
      {
          DependencyObject src = ( DependencyObject )( e.OriginalSource );
          while (!( src is Control ))
              src = VisualTreeHelper.GetParent( src );
          MessageBox.Show( "*** Double clicked on a " + src.GetType().FullName +"********************" + sender.ToString() );
      }
  </code></pre>
  
  <p>The binding:</p>
  
  <pre><code>&lt;ListView Height="335" HorizontalAlignment="Right" Margin="0,12,12,0" Name="fileExplorerView" VerticalAlignment="Top" Width="509" Grid.Column="1" ItemsSource="{Binding ElementName=This, Path=fileDetails}"&gt;
          &lt;ListView.ItemContainerStyle&gt;
              &lt;Style TargetType="{x:Type ListViewItem}"&gt;
                  &lt;EventSetter Event="MouseDoubleClick" Handler="HandleDoubleClick"/&gt;
              &lt;/Style&gt;
          &lt;/ListView.ItemContainerStyle&gt;
          &lt;ListView.View&gt;
  
              &lt;GridView&gt;
                  &lt;GridViewColumn Header="Name" Width="100" DisplayMemberBinding="{Binding FileName}"/&gt;
                  &lt;GridViewColumn Header="Size" Width="100" DisplayMemberBinding="{Binding Size}"/&gt;
                  &lt;GridViewColumn Header="Date Created" Width="100" DisplayMemberBinding="{Binding DateCreated}"/&gt;
                  &lt;GridViewColumn Header="Time Created" Width="100" DisplayMemberBinding="{Binding DateModified}"/&gt;
                  &lt;GridViewColumn Header="Revision Number"  Width="100" DisplayMemberBinding="{Binding RevNumber}"/&gt;
                  &lt;GridViewColumn Header="Modified By" Width="100" DisplayMemberBinding="{Binding User}"/&gt;
  
              &lt;/GridView&gt;
  
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>Instead of the messageBox in the mouse event, i will use a process to open the files.The problem is, i cant seem to figure out how to get the path of the selected file.</p>
  
  <p>Thanks</p>
  
  <p>All help will be appreciated.</p>