private static MultiSelectComboBox GetComboBox(DependencyObject targetElement)
        {
            MultiSelectComboBoxItem item = targetElement.GetVisualParent <MultiSelectComboBoxItem>();

            if (item != null)
            {
                return(item.ParentComboBox);
            }
            return(null);
        }
Exemplo n.º 2
0
        public void UpdateSelectedContainer(ToggleButton checkBox, MultiSelectComboBoxItem container, bool select)
        {
            foreach (var si in SelectedItems)
            {
                var x = ContainerFromItem(si);
                Debug.WriteLine(x);
            }
            var obj = ItemFromContainer(checkBox.GetVisualParent <MultiSelectComboBoxItem>());

            if (obj != null)
            {
                checkBox.IsChecked = SelectedItems.Any(si => si == obj);
            }
        }