How I send an static value inside ConverterParameter such as a number?
<Label Style="{DynamicResource ListItemDetailTextStyle}" Text="{Binding Information, Converter={StaticResource CutStringConverter}, ConverterParameter={100}}" />
You probably need to include the type then. So either do it inline like this: ConverterParameter={x:Int32 100}
.
Or write it more verbose:
<Label>
<Label.Text>
<Binding Path="Information" Converter="{StaticResource CutStringConverter}">
<Binding.ConverterParameter>
<x:Int32>100</x:Int32>
</Binding.ConverterParameter>
</Binding>
</Label.Text>
</Label>
Or, to be complete, add a static resource to your page (or whatever the container is), like:
<ContentPage.Resources>
<x:Int32 x:Key="IntHundred">100</x:Int32>
</ContentPage.Resources>
And reference that: ConverterParameter={StaticResource IntHundred}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With