1iveowl / Plugin.SegmentedControl

MIT License
170 stars 29 forks source link

Background color not updating on Windows #103

Open btschumy opened 3 years ago

btschumy commented 3 years ago

I am using Plugin.SegmentedControl in an iOS/Android/UWP app. While the app is running, I need to change the colors of the segmented control. Here is the code:

        if (Utility.NightVision)
        {
            segmentedControl.TintColor = new Color(0.8, 0.0, 0.0, 0.75);
        }
        else
        {
            segmentedControl.TintColor = new Color(0.8, 0.8, 0.5, 0.75);
        }

        segmentedControl.BackgroundColor = segmentedControl.TintColor;

This doesn't work on Windows. It appears the BackGroundColor isn't updated. If I quit the app and restart it with the new colors, then they are used. So it seems to only be a problem changing BackGroundColor in a running app on UWP.

Any thoughts on how to fixe this? I've tries a bunch of hacks like disabling and re-enabling the control, but nothing gets the new background color to be used.

1iveowl commented 2 years ago

Sounds like a change event not being caught/fired. Feel free to create PR if you can locate the issue.

Thank you.