RateGroup - Phenek/Global.InputForms GitHub Wiki

RateGroup:

Rate Group is a StackLayout with a top Label

Property Description
ItemsSource Gets or sets the source of items to template and display.
CheckTemplate Gets or sets the DataTemplate to apply to the ItemsSource. (Icheckable)
DefaultIndex The default checked index at the begining (default 0)
SelectedIndex The selected checked index
SelectedItem The selected checked Item (Key/Value Pair)
LabelText (Item.Value) LabelFontAttributes, LabelFontFamily, LabelFontSize, LabelTextColor, etc..

SAMPLE Checktemplate in Ressource dictionnary:

<Application xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:global="clr-namespace:Global.InputForms;assembly=Global.InputForms"
             x:Class="SampleApp.App">
    <Application.Resources>
        <ResourceDictionary>

             <ControlTemplate x:Key="IconRateImage">
                <global:CheckBox CheckType="Image" ImageChecked="StarChecked" ImageUnchecked="StarUnchecked"
                                   IconSize="20" Padding="5,0,5,0" />
            </ControlTemplate>

            <ControlTemplate x:Key="IconCustomRate">
                <global:CheckBox CheckType="Custom" CheckedLabel="" UncheckedLabel=""
                                   CheckLabelFontSize="30"
                                   IconSize="30"
                                   LabelIsVisible="false"
                                   Color="LightGray"
                                   BorderColor="Transparent"
                                   BackgroundColor="Transparent"
                                   CheckedColor="#FFD700"
                                   CheckedBorderColor="Transparent"
                                   CheckedBackgroundColor="Transparent"
                                   CheckLabelFontAttributes="None">
                    <global:CheckBox.CheckLabelMargin>
                        <OnPlatform x:TypeArguments="Thickness">
                            <On Platform="iOS" Value="0" />
                            <On Platform="Android, WinPhone, Windows" Value="0,-10,0,0" />
                        </OnPlatform>
                    </global:CheckBox.CheckLabelMargin>
                </global:CheckBox>
            </ControlTemplate>
            
        </ResourceDictionary>
    </Application.Resources>
</Application>
<global:RateGroup DefaultIndex="0"
                    ItemsSource="{Binding Rates}"
                    VerticalOptions="CenterAndExpand"
                    CheckTemplate="{StaticResource IconCustomRate}" />
<global:RateGroup DefaultIndex="0"
                    ItemsSource="{Binding Rates}"
                    VerticalOptions="CenterAndExpand"
                    CheckTemplate="{StaticResource IconRateImage}" />
⚠️ **GitHub.com Fallback** ⚠️