Repository: AvaloniaUI/Avalonia
File: src/Avalonia.Controls/Control.cs (C#)

Code before:
        };

        /// <summary>
        /// Schedules <see cref="OnLoadedCore"/> to be called for this control.
        /// For performance, it will be queued with other controls.
        /// </summary>
        internal void ScheduleOnLoadedCore()
        {
            if (_isLoaded == false)
            {
                bool isAdded = _loadedQueue.Add(this);

                if (isAdded &&
                    _isLoadedProcessing == false)
                {
                    _isLoadedProcessing = true;
                    Dispatcher.UIThread.Post(loadedProcessingAction!, DispatcherPriority.Loaded);
                }
            }
        }

        /// <summary>
        /// Invoked as the first step of marking the control as loaded and raising the
        /// <see cref="Loaded"/> event.
        /// </summary>
        internal virtual void OnLoadedCore()
        {
            if (_isLoaded == false &&
                ((ILogical)this).IsAttachedToLogicalTree)
            {
                _isLoaded = true;
                OnLoaded();
            }
        }

        /// <summary>
        /// Invoked as the first step of marking the control as unloaded and raising the
        /// <see cref="Unloaded"/> event.
        /// </summary>
        internal void OnUnloadedCore()
        {
            if (_isLoaded)
            {
                // Remove from the loaded event queue here as a failsafe in case the control
                // is detached before the dispatcher runs the Loaded jobs.
                _loadedQueue.Remove(this);

                _isLoaded = false;
                OnUnloaded();
            }
        }

Review comment (suggestion):
```suggestion
        internal void OnLoadedCore()
```

Code after:
        };

        /// <summary>
        /// Schedules <see cref="OnLoadedCore"/> to be called for this control.
        /// For performance, it will be queued with other controls.
        /// </summary>
        internal void ScheduleOnLoadedCore()
        {
            if (_isLoaded == false)
            {
                bool isAdded = _loadedQueue.Add(this);

                if (isAdded &&
                    _isLoadedProcessing == false)
                {
                    _isLoadedProcessing = true;
                    Dispatcher.UIThread.Post(loadedProcessingAction!, DispatcherPriority.Loaded);
                }
            }
        }

        /// <summary>
        /// Invoked as the first step of marking the control as loaded and raising the
        /// <see cref="Loaded"/> event.
        /// </summary>
        internal void OnLoadedCore()
        {
            if (_isLoaded == false &&
                ((ILogical)this).IsAttachedToLogicalTree)
            {
                _isLoaded = true;
                OnLoaded();
            }
        }

        /// <summary>
        /// Invoked as the first step of marking the control as unloaded and raising the
        /// <see cref="Unloaded"/> event.
        /// </summary>
        internal void OnUnloadedCore()
        {
            if (_isLoaded)
            {
                // Remove from the loaded event queue here as a failsafe in case the control
                // is detached before the dispatcher runs the Loaded jobs.
                _loadedQueue.Remove(this);

                _isLoaded = false;
                OnUnloaded();
            }
        }