ios - How to set the value of a slider without triggering the ValueChanged event again in C# in Xamarin? -
I need to update slider controls because I'm implementing values in steps 5. But, when I set the value in the value converted event, the event is resumed, how can I set the slider value of the ValueChanged event without triggering it again?
Partial Zero Slip_Wolves converted (UISlider sender) {float newStep = (float) Math.Round ((sender.Value) / _stepValue); Sender.Value = newStep * _stepValue; // & amp; Lt; ------- triggers event again // Sessional .set value (new stop * _step value, wrong); // nsnumber number = newstep * _step value; //sender.SetValueForKey (number, new NSString ("value")); This.lblTip.Text = sender.Value.ToString () + "% Tip"; } In the original Objective-C, you can set the value of a UISlider exactly without the trigger event:
Slider Set Value: Self.tip;
I do not think you can do it but if you want to do whatever you want, It can be prevented from infinity, it should be quite simple.
Partial Zero Slip_Volice Converted (UISLider Sender) {Float Newstop = (Float) Math. Round ((sender value) / _step value); Float newValue = newStep * _stepValue; If (sender.Value! = NewValue) {sender.Value = newValue; This.lblTip.Text = sender.Value.ToString () + "% Tip"; }}
Comments
Post a Comment