I have a Xamarin forms application and in my form i have a code that displays a colour text and color like shown below:
<StackLayout HorizontalOptions="EndAndExpand">
<Frame
Padding="0"
BorderColor="#EBEBEB"
CornerRadius="20"
HasShadow="False"
HorizontalOptions="FillAndExpand">
<StackLayout
HorizontalOptions="FillAndExpand"
Orientation="Horizontal"
VerticalOptions="CenterAndExpand">
<Label
Margin="20,15,35,15"
FontSize="14"
HorizontalOptions="StartAndExpand"
Text="Color"
TextColor="Black"
VerticalTextAlignment="Center">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="SFPro.ttf#Bold" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Frame
Margin="35,15,20,15"
Padding="0"
BackgroundColor="#33427D"
CornerRadius="8"
HasShadow="False"
HeightRequest="22"
WidthRequest="22" />
</StackLayout>
</Frame>
</StackLayout>
This generates a view like this:
However now I need to connect it to the binding on the item.AvailableColors
to which this control is bound to generate the view that looks as below:
public string[] AvailableColors
{
get
{
string[] result = { "red", "blue", "green", "black" };
return result;
}
}
How can I change my code to generate the changes to the view?