<commit_before>using Fuse.Triggers;

namespace Fuse.Controls
{
	public enum NavigationControlBlockInput
	{
		/** Input is not blocked */
		Never,
		/** Input is blocked during navigation -- when `WhileNavigating` would be active */
		WhileNavigating,
	}
	
	public abstract partial class NavigationControl
	{
		NavigationControlBlockInput _blockInput = NavigationControlBlockInput.WhileNavigating;
		/**
			Whether or not input to block input to the pages during navigation.
			
			The default is `WhileNavigating`: the pages will not get any pointer input during navigation.
		*/
		public NavigationControlBlockInput BlockInput
		{
			get { return _blockInput; }
			set
			{
				if (_blockInput == value)
					return;
					
				_blockInput = value;
				if (IsRootingCompleted)
					UpdateBlockInput();
			}
		}

		Trigger _blockInputTrigger;
		void BlockInputRooted()
		{
			UpdateBlockInput();
		}
		
		
		void BlockInputUnrooted()
		{
			UpdateBlockInput(true);
		}
		
		void UpdateBlockInput(bool forceOff = false)
		{
			if (forceOff || _blockInput == NavigationControlBlockInput.Never)
			{
				if (_blockInputTrigger != null)
				{
					Children.Remove(_blockInputTrigger);
					_blockInputTrigger = null;
				}
			}
			else if (_blockInputTrigger == null)
			{
				_blockInputTrigger = new NavigationInternal.BlockInputWhileNavigating(this);
				Children.Add(_blockInputTrigger);
			}
		}
	}
}
<commit_msg>improve structure of enabled/disable block input<commit_after>using Fuse.Triggers;

namespace Fuse.Controls
{
	public enum NavigationControlBlockInput
	{
		/** Input is not blocked */
		Never,
		/** Input is blocked during navigation -- when `WhileNavigating` would be active */
		WhileNavigating,
	}
	
	public abstract partial class NavigationControl
	{
		NavigationControlBlockInput _blockInput = NavigationControlBlockInput.WhileNavigating;
		/**
			Whether or not input to block input to the pages during navigation.
			
			The default is `WhileNavigating`: the pages will not get any pointer input during navigation.
		*/
		public NavigationControlBlockInput BlockInput
		{
			get { return _blockInput; }
			set
			{
				if (_blockInput == value)
					return;
					
				_blockInput = value;
				if (IsRootingCompleted)
					UpdateBlockInput();
			}
		}

		Trigger _blockInputTrigger;
		void BlockInputRooted()
		{
			UpdateBlockInput();
		}
		
		void BlockInputUnrooted()
		{
			DisableBlockInput();
		}
		
		void UpdateBlockInput()
		{
			if (_blockInput == NavigationControlBlockInput.Never)
				DisableBlockInput();
			else
				EnableBlockInput();
		}
			
		void DisableBlockInput()
		{
			if (_blockInputTrigger != null)
			{
				Children.Remove(_blockInputTrigger);
				_blockInputTrigger = null;
			}
		}
		
		void EnableBlockInput()
		{
			if (_blockInputTrigger == null)
			{
				_blockInputTrigger = new NavigationInternal.BlockInputWhileNavigating(this);
				Children.Add(_blockInputTrigger);
			}
		}
	}
}

{'fraction_non_alphanumeric': 0.08245315161839864, 'fraction_numerical': 0.0, 'mean_word_length': 3.3560830860534123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6613995', 'n_tokens_mistral': 1084, 'n_tokens_neox': 834, 'n_words': 214}