private void SelectNextFragment()
        {
            var nextCodeFragment = FlatList.Find(CurrentCodeFragment)?.Next?.Value;

            if (nextCodeFragment != null)
            {
                if (!CodeFragments.Contains(nextCodeFragment))
                {
                    //if the next code fragment is not at the root level, set the root level parent to active
                    var parent = FindRelatedParent(nextCodeFragment);
                    if (parent != null)
                    {
                        parent.IsActive = true;
                    }
                }

                nextCodeFragment.IsSelected = true;
            }
        }
        private void SelectPreviousFragment()
        {
            var previousCodeFragment = FlatList.Find(CurrentCodeFragment).Previous.Value;

            if (previousCodeFragment != null)
            {
                if (!CodeFragments.Contains(previousCodeFragment))
                {
                    //if the next code fragment is not at the root level, set the root level parent to active
                    var parent = FindRelatedParent(previousCodeFragment);
                    if (parent != null)
                    {
                        parent.IsActive = true;
                    }
                }

                previousCodeFragment.IsSelected = true;
            }
        }