Beispiel #1
0
 private void ScrollToPicker_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (CollectionListViewH.ItemsSource != null && CollectionListViewH.IsVisible)
     {
         List <ListViewElements> Items        = (List <ListViewElements>)CollectionListViewH.ItemsSource;
         ListViewElements        Selecteditem = Items.Select(x => x).Where(y => y.LVName == ScrollToPicker.SelectedItem.ToString()).FirstOrDefault();
         CollectionListViewH.ScrollTo(Selecteditem);
     }
     else if (CollectionListViewV.ItemsSource != null && CollectionListViewV.IsVisible)
     {
         List <ListViewElements> Items        = (List <ListViewElements>)CollectionListViewV.ItemsSource;
         ListViewElements        Selecteditem = Items.Select(x => x).Where(y => y.LVName == ScrollToPicker.SelectedItem.ToString()).FirstOrDefault();
         CollectionListViewV.ScrollTo(Selecteditem);
     }
 }
Beispiel #2
0
        private void FillCollectionView()
        {
            try
            {
                List <ListViewElements> oElements = new List <ListViewElements>();
                foreach (var items in oCollectionViewDic)
                {
                    ListViewElements NewSectionItem =
                        new ListViewElements()
                    {
                        LVName  = items.Key,
                        LVImage = items.Value
                    };
                    oElements.Add(NewSectionItem);
                }

                CollectionListViewH.ItemsSource = oElements;
                CollectionListViewV.ItemsSource = oElements;
            }
            catch (Exception oExp)
            {
            }
        }