Beispiel #1
0
        public static Dictionary <object, bool?> ToDictionary(this System.Windows.Controls.Primitives.Selector selector)
        {
            //if (sender is not System.Windows.Controls.Primitives.Selector selector)
            //{
            //    throw new System.Exception("sdf4 fdgdgp;p;p");
            //}

            //if (string.IsNullOrEmpty(selector.SelectedValuePath) == false ||
            //    string.IsNullOrEmpty(selector.DisplayMemberPath) == false)
            //{
            var items  = selector.ItemsOfType <CheckBox>().ToArray();
            var output = items.Where(a => a is { Tag: { } tag }).ToDictionary(a => a.Tag, a => a.IsChecked);