Skip to content

Commit

Permalink
fix EntryCell null reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kamu authored and kamu committed Apr 9, 2018
1 parent 922f8be commit 5381782
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 40 deletions.
32 changes: 16 additions & 16 deletions Sample/Sample.Droid/Sample.Droid.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.props')" />
<Import Project="..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -140,29 +140,29 @@
<Reference Include="System.Reactive.Interfaces">
<HintPath>..\packages\System.Reactive.Interfaces.3.0.0\lib\netstandard1.0\System.Reactive.Interfaces.dll</HintPath>
</Reference>
<Reference Include="AiForms.Effects">
<HintPath>..\packages\AiForms.Effects.1.2.0\lib\MonoAndroid\AiForms.Effects.dll</HintPath>
</Reference>
<Reference Include="AiForms.Effects.Droid">
<HintPath>..\packages\AiForms.Effects.1.2.0\lib\MonoAndroid\AiForms.Effects.Droid.dll</HintPath>
</Reference>
<Reference Include="AiForms.Layouts">
<HintPath>..\packages\AiForms.Layouts.1.0.4\lib\netstandard1.1\AiForms.Layouts.dll</HintPath>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="AiForms.Effects">
<HintPath>..\packages\AiForms.Effects.1.2.0\lib\MonoAndroid\AiForms.Effects.dll</HintPath>
</Reference>
<Reference Include="AiForms.Effects.Droid">
<HintPath>..\packages\AiForms.Effects.1.2.0\lib\MonoAndroid\AiForms.Effects.Droid.dll</HintPath>
</Reference>
<Reference Include="AiForms.Layouts">
<HintPath>..\packages\AiForms.Layouts.1.0.4\lib\netstandard1.1\AiForms.Layouts.dll</HintPath>
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -222,5 +222,5 @@
<Import Project="..\packages\Xamarin.Android.Support.v7.AppCompat.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.AppCompat.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.AppCompat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Design.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Design.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Design.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Design.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.MediaRouter.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.v7.MediaRouter.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.targets')" />
</Project>
2 changes: 1 addition & 1 deletion Sample/Sample.Droid/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@
<package id="Xamarin.Android.Support.v7.Palette" version="25.4.0.2" targetFramework="monoandroid80" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="25.4.0.2" targetFramework="monoandroid80" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="25.4.0.2" targetFramework="monoandroid80" />
<package id="Xamarin.Forms" version="2.5.0.280555" targetFramework="monoandroid81" />
<package id="Xamarin.Forms" version="2.5.1.444934" targetFramework="monoandroid81" />
<package id="Xamarin.Forms.Svg" version="0.0.1-pre" targetFramework="monoandroid71" />
</packages>
28 changes: 14 additions & 14 deletions Sample/Sample.iOS/Sample.iOS.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.props')" />
<Import Project="..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
Expand Down Expand Up @@ -128,18 +128,6 @@
<Reference Include="Microsoft.Practices.ServiceLocation">
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.5.0.280555\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="AiForms.Effects">
<HintPath>..\packages\AiForms.Effects.1.2.0\lib\Xamarin.iOS10\AiForms.Effects.dll</HintPath>
</Reference>
Expand All @@ -149,6 +137,18 @@
<Reference Include="AiForms.Layouts">
<HintPath>..\packages\AiForms.Layouts.1.0.4\lib\netstandard1.1\AiForms.Layouts.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS">
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.2.5.1.444934\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Sample\Sample.csproj">
Expand Down Expand Up @@ -184,5 +184,5 @@
<BundleResource Include="Resources\icon%403x.png" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.280555\build\netstandard1.0\Xamarin.Forms.targets')" />
<Import Project="..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.1.444934\build\netstandard1.0\Xamarin.Forms.targets')" />
</Project>
2 changes: 1 addition & 1 deletion Sample/Sample.iOS/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="xamarinios10" />
<package id="System.Xml.ReaderWriter" version="4.0.11" targetFramework="xamarinios10" />
<package id="Unity" version="4.0.1" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="2.5.0.280555" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="2.5.1.444934" targetFramework="xamarinios10" />
<package id="Xamarin.Forms.Svg" version="0.0.1-pre" targetFramework="xamarinios10" />
</packages>
2 changes: 1 addition & 1 deletion Sample/Sample/Sample.nuget.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xamarin.forms/2.5.0.280555/build/netstandard1.0/Xamarin.Forms.props" Condition="Exists('$(NuGetPackageRoot)xamarin.forms/2.5.0.280555/build/netstandard1.0/Xamarin.Forms.props')" />
<Import Project="$(NuGetPackageRoot)xamarin.forms/2.5.1.444934/build/netstandard1.0/Xamarin.Forms.props" Condition="Exists('$(NuGetPackageRoot)xamarin.forms/2.5.1.444934/build/netstandard1.0/Xamarin.Forms.props')" />
</ImportGroup>
</Project>
2 changes: 1 addition & 1 deletion Sample/Sample/Sample.nuget.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)xamarin.forms/2.5.0.280555/build/netstandard1.0/Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)xamarin.forms/2.5.0.280555/build/netstandard1.0/Xamarin.Forms.targets')" />
<Import Project="$(NuGetPackageRoot)xamarin.forms/2.5.1.444934/build/netstandard1.0/Xamarin.Forms.targets" Condition="Exists('$(NuGetPackageRoot)xamarin.forms/2.5.1.444934/build/netstandard1.0/Xamarin.Forms.targets')" />
</ImportGroup>
</Project>
8 changes: 7 additions & 1 deletion Sample/Sample/ViewModels/EntryCellTestViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using Reactive.Bindings;
using Xamarin.Forms;
using Prism.Navigation;

namespace Sample.ViewModels
{
public class EntryCellTestViewModel:ViewModelBase
public class EntryCellTestViewModel:ViewModelBase,IDestructible
{
public ReactiveProperty<Color> OwnAccentColor { get; } = new ReactiveProperty<Color>();
public ReactiveProperty<int> MaxLength { get; } = new ReactiveProperty<int>();
Expand Down Expand Up @@ -58,5 +59,10 @@ protected override void CellChanged(object obj)
break;
}
}

public void Destroy()
{
InputText.Dispose();
}
}
}
2 changes: 1 addition & 1 deletion Sample/Sample/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"System.Reactive.Linq": "3.0.0",
"System.Reactive.PlatformServices": "3.0.0",
"Unity": "4.0.1",
"Xamarin.Forms": "2.5.0.280555",
"Xamarin.Forms": "2.5.1.444934",
"Xamarin.Forms.Svg": "0.0.1-pre"
},
"frameworks": {
Expand Down
4 changes: 2 additions & 2 deletions SettingsView/Cells/EntryCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ static void ValueTextPropertyChanging(BindableObject bindable, object oldValue,
var maxlength = (int)bindable.GetValue(MaxLengthProperty);
if (maxlength < 0) return;

var newString = newValue.ToString();
var newString = newValue?.ToString() ?? string.Empty;
if (newString.Length > maxlength) {
var oldString = oldValue.ToString();
var oldString = oldValue?.ToString() ?? string.Empty;
if(oldString.Length > maxlength){
var trimStr = oldString.Substring(0, maxlength);
bindable.SetValue(ValueTextProperty, trimStr);
Expand Down
4 changes: 2 additions & 2 deletions nuget/SettingsView_mac.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>AiForms.SettingsView</id>
<version>0.2.3</version>
<version>0.2.4</version>
<title>SettingsView for Xamarin.Forms</title>
<authors>kamu</authors>
<owners>kamu</owners>
Expand All @@ -16,7 +16,7 @@ There are various cells such as (LabelCell,ButtonCell,CommandCell,SwitchCell,Che
<releaseNotes>
## Bug fixes

* [NumberPickerCell][iOS] sometimes crash depending on the order which min and max value is bound.
* [EntryCell] Null exception in ValueTextChanging.
</releaseNotes>
<tags>Xamarin.Forms TableView Cell Setting Configuration Option ListView UITableView RecyclerView ReOrder DragDrop</tags>
<language>en-US</language>
Expand Down

0 comments on commit 5381782

Please sign in to comment.