Hello @Daniel Salami ,
You can add the Entry on the page and set IsVisible
false, then set IsVisible
true according to user's response. You can refer to the following code :
XAML
<VerticalStackLayout
>
<Label
Text="Question 1"
FontSize="18"/>
<Entry x:Name="Question1Entry" Placeholder="Please enter the answer"></Entry>
<StackLayout x:Name="SecondQuestionLayout" IsVisible="false">
<Label
Text="Question 2"
FontSize="18"
/>
<Entry Placeholder="Please enter the answer"></Entry>
</StackLayout>
<Button
x:Name="CounterBtn"
Text="Add"
Clicked="OnCounterClicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
"Add" button click event
private void OnCounterClicked(object sender, EventArgs e)
{
if ( Question1Entry.Text == "111")// base on the response, show the next entry
{
SecondQuestionLayout.IsVisible = true;
}
else
{
//go to the next page
}
}
It's recommended that you use Data binding and MVVM and handle logic in the ViewModel..
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.