Beispiel #1
0
        private void SetSelectedItemsOnDropDown()
        {
            if (SelectedItems != null)
            {
                SelectedItems.Clear();
            }

            SelectedItems = (IList)Activator.CreateInstance(SelectedItems.GetType());

            if (this.ItemsSource.Count > 0)
            {
                int index = 0;
                foreach (var item in _itemList)
                {
                    if (item.IsSelected)
                    {
                        SelectedItems.Add(ItemsSource[index]);
                    }
                    index++;
                }
            }
        }