How to disable router When BackButton is Clicked?

How can I disable router, when the back button is clicked during some status, is true?
I tried this page to fix up what I mentioned above, but it is still activated when the back button is clicked.

Below are what I tried and if you need any more code which I tried to solve this problem, please let me know.

<StackPanel Padding="0" Dock="Bottom" ux:Name="RegionSelectPanel" Height="420">
	...	
	<WhileFalse Value="{regionSelectVisible}" ux:Name="RegionSelectorStatus">
		<Change RegionSelectPanel.Height="0" EasingBack="QuarticIn" Duration="0.6" DurationBack="0.9"/>
	</WhileFalse>
	<WhileTrue Value="{regionSelectVisible}">
		<OnBackButton>
			<Set RegionSelectorStatus.Value="false"/>
		</OnBackButton>
	</WhileTrue>
</StackPannel>
<Page>
        ...
        <WhileFalse Value="{regionSelectVisible}">
                <OnBackButton Handler="{handleGoBack}" />
        </WhileFalse>
</Page>
function toggleRegionPanel(){
	regionSelectVisible.value = !regionSelectVisible.value;
}
function handleGoBack(){
	router.goBack();
	console.log('goback!');
}

Hi dhguswns23,

it’s not clear what you mean by disable router. You might want to rephrase your question.

If you’re asking if there is a way to not react on hardware back button pressed, then your approach with wrapping OnBackButton inside of a WhileTrue/WhileFalse seems to be correct.

However, those code snippets help very little - you need to make a minimal, self-contained reproduction (“copy-paste and run” single-UX-file app) and someone will give that a go.