当前,我有一个滑块,允许用户将其分数提交到Azure数据库中,为此,用户必须将滑块移至其先前分数的任意数字。我现在想更改此设置,以使用户现在能够提交与以前的分数相同的分数。
这是我的滑块代码:
<local:ExtendedRangeSlider
RangeEnd="100"
Name="{Binding Usersymptomid}"
Value="{Binding Lastfeedbackscore}"
RangeStart="100"
ShowValueLabel="false"
ShowRange="false"
TrackSelectionThickness="3"
HeightRequest="40"
StepFrequency="1"
Grid.Row="4"
TickFrequency="10"
Grid.Column="0"
TickPlacement="BottomRight"
Grid.ColumnSpan="2"
Orientation="Horizontal"
Margin="0,0,0,8"
ValueChanging="Handle_ValueChanging"/>
我的提交按钮:
async void SubmitFeedback_Clicked(object sender, EventArgs e)
{
var response = await DisplayAlert("Confirm Symptom Intensity", "Are you sure you want to change symptom intensity to " + rangeSlider.Value.ToString() + "?", "Cancel", "OK");
if (response == false)
{
await AddSymptomFeedback(rangeSlider.IDValue, rangeSlider.Value.ToString());
}
else
{
await Navigation.PushAsync(new newviewsymptom());
return;
}
}
代码最初为用户提供了一条错误消息,要求他们更改值并且没有发布到数据库中,我尝试注释掉该部分,但是除非更改了滑块的值,否则什么也不会发生。