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

Unable to bind a DateTime object to a Label ?

$
0
0

Hi,

I'm using this code:

public class DemoCell : ViewCell
{
public DemoCell()
{
var dateLabel = new Label();
dateLabel.SetBinding(Label.TextProperty, "Date");
//dateLabel.SetBinding(Label.TextProperty, "DateAsString");

        var viewLayout = new StackLayout { Children = { dateLabel } };

        View = viewLayout;
    }
}

But nothing is displayed on screen. If I uncomment the line:

dateLabel.SetBinding(Label.TextProperty, "DateAsString");

It works (but I need, on that case, to extend the entity object to define a DateAsString property that's not really needed).

A repro is attached: is it a known bug ? A normal behavior ?

Thanks!


Viewing all articles
Browse latest Browse all 58056

Trending Articles