title: SelectionIndexChanged firing twice
body: <p>I am wondering why my selection index changed is firing twice when I click on an item on my list.</p>
  <p>This is the code I use in the selectionindexchanged</p>
  <pre><code> private void listBoxFolders_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          // Taking the name of the folder to pass in the parameters
          if ((Folder)listBoxFolders.SelectedItem != null)
          {
              folderTmp = (Folder)listBoxFolders.SelectedItem;
          }
  
          // Connection to the webservice to get the subfolders and also the files
          WebClient wc = new WebClient();
          wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted2);
          wc.DownloadStringAsync(new Uri(&quot;http://clients.uicentric.net/IISHostedCalcService/FilesService.svc/GetFoldersAndFiles?selectedFolder=&quot; + folderTmp.Name));
      }
  </code></pre>
  <p>and this is the method which is firing twice inside it:</p>
  <pre><code> public void wc_DownloadStringCompleted2(object sender, DownloadStringCompletedEventArgs e)
      {
          if (e.Error == null)
          {
              XDocument xdoc = XDocument.Parse(e.Result, LoadOptions.None);
              XNamespace aNamespace = XNamespace.Get(&quot;http://schemas.datacontract.org/2004/07/System.IO&quot;);
  
              try
              {
  
                  // Retrieving the subfolders
                  var folders = from query in xdoc.Descendants(aNamespace.GetName(&quot;DirectoryInfo&quot;))
                                select new Folder
                                {
                                    Name = (string)query.Element(&quot;OriginalPath&quot;),
                                };
  
                  _lFolders = new ObservableCollection&lt;Folder&gt;();
  
                  foreach (Folder f in folders)
                  {
                      LFolders.Add(f);
                  }
  
                  listBoxFolders.ItemsSource = LFolders;
                  listBoxFolders.DisplayMemberPath = &quot;Name&quot;;
  
  
                  // Retrieving the files
                  var files = from query in xdoc.Descendants(aNamespace.GetName(&quot;FileInfo&quot;))
                              select new File
                           {
                               Name = (string)query.Element(&quot;OriginalPath&quot;),
                           };
  
  
                  _lFiles = new ObservableCollection&lt;File&gt;();
  
                  foreach (File f in files)
                  {
  
                      LFiles.Add(f);
                  }
  
                  listBoxFiles.ItemsSource = LFiles;
                  listBoxFiles.DisplayMemberPath = &quot;Name&quot;;
                  listBoxFiles.SelectionChanged += new SelectionChangedEventHandler(listBoxFiles_SelectionChanged);
  
              }
              catch { }
  
          }
  
      }
  </code></pre>