关于绑定的C#代码+转换器

  BindingOperations.SetBinding(
                exp, Expander.IsExpandedProperty,
                new Binding()
                {
                    Path = new PropertyPath("SelectedExpander"),
                    Mode = BindingMode.TwoWay,
                    Converter = this.TryFindResource("ExpanderToBoolConverter") as IValueConverter,
                    ConverterParameter = convertParameter
                }
            );

原文地址:https://www.cnblogs.com/changbaishan/p/3970615.html