コード例 #1
0
        /// <summary>
        /// Invoked when the native view that corresponds to a root node has
        /// its size changed.
        /// </summary>
        /// <param name="rootViewTag">The root view tag.</param>
        /// <param name="newWidth">The new width.</param>
        /// <param name="newHeight">The new height.</param>
        public void UpdateRootNodeSize(
            int rootViewTag,
            double newWidth,
            double newHeight)
        {
            var rootCssNode = _shadowNodeRegistry.GetNode(rootViewTag);

            rootCssNode.StyleWidth  = (float)newWidth;
            rootCssNode.StyleHeight = (float)newHeight;

            // If we're in the middle of a batch, the change will be
            // automatically dispatched at the end of the batch. The event
            // queue should always be empty, but that is an implementation
            // detail.
            if (_operationsQueue.IsEmpty())
            {
                DispatchViewUpdates(-1 /* no associated batch id */);
            }
        }