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

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

posted @ 2014-09-14 02:36  长白山  阅读(381)  评论(0编辑  收藏  举报