/// <summary>
 /// Fired whenever a component property's value gets changed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ComponentPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     //presently, we only care about selection change
     if (e.PropertyName.CompareTo("IsSelected") == 0)
     {
         IWizardBaseController component = sender as IWizardBaseController;
         if (component.IsSelected)
         {
             if (UnselectedComponents.Contains(component))
             {
                 UnselectedComponents.Remove(component);
             }
             if (!SelectedComponents.Contains(component))
             {
                 SelectedComponents.Add(component);
             }
         }
         else
         {
             if (SelectedComponents.Contains(component))
             {
                 SelectedComponents.Remove(component);
             }
             if (!UnselectedComponents.Contains(component))
             {
                 UnselectedComponents.Add(component);
             }
         }
     }
 }
        public void SortComponents()
        {
            if (AllComponents[0].SortOrder != 0)
            {
                List <IWizardBaseController> selectedAsList = SelectedComponents.ToList();
                selectedAsList.Sort(new WizardSortOrderComparer());
                SelectedComponents = new ObservableCollection <IWizardBaseController>(selectedAsList);

                List <IWizardBaseController> unselectedAsList = UnselectedComponents.ToList();
                unselectedAsList.Sort(new WizardSortOrderComparer());
                UnselectedComponents = new ObservableCollection <IWizardBaseController>(unselectedAsList);
            }
            else
            {
                List <IWizardBaseController> selectedAsList = SortComponents(SelectedComponents.ToList());
                SelectedComponents = new ObservableCollection <IWizardBaseController>(selectedAsList);

                List <IWizardBaseController> unselectedAsList = SortComponents(UnselectedComponents.ToList());
                UnselectedComponents = new ObservableCollection <IWizardBaseController>(unselectedAsList);
            }

            //The collectionChanged event won't get called to save our sort, so we have to do it manually
            ComponentsCollectionChanged(this, new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Reset));
        }