Beispiel #1
0
        //this works for adding new items, but not for adding missing items or highlighting existing ones.  why?
        private void SetSelectedListItem(NotifyingMetadataItem selection)
        {
            if (selection != null)
            {
                CollectionViewSource cvs = (CollectionViewSource)FindResource("MetadatasCVS");
                if (cvs != null)
                {
                    cvs.View.MoveCurrentTo(selection);
                }

                //MetadataList.SelectedItem = selection;

                MetadataList.ScrollIntoView(selection);

                FocusHelper.Focus(FocusableItem);
            }
        }