--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:d="http://xamarin.com/schemas/2014/forms/design"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ mc:Ignorable="d"
+ xmlns:local="clr-namespace:Xamarin.Forms.Xaml.UnitTests"
+ x:Class="Xamarin.Forms.Xaml.UnitTests.Issue6280"
+ x:DataType="local:Issue6280ViewModel">
+ <Entry x:Name="_entry"
+ Text="{Binding NullableInt}"
+ VerticalOptions="Start" />
+</ContentPage>
\ No newline at end of file
--- /dev/null
+using NUnit.Framework;
+using Xamarin.Forms.Core.UnitTests;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Issue6280 : ContentPage
+ {
+ public Issue6280() => InitializeComponent();
+ public Issue6280(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [SetUp] public void Setup() => Device.PlatformServices = new MockPlatformServices();
+ [TearDown] public void TearDown() => Device.PlatformServices = null;
+
+ [Test]
+ public void BindingToNullable([Values(false, true)]bool useCompiledXaml)
+ {
+ var vm = new Issue6280ViewModel();
+ var page = new Issue6280(useCompiledXaml) { BindingContext = vm };
+ page._entry.SetValueFromRenderer(Entry.TextProperty, 1);
+ Assert.AreEqual(vm.NullableInt, 1);
+ }
+ }
+ }
+
+ public class Issue6280ViewModel
+ {
+ public int? NullableInt { get; set; }
+ }
+}
\ No newline at end of file