Xamarin-Forms-RadialProgress icon indicating copy to clipboard operation
Xamarin-Forms-RadialProgress copied to clipboard

[Bug][iOS] Canvas not redrawing

Open isness opened this issue 4 years ago • 1 comments

I have a slightly modified code based on your approach, but on iOS I can't get the progress bar to be redrawn. On Android everything works fine.

<Slider x:Name="sweepAngleSlider"
        ValueChanged="sliderValueChanged"
        Minimum="0"
        Maximum="360"
        IsVisible="false" />

I noticed that sliderValueChanged is not fired, and then even if I call it after every progress update canvas is not redrawn. Basically, this code does nothing:

void sliderValueChanged(object sender, ValueChangedEventArgs args)
{
    if (canvasView != null)
    {
        canvasView.InvalidateSurface();
    }
}

I don't know why it fails only on iOS. What could I possibly try to find the problem?

isness avatar Apr 03 '21 12:04 isness

The workaround is not to assign a value to sweepAngleSlider in code, but to bind its value to a property like this:

<Slider x:Name="sweepAngleSlider"
                            Value="{Binding SliderValue}"
                            ValueChanged="sliderValueChanged"
                            Minimum="0"
                            Maximum="360"
                            IsVisible="false" />

isness avatar Apr 04 '21 18:04 isness