0
votes

I want to create in xamarin forms value converter for Rg Plugins Popup it should show Yes or No (True/False) but when I compile it shows:

Position 14:14. Type cnv:BoolToStringConverter not found in xmlns clr-namespace:RodoAcceptance.Converters;assembly=RodoAcceptance RodoAcceptance

This is XAML View and value converter

enter image description here

Code behind:

enter image description here

enter image description here

1
please do NOT post code or errors as imagesJason
- docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/… have not supplied a TypeArgument for <T>Jason

1 Answers

0
votes

If your converter has a TypeArgument <T>, you should use it in following way:

<Label>
    <Label.Text>
        <Binding Source="{x:Reference switch1}"
                     Path="IsToggled">
            <Binding.Converter>
                <local:BoolToObjectConverter x:TypeArguments="x:String"
                                                 TrueObject="Of course!"
                                                 FalseObject="No way!" />
            </Binding.Converter>
        </Binding>
    </Label.Text>
</Label>