private void Object_PropertyChanged(object sender, PropertyChangedEventArgs e) { string pn = e.PropertyName; PropertyInfo propertyInfo = sender.GetType().GetProperty(pn, BindingFlags.Public | BindingFlags.Instance); if (propertyInfo == null) { return; } JSGenericObject currentfather = _FromCSharp[sender] as JSGenericObject; object nv = propertyInfo.GetValue(sender, null); IJSCSGlue oldbridgedchild = currentfather.Attributes[pn]; if (Object.Equals(nv, oldbridgedchild.CValue)) { return; } IJSCSGlue newbridgedchild = _JSObjectBuilder.Map(nv); RegisterAndDo(newbridgedchild, () => currentfather.Reroot(pn, newbridgedchild)); }
internal BidirectionalMapper(object iRoot, IWebView iwebview, JavascriptBindingMode iMode, object iadd) { _IWebView = iwebview; _LocalBuilder = new LocalBuilder(iwebview); _JSObjectBuilder = new CSharpToJavascriptMapper(_LocalBuilder, this); _JavascriptToCSharpMapper = new JavascriptToCSharpMapper(iwebview); _Root = _JSObjectBuilder.Map(iRoot, iadd); _UnrootedEntities = new List<IJSCSGlue>(); _BindingMode = iMode; IJavascriptListener JavascriptObjecChanges = null; if (iMode == JavascriptBindingMode.TwoWay) JavascriptObjecChanges = this; _GlobalBuilder = new GlobalBuilder(_IWebView, "MVVMGlue"); _SessionInjector = new JavascriptSessionInjector(iwebview, _GlobalBuilder, JavascriptObjecChanges); }
internal BidirectionalMapper(object iRoot, IWebView iwebview, JavascriptBindingMode iMode, object iadd) { _IWebView = iwebview; _LocalBuilder = new LocalBuilder(iwebview); _JSObjectBuilder = new CSharpToJavascriptMapper(_LocalBuilder, this); _JavascriptToCSharpMapper = new JavascriptToCSharpMapper(iwebview); _Root = _JSObjectBuilder.Map(iRoot, iadd); _UnrootedEntities = new List <IJSCSGlue>(); _BindingMode = iMode; IJavascriptListener JavascriptObjecChanges = null; if (iMode == JavascriptBindingMode.TwoWay) { JavascriptObjecChanges = this; } _GlobalBuilder = new GlobalBuilder(_IWebView, "MVVMGlue"); _SessionInjector = new JavascriptSessionInjector(iwebview, _GlobalBuilder, JavascriptObjecChanges); }