Пример #1
0
        public void OnJavaScriptCollectionChanges(JavascriptCollectionChanges changes)
        {
            try
            {
                var res = _SessionCache.GetGlobalCached(changes.Collection) as JSArray;
                if (res == null)
                {
                    return;
                }

                var collectionChanges = res.GetChanger(changes, this);

                Context.RunOnUIContextAsync(() =>
                {
                    using (ReListen())
                        using (_ListenerRegister.GetColllectionSilenter(res.CValue))
                        {
                            res.UpdateEventArgsFromJavascript(collectionChanges);
                        }
                });
            }
            catch (Exception e)
            {
                _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}");
            }
        }
Пример #2
0
 private void UpdateCollection(JsArray array, object collection, CollectionChanges.CollectionChanges change, BridgeUpdater updater)
 {
     try
     {
         using (_ListenerRegister.GetColllectionSilenter(collection))
         {
             array.UpdateEventArgsFromJavascript(change, updater);
         }
         updater.CleanAfterChangesOnUiThread(_ListenerRegister.Off);
     }
     catch (Exception exception)
     {
         LogJavascriptSetException(exception);
     }
 }
Пример #3
0
 private void UpdateCollection(JSArray array, Neutronium.Core.Binding.CollectionChanges.CollectionChanges change, object collection)
 {
     try
     {
         using (ReListen())
             using (_ListenerRegister.GetColllectionSilenter(collection))
             {
                 array.UpdateEventArgsFromJavascript(change);
             }
     }
     catch (Exception e)
     {
         _Logger.Error(() => $"Unable to update ViewModel from View, exception raised: {e.Message}");
     }
 }