public void UpdateView(UIImplementation uiImplementation) { if (ConnectedViewTag == -1) { throw new InvalidOperationException("Node has not been attached to a view."); } var propsMap = new JObject(); foreach (var entry in _propMapping) { var node = _manager.GetNodeById(entry.Value); var styleNode = node as StyleAnimatedNode; var valueNode = default(ValueAnimatedNode); if (styleNode != null) { styleNode.CollectViewUpdates(propsMap); } else if ((valueNode = node as ValueAnimatedNode) != null) { propsMap.Add(entry.Key, valueNode.Value); } else { throw new InvalidOperationException( Invariant($"Unsupported type of node used in property node '{node.GetType()}'.")); } } // TODO: Reuse propsMap and stylesDiffMap objects - note that in // subsequent animation steps for a given node most of the time // will be creating the same set of props (just with different // values). We can take advantage on that and optimize the way we // allocate property maps (we also know that updating view props // doesn't retain a reference to the styles object). uiImplementation.SynchronouslyUpdateViewOnDispatcherThread( ConnectedViewTag, new ReactStylesDiffMap(propsMap)); }