Bug 35158 - Binding to an int? doesn't work
Summary: Binding to an int? doesn't work
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.0
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Stephane Delcroix
URL:
Depends on:
Blocks:
 
Reported: 2015-10-22 08:01 UTC by mgwalm
Modified: 2016-04-13 18:32 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description mgwalm 2015-10-22 08:01:17 UTC
If I bind an entry to a int? the setter is never called, eg
in my view model which implements INPC
    public int? Pin1
    {
      get
      {
        return _pin1;
      }
      set
      {
        SetProperty(ref _pin1, value);
      }
    }

    private int? _pin1;
in my VIEW
          <Entry x:Name="Pin1" Text="{Binding Pin1, Mode=TwoWay}"
                               WidthRequest="20" 
                                />
THE SETTER NEVER GETS CALLED.

IF I CHNAHGE PIN1 TO STRING THE SETTER GETS CALLED.

    public string Pin1
    {
      get
      {
        return _pin1;
      }
      set
      {
        SetProperty(ref _pin1, value);
      }
now the setter gets called
Comment 1 Stephane Delcroix 2015-11-02 10:00:28 UTC
Does it work if your property is of type int (non-nullable) ?
Comment 2 Samantha Houts [MSFT] 2016-04-13 18:32:58 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team