Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms Binding Nullable double to Entry

$
0
0

Hello everyone,

I'm trying to bind a nullable double to an Entry like this :

private double? nicotineRate; public double? NicotineRate { get { return nicotineRate; } set { nicotineRate = value; SetProperty(ref nicotineRate, value); } }

<Entry Placeholder="Nicotine rate" Text="{Binding NicotineRate}" Keyboard="Numeric" HorizontalTextAlignment="Center"></Entry>

But i'm not able to obtains a value on my "NicotineRate" property.

I think it's because Xamarin.Forms does not bind those controls to nullable values. Is it possible to do this with the help of a custom renderer, or a converter ?

My need is to provide a form with empty entries with visible placeholders at initialization, this is why i need to bind to nullable values.

Thank you !


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>