private BridgeUpdater GetUnrootedEntitiesUpdater(IJsCsGlue newBridgeChild, Action <IJsCsGlue> performAfterBuild)
 {
     _UnrootedEntities.Add(newBridgeChild.AddRef());
     return(new BridgeUpdater(updater =>
     {
         updater.InjectDetached(newBridgeChild.GetJsSessionValue());
         performAfterBuild(newBridgeChild);
     }));
 }
        private async void SetResult(IJavascriptObject promise, IJsCsGlue bridgevalue)
        {
            if (promise == null)
            {
                return;
            }

            await WebView.RunAsync(async() =>
            {
                await promise.InvokeAsync("fullfill", WebView, bridgevalue.GetJsSessionValue());
            });
        }
示例#3
0
        public BridgeUpdater GetUpdaterChangeOnCSharpContext(AttributeUpdater propertyUpdater, IJsCsGlue glue)
        {
            var update = PrivateUpdateGlueProperty(propertyUpdater, glue);

            BridgeUpdater updater;

            if (!update.AddedProperty)
            {
                updater = new BridgeUpdater(viewModelUpdater => viewModelUpdater.UpdateProperty(CachableJsValue,
                                                                                                propertyUpdater.PropertyName, glue.GetJsSessionValue(), !glue.IsBasic()));
            }
            else
            {
                updater = new BridgeUpdater(viewModelUpdater => viewModelUpdater.AddProperty(CachableJsValue,
                                                                                             propertyUpdater.PropertyName, glue.GetJsSessionValue()));
            }

            return(updater.CheckForRemove(update.OldReference));
        }
示例#4
0
 private void Splice(IJavascriptViewModelUpdater viewModelUpdater, int index, int number, IJsCsGlue glue)
 {
     viewModelUpdater?.SpliceCollection(CachableJsValue, index, number, glue.GetJsSessionValue());
 }
示例#5
0
 private void OnExit(IJsCsGlue exiting)
 {
     exiting.ApplyOnListenable(_ListenerRegister.Off);
     exiting.GetJsSessionValue().Dispose();
 }
        public BridgeUpdater GetUpdater(AttibuteUpdater propertyUpdater, IJsCsGlue glue)
        {
            var update = PrivateUpdateGlueProperty(propertyUpdater, glue);

            BridgeUpdater updater;

            if (!update.AddedProperty)
            {
                updater = new BridgeUpdater(viewModelUpdater => viewModelUpdater.UpdateProperty(CachableJsValue,
                                                                                                propertyUpdater.PropertyName, glue.GetJsSessionValue(), !glue.IsBasic()));
            }
            else
            {
                updater = new BridgeUpdater(viewModelUpdater => viewModelUpdater.AddProperty(CachableJsValue,
                                                                                             propertyUpdater.PropertyName, glue.GetJsSessionValue()));
            }

            return(updater.Remove(update.ToBeCleaned));
        }