Ejemplo n.º 1
0
        /// <summary>
        /// Processes the control tree.
        /// </summary>
        private void ProcessControlTreeCore(DotvvmBindableObject control, Action <DotvvmBindableObject> action)
        {
            // if there is a DataContext binding, locate the correct token
            var hasDataContext = false;
            var pathValue      = control.GetDataContextPathFragment();

            if (pathValue != null)
            {
                CurrentPath.Push(pathValue as string);
                RefreshCurrentPathArray();
                hasDataContext = true;
            }

            action(control);

            // go through all children
            foreach (var child in control.GetLogicalChildren())
            {
                ProcessControlTreeCore(child, action);
            }

            if (hasDataContext)
            {
                CurrentPath.Pop();
                RefreshCurrentPathArray();
            }
        }