コード例 #1
0
        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;
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: XamlBindingTest.cs プロジェクト: healtech/Perspex
 public void TestNullDataContext()
 {
     var t = new Mock<ITypeConverterProvider>();
     var sut = new XamlBinding(t.Object);
     sut.BindToDataContext(null);
 }