internal override void Apply(bool fromTarget) { base.Apply(fromTarget); if (_expression == null) { _expression = new BindingExpression(this, SelfPath); } _expression.Apply(fromTarget); }
public void ApplyNull() { const string path = "Foo.Bar"; var binding = new Binding (path); var be = new BindingExpression (binding, path); Assert.DoesNotThrow (() => be.Apply (null, new MockBindable(), TextCell.TextProperty)); }
public void ApplyNull() { const string path = "Foo.Bar"; var binding = new Binding(path); var be = new BindingExpression(binding, path); Assert.DoesNotThrow(() => be.Apply(null, new MockBindable(), TextCell.TextProperty)); }
void ApplyInner(Element templatedParent, BindableObject bindableObject, BindableProperty targetProperty) { if (_expression == null && templatedParent != null) { _expression = new BindingExpression(this, SelfPath); } _expression?.Apply(templatedParent, bindableObject, targetProperty); }
public void BindingExpressionApply() { tlog.Debug(tag, $"BindingExpressionApply START"); var testingTarget = new BindingExpression(new TemplateBinding(), selfpath); Assert.IsNotNull(testingTarget, "Can't create success object BindingExpression."); Assert.IsInstanceOf <BindingExpression>(testingTarget, "Should return BindingExpression instance."); try { using (View view = new View() { Color = Color.Red }) { using (View preView = new View() { Color = Color.Cyan }) { BindableProperty property = BindableProperty.Create("myProperty", typeof(string), typeof(View), null, BindingMode.OneWay, null, null, null, null, null); testingTarget.Apply(view, preView, property); testingTarget.Apply(true); testingTarget.Apply(false); testingTarget.Unapply(); } } } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } tlog.Debug(tag, $"BindingExpressionApply END"); }
public void BindingExpressionApplyNullSource() { tlog.Debug(tag, $"BindingExpressionApplyNullSource START"); var testingTarget = new BindingExpression(new TemplateBinding(), selfpath); Assert.IsNotNull(testingTarget, "Can't create success object BindingExpression."); Assert.IsInstanceOf <BindingExpression>(testingTarget, "Should return BindingExpression instance."); try { testingTarget.Apply(false); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } tlog.Debug(tag, $"BindingExpressionApplyNullSource END"); }