abstract class BaseToggleView extends inkLogicController
{
	protected var m_ToggleController : weak< inkToggleController >;
	protected var m_OldState : inkEToggleState;

	protected event OnInitialize()
	{
		m_ToggleController = ( ( inkToggleController )( GetControllerByType( 'inkToggleController' ) ) );
		if( m_ToggleController )
		{
			m_ToggleController.RegisterToCallback( 'OnButtonStateChanged', this, 'OnButtonStateChanged' );
			m_OldState = m_ToggleController.GetToggleState();
			ToggleStateChanged( m_OldState, m_ToggleController.GetToggleState() );
		}
	}

	protected event OnButtonStateChanged( controller : weak< inkButtonController >, oldState : inkEButtonState, newState : inkEButtonState )
	{
		var newToggleState : inkEToggleState;
		newToggleState = m_ToggleController.GetToggleState();
		ToggleStateChanged( m_OldState, newToggleState );
		m_OldState = newToggleState;
	}

	protected virtual function ToggleStateChanged( oldState : inkEToggleState, newState : inkEToggleState ) {}

	public function GetParentButton() : weak< inkToggleController >
	{
		return m_ToggleController;
	}

}

