Ich verwende this Steuerelement von XLabs-Projekt. Binding und Auswahl funktioniert gut, aber ich verwende dieses Steuerelement in einer Art von Umfrage und ich möchte die vorherige Antwort (Option in diesem Steuerelement) nach Client klicken Sie auf Next
Schaltfläche, um die nächste Frage zu sehen. Irgendwelche Ideen wie man das macht?Deaktivieren der Option von BindableRadioGroup in Xamarin.Forms
<controls:BindableRadioGroup
ItemsSource="{Binding Answers}"
SelectedIndex="{Binding AnswerSelected, Mode=TwoWay}"
Style="{StaticResource radioGroupStyle}" />
Der Befehl an die Taste binded:
public IAsyncCommand NextCommand
{
get
{
return new AwaitableDelegateCommand(async() => await Next(), CanGoToNextQuestion);
}
}
und Methoden:
private async Task Next()
{
CurrentQuestionIndex++;
AnsweredQuestions.Add(
new QuestionDto
{
QuestionId = CurrentQuestion.QuestionId,
QuestionText = CurrentQuestion.QuestionText,
Answer = Answers.ElementAt(AnswerSelected).Value,
});
// some stuff here
AnswerSelected = -1;
}
private bool CanGoToNextQuestion()
{
return AnswerSelected != -1;
}