public XamlBinding Create(XamlBindingDefinition xamlBinding) { if (xamlBinding.Target == null) { throw new InvalidOperationException(); } if (xamlBinding.TargetProperty == null) { throw new InvalidOperationException(); } var binding = new XamlBinding(this.typeConverterProvider) { BindingMode = xamlBinding.BindingMode, SourcePropertyPath = xamlBinding.SourcePropertyPath, Target = xamlBinding.Target, TargetProperty = xamlBinding.TargetProperty }; this.bindings.Add(binding); return binding; }
public XamlBinding Create(XamlBindingDefinition xamlBinding) { if (xamlBinding.Target == null) { throw new InvalidOperationException(); } if (xamlBinding.TargetProperty == null) { throw new InvalidOperationException(); } var binding = new XamlBinding(_typeConverterProvider) { BindingMode = xamlBinding.BindingMode, SourcePropertyPath = xamlBinding.SourcePropertyPath, Target = xamlBinding.Target, TargetProperty = xamlBinding.TargetProperty }; _bindings.Add(binding); return(binding); }
public void TestNullDataContext() { var t = new Mock<ITypeConverterProvider>(); var sut = new XamlBinding(t.Object); sut.BindToDataContext(null); }