enisn / Xamarin.Forms.InputKit

CheckBox, Radio Button, Labeled Slider, Dropdowns etc.
MIT License
584 stars 98 forks source link

Support all VisualStates #297

Open enisn opened 1 year ago

enisn commented 1 year ago

CheckBox Disabled style can't be customized since Checkbox doesn't go to Disabled Visual State state.

Following style doesn't affect CheckBox's disabled state.

   <Setter Property="VisualStateManager.VisualStateGroups">
    <VisualStateGroupList>
        <VisualStateGroup x:Name="CommonStates">
            <VisualState x:Name="Disabled">
                <VisualState.Setters>
                    <Setter Property="Color" Value="{AppThemeBinding Light={t:DynamicColor Color={StaticResource OnSurface}, Opacity=0.12},Dark={t:DynamicColor Color={StaticResource OnSurfaceDark}, Opacity=0.12}}"/>
                    <Setter Property="TextColor" Value="{AppThemeBinding Light={t:DynamicColor Color={StaticResource OnSurface}, Opacity=0.38},Dark={t:DynamicColor Color={StaticResource OnSurfaceDark}, Opacity=0.38}}"/>
                </VisualState.Setters>
            </VisualState>
        </VisualStateGroup>
    </VisualStateGroupList>
</Setter>