Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 869c620

Browse files
Replaced NuGet Package with NetStandard
1 parent 226e409 commit 869c620

File tree

21 files changed

+401
-221
lines changed

21 files changed

+401
-221
lines changed
Lines changed: 7 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,11 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
43
<PropertyGroup>
5-
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
6-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8-
<ProjectGuid>{67F9D3A8-F71E-4428-913F-C37AE82CDB24}</ProjectGuid>
9-
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>EntryCustomReturn.Forms.Plugin.Abstractions</RootNamespace>
12-
<AssemblyName>EntryCustomReturn.Forms.Plugin.Abstractions</AssemblyName>
13-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14-
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
15-
<FileAlignment>512</FileAlignment>
16-
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17-
<NuGetPackageImportStamp>
18-
</NuGetPackageImportStamp>
4+
<TargetFramework>netstandard1.0</TargetFramework>
195
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
</PropertyGroup>
29-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30-
<DebugSymbols>true</DebugSymbols>
31-
<DebugType>pdbonly</DebugType>
32-
<Optimize>true</Optimize>
33-
<OutputPath>bin\Release\</OutputPath>
34-
<DefineConstants>TRACE</DefineConstants>
35-
<ErrorReport>prompt</ErrorReport>
36-
<WarningLevel>4</WarningLevel>
37-
<DocumentationFile>bin\Release\EntryCustomReturn.Forms.Plugin.Abstractions.xml</DocumentationFile>
38-
</PropertyGroup>
39-
<ItemGroup>
40-
<Compile Include="Effects\CustomReturnEffect.cs" />
41-
<Compile Include="Properties\AssemblyInfo.cs" />
42-
<Compile Include="CustomControls\CustomReturnEntry.cs" />
43-
<Compile Include="Enums\CustomEnums.cs" />
44-
<Compile Include="Effects\EffectConstants.cs" />
45-
<Compile Include="BindablePropertyConstants.cs" />
46-
</ItemGroup>
47-
<ItemGroup>
48-
<Reference Include="Xamarin.Forms.Core">
49-
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
50-
</Reference>
51-
<Reference Include="Xamarin.Forms.Platform">
52-
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
53-
</Reference>
54-
<Reference Include="Xamarin.Forms.Xaml">
55-
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
56-
</Reference>
57-
</ItemGroup>
6+
587
<ItemGroup>
59-
<None Include="packages.config" />
8+
<PackageReference Include="Xamarin.Forms" Version="2.5.0.77107" />
609
</ItemGroup>
61-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
62-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63-
Other similar extension points exist, see Microsoft.Common.targets.
64-
<Target Name="BeforeBuild">
65-
</Target>
66-
<Target Name="AfterBuild">
67-
</Target>
68-
-->
69-
<Import Project="..\..\Tests\packages\Xamarin.Forms.2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\Tests\packages\Xamarin.Forms.2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
70-
<Import Project="..\packages\Xamarin.Forms.2.3.4.224\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.3.4.224\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
71-
<Import Project="..\..\Samples\packages\Xamarin.Forms.2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\Samples\packages\Xamarin.Forms.2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
72-
<Import Project="..\packages\Xamarin.Forms.2.5.0.77107\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.77107\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets')" />
73-
</Project>
10+
11+
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace EntryCustomReturn.Forms.Plugin.Abstractions
2+
{
3+
static class BindablePropertyConstants
4+
{
5+
public const string ReturnTypePropertyName = nameof(ReturnType);
6+
public const string ReturnCommandPropertyName = nameof(CustomReturnEntry.ReturnCommand);
7+
public const string ReturnCommandParameterPropertyName = nameof(CustomReturnEntry.ReturnCommandParameter);
8+
}
9+
}
10+
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using System.Windows.Input;
2+
3+
using Xamarin.Forms;
4+
5+
namespace EntryCustomReturn.Forms.Plugin.Abstractions
6+
{
7+
/// <summary>
8+
/// CustomReturnEntry Interface
9+
/// </summary>
10+
public class CustomReturnEntry : Entry
11+
{
12+
/// <summary>
13+
/// Return Type Property of the Entry
14+
/// </summary>
15+
public static readonly BindableProperty ReturnTypeProperty =
16+
BindableProperty.Create(BindablePropertyConstants.ReturnTypePropertyName, typeof(ReturnType), typeof(CustomReturnEntry), ReturnType.Default);
17+
18+
/// <summary>
19+
/// Command Property that occurs when the user finalizes the text in an entry with the return key
20+
/// </summary>
21+
public static readonly BindableProperty ReturnCommandProperty =
22+
BindableProperty.Create(BindablePropertyConstants.ReturnCommandPropertyName, typeof(ICommand), typeof(CustomReturnEntry));
23+
24+
/// <summary>
25+
/// Backing store for the ReturnCommandParameter bindable property
26+
/// </summary>
27+
public static readonly BindableProperty ReturnCommandParameterProperty =
28+
BindableProperty.Create(BindablePropertyConstants.ReturnCommandParameterPropertyName, typeof(object), typeof(CustomReturnEntry));
29+
30+
/// <summary>
31+
/// Type of the Keyboard Return Key
32+
/// </summary>
33+
public ReturnType ReturnType
34+
{
35+
get => (ReturnType)GetValue(ReturnTypeProperty);
36+
set => SetValue(ReturnTypeProperty, value);
37+
}
38+
39+
/// <summary>
40+
/// Occurs when the user finalizes the text in an entry with the return key
41+
/// </summary>
42+
public ICommand ReturnCommand
43+
{
44+
get => (ICommand)GetValue(ReturnCommandProperty);
45+
set => SetValue(ReturnCommandProperty, value);
46+
}
47+
48+
/// <summary>
49+
/// Gets or sets the ReturnCommand parameter
50+
/// </summary>
51+
public object ReturnCommandParameter
52+
{
53+
get => GetValue(ReturnCommandParameterProperty);
54+
set => SetValue(ReturnCommandParameterProperty, value);
55+
}
56+
}
57+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
using System.Linq;
2+
using System.Windows.Input;
3+
4+
using Xamarin.Forms;
5+
6+
namespace EntryCustomReturn.Forms.Plugin.Abstractions
7+
{
8+
/// <summary>
9+
/// CustomReturnEffect Interface
10+
/// </summary>
11+
public static class CustomReturnEffect
12+
{
13+
/// <summary>
14+
/// Return Type Property of the Keyboard Return Key
15+
/// </summary>
16+
public static readonly BindableProperty ReturnTypeProperty =
17+
BindableProperty.CreateAttached(BindablePropertyConstants.ReturnTypePropertyName,
18+
typeof(ReturnType),
19+
typeof(Entry),
20+
ReturnType.Default,
21+
propertyChanged: OnReturnTypeChanged);
22+
23+
/// <summary>
24+
/// Command that occurs when the user finalizes the text in an entry with the return key
25+
/// </summary>
26+
public static readonly BindableProperty ReturnCommandProperty =
27+
BindableProperty.CreateAttached(
28+
BindablePropertyConstants.ReturnCommandPropertyName,
29+
typeof(ICommand),
30+
typeof(Entry),
31+
null,
32+
propertyChanged: OnReturnCommandPropertyChanged);
33+
34+
/// <summary>
35+
/// Backing store for the ReturnCommandParameter bindable property
36+
/// </summary>
37+
public static readonly BindableProperty ReturnCommandParameterProperty =
38+
BindableProperty.CreateAttached(BindablePropertyConstants.ReturnCommandParameterPropertyName,
39+
typeof(object),
40+
typeof(Entry),
41+
null,
42+
propertyChanged: OnReturnCommandParameterPropertyChanged);
43+
44+
/// <summary>
45+
/// Gets the Type of the Keyboard Return Key
46+
/// </summary>
47+
/// <returns>The return type.</returns>
48+
/// <param name="view">View.</param>
49+
public static ReturnType GetReturnType(BindableObject view) => (ReturnType)view.GetValue(ReturnTypeProperty);
50+
51+
/// <summary>
52+
/// Sets the Type of the Keyboard Return Key
53+
/// </summary>
54+
/// <param name="view">View.</param>
55+
/// <param name="value">Value.</param>
56+
public static void SetReturnType(BindableObject view, ReturnType value) => view.SetValue(ReturnTypeProperty, value);
57+
58+
/// <summary>
59+
/// Gets the Command that occurs when the user finalizes the text in an entry with the return key
60+
/// </summary>
61+
/// <returns>The return type.</returns>
62+
/// <param name="view">View.</param>
63+
public static ICommand GetReturnCommand(BindableObject view) => (ICommand)view.GetValue(ReturnCommandProperty);
64+
65+
/// <summary>
66+
/// Set the Command that occurs when the user finalizes the text in an entry with the return key
67+
/// </summary>
68+
/// <param name="view">View.</param>
69+
/// <param name="value">Value.</param>
70+
public static void SetReturnCommand(BindableObject view, ICommand value) => view.SetValue(ReturnCommandProperty, value);
71+
72+
/// <summary>
73+
/// Gets the backing store for the Command that occurs when the user finalizes the text in an entry with the return key
74+
/// </summary>
75+
/// <returns>The return type.</returns>
76+
/// <param name="view">View.</param>
77+
public static object GetReturnCommandParameter(BindableObject view) => view.GetValue(ReturnCommandParameterProperty);
78+
79+
/// <summary>
80+
/// Set the backing store for the Command that occurs when the user finalizes the text in an entry with the return key
81+
/// </summary>
82+
/// <param name="view">View.</param>
83+
/// <param name="value">Value.</param>
84+
public static void SetReturnCommandParameter(BindableObject view, object value) => view.SetValue(ReturnCommandParameterProperty, value);
85+
86+
static void OnReturnTypeChanged(BindableObject bindable, object oldValue, object newValue) => UpdateEffect(bindable);
87+
88+
static void OnReturnCommandPropertyChanged(BindableObject bindable, object oldValue, object newValue) => UpdateEffect(bindable);
89+
90+
static void OnReturnCommandParameterPropertyChanged(BindableObject bindable, object oldValue, object newValue) => UpdateEffect(bindable);
91+
92+
static void UpdateEffect(BindableObject bindable)
93+
{
94+
switch (bindable)
95+
{
96+
case Entry entry:
97+
RemoveEffect(entry);
98+
entry.Effects.Add(new EntryReturnTypeEffect());
99+
break;
100+
}
101+
}
102+
103+
static void RemoveEffect(Entry entry)
104+
{
105+
var effectToRemoveList = entry.Effects.Where(e => e is EntryReturnTypeEffect).ToList();
106+
107+
foreach (var entryReturnTypeEffect in effectToRemoveList)
108+
entry.Effects.Remove(entryReturnTypeEffect);
109+
}
110+
}
111+
112+
class EntryReturnTypeEffect : RoutingEffect
113+
{
114+
public EntryReturnTypeEffect() : base(EffectConstants.Name)
115+
{
116+
}
117+
}
118+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace EntryCustomReturn.Forms.Plugin.Abstractions
2+
{
3+
public static class EffectConstants
4+
{
5+
public const string ResolutionGroupName = "EntryCustomReturn.Forms.Plugin";
6+
internal static string Name => $"{ResolutionGroupName}.{EffectName}";
7+
const string EffectName = "CustomKeyboardReturnEffect";
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
6+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8+
<ProjectGuid>{67F9D3A8-F71E-4428-913F-C37AE82CDB24}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace>EntryCustomReturn.Forms.Plugin.Abstractions</RootNamespace>
12+
<AssemblyName>EntryCustomReturn.Forms.Plugin.Abstractions</AssemblyName>
13+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
14+
<TargetFrameworkProfile>Profile259</TargetFrameworkProfile>
15+
<FileAlignment>512</FileAlignment>
16+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
17+
<NuGetPackageImportStamp>
18+
</NuGetPackageImportStamp>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21+
<DebugSymbols>true</DebugSymbols>
22+
<DebugType>full</DebugType>
23+
<Optimize>false</Optimize>
24+
<OutputPath>bin\Debug\</OutputPath>
25+
<DefineConstants>DEBUG;TRACE</DefineConstants>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<DebugSymbols>true</DebugSymbols>
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>bin\Release\</OutputPath>
34+
<DefineConstants>TRACE</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
<DocumentationFile>bin\Release\EntryCustomReturn.Forms.Plugin.Abstractions.xml</DocumentationFile>
38+
</PropertyGroup>
39+
<ItemGroup>
40+
<Compile Include="Effects\CustomReturnEffect.cs" />
41+
<Compile Include="Properties\AssemblyInfo.cs" />
42+
<Compile Include="CustomControls\CustomReturnEntry.cs" />
43+
<Compile Include="Enums\CustomEnums.cs" />
44+
<Compile Include="Effects\EffectConstants.cs" />
45+
<Compile Include="BindablePropertyConstants.cs" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Reference Include="Xamarin.Forms.Core">
49+
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Core.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Xamarin.Forms.Platform">
52+
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Platform.dll</HintPath>
53+
</Reference>
54+
<Reference Include="Xamarin.Forms.Xaml">
55+
<HintPath>..\packages\Xamarin.Forms.2.5.0.77107\lib\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.Xaml.dll</HintPath>
56+
</Reference>
57+
</ItemGroup>
58+
<ItemGroup>
59+
<None Include="packages.config" />
60+
</ItemGroup>
61+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
62+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
63+
Other similar extension points exist, see Microsoft.Common.targets.
64+
<Target Name="BeforeBuild">
65+
</Target>
66+
<Target Name="AfterBuild">
67+
</Target>
68+
-->
69+
<Import Project="..\..\Tests\packages\Xamarin.Forms.2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\Tests\packages\Xamarin.Forms.2.3.3.193\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
70+
<Import Project="..\packages\Xamarin.Forms.2.3.4.224\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.3.4.224\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
71+
<Import Project="..\..\Samples\packages\Xamarin.Forms.2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets" Condition="Exists('..\..\Samples\packages\Xamarin.Forms.2.3.4.231\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.targets')" />
72+
<Import Project="..\packages\Xamarin.Forms.2.5.0.77107\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.2.5.0.77107\build\portable-win+net45+wp80+win81+wpa81\Xamarin.Forms.targets')" />
73+
</Project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace EntryCustomReturn.Forms.Plugin.Abstractions
2+
{
3+
/// <summary>
4+
/// Custom type for keyboard return key
5+
/// </summary>
6+
public enum ReturnType
7+
{
8+
Default,
9+
Done,
10+
Go,
11+
Next,
12+
Search,
13+
Send,
14+
}
15+
}

EntryCustomReturn.Forms.Plugin.Android/EntryCustomReturn.Forms.Plugin.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
</ItemGroup>
130130
<ItemGroup>
131131
<ProjectReference Include="..\EntryCustomReturn.Forms.Plugin.Abstractions\EntryCustomReturn.Forms.Plugin.Abstractions.csproj">
132-
<Project>{67F9D3A8-F71E-4428-913F-C37AE82CDB24}</Project>
132+
<Project>{2e265660-7c43-4c7f-945a-7fa02a56521c}</Project>
133133
<Name>EntryCustomReturn.Forms.Plugin.Abstractions</Name>
134134
</ProjectReference>
135135
</ItemGroup>

EntryCustomReturn.Forms.Plugin.UWP/EntryCustomReturn.Forms.Plugin.UWP.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
</ItemGroup>
117117
<ItemGroup>
118118
<ProjectReference Include="..\EntryCustomReturn.Forms.Plugin.Abstractions\EntryCustomReturn.Forms.Plugin.Abstractions.csproj">
119-
<Project>{67f9d3a8-f71e-4428-913f-c37ae82cdb24}</Project>
119+
<Project>{2e265660-7c43-4c7f-945a-7fa02a56521c}</Project>
120120
<Name>EntryCustomReturn.Forms.Plugin.Abstractions</Name>
121121
</ProjectReference>
122122
</ItemGroup>

0 commit comments

Comments
 (0)