├── .DS_Store
├── .gitattributes
├── .gitignore
├── .mfractor
├── BehaviorValidationPack.Core.f8be8c83-c14c-4ccf-80c2-af69947cf864.db
└── Xamarin.Forms.BehaviorValidationPack.XFMaterial.446757ad-43c3-4f11-a6b9-41eee3ec88e8.db
├── BehaviorValidationPack.Core
├── BehaviorValidationPack.Core.csproj
└── Validations
│ └── Validators.cs
├── BehaviorValidationPack.sln
├── BehaviorsPackSample.sln
├── BehaviorsPackSample
├── BehaviorsPackSample.Android
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── BehaviorsPackSample.Android.csproj
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ └── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ ├── layout
│ │ ├── Tabbar.axml
│ │ └── Toolbar.axml
│ │ ├── mipmap-anydpi-v26
│ │ ├── icon.xml
│ │ └── icon_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── Icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ ├── icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ ├── Icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ ├── Icon.png
│ │ └── launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── Icon.png
│ │ └── launcher_foreground.png
│ │ └── values
│ │ ├── colors.xml
│ │ └── styles.xml
├── BehaviorsPackSample.iOS
│ ├── AppDelegate.cs
│ ├── Assets.xcassets
│ │ └── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon1024.png
│ │ │ ├── Icon120.png
│ │ │ ├── Icon152.png
│ │ │ ├── Icon167.png
│ │ │ ├── Icon180.png
│ │ │ ├── Icon20.png
│ │ │ ├── Icon29.png
│ │ │ ├── Icon40.png
│ │ │ ├── Icon58.png
│ │ │ ├── Icon60.png
│ │ │ ├── Icon76.png
│ │ │ ├── Icon80.png
│ │ │ └── Icon87.png
│ ├── BehaviorsPackSample.iOS.csproj
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Resources
│ │ ├── Default-568h@2x.png
│ │ ├── Default-Portrait.png
│ │ ├── Default-Portrait@2x.png
│ │ ├── Default.png
│ │ ├── Default@2x.png
│ │ └── LaunchScreen.storyboard
└── BehaviorsPackSample
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── BehaviorsPackSample.csproj
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MaterialPage.xaml
│ └── MaterialPage.xaml.cs
├── README.md
├── Resources
└── behaviorIcon.png
├── Xamarin.Forms.BehaviorValidationPack.XFMaterial
├── .DS_Store
├── Behaviors
│ ├── CEPValidationBehavior.cs
│ ├── CNPJValidationBehavior.cs
│ ├── CPFCNPJValidationBehavior.cs
│ ├── CPFValidationBehavior.cs
│ ├── CompareValidationBehavior.cs
│ ├── DateValidationBehavior.cs
│ ├── EmailValidationBehavior.cs
│ ├── MaskedBehavior.cs
│ ├── MaxLengthValidationBehavior.cs
│ ├── NumberValidationBehavior.cs
│ └── PasswordValidationBehavior.cs
├── Extensions
│ └── MaterialTextFieldExtensions.cs
├── Validations
│ └── Validators.cs
└── Xamarin.Forms.BehaviorValidationPack.XFMaterial.csproj
├── Xamarin.Forms.BehaviorValidationPack.sln
└── Xamarin.Forms.BehaviorsPack
├── .DS_Store
├── Behaviors
├── CEPValidationBehavior.cs
├── CNPJValidationBehavior.cs
├── CPFCNPJValidationBehavior.cs
├── CPFValidationBehavior.cs
├── CompareValidationBehavior.cs
├── DateValidationBehavior.cs
├── EmailValidationBehavior.cs
├── MaskedBehavior.cs
├── MaxLengthValidationBehavior.cs
├── NumberValidationBehavior.cs
└── PasswordValidationBehavior.cs
├── Extensions
└── EntryExtensions.cs
├── Validations
└── Validators.cs
└── Xamarin.Forms.BehaviorValidationPack.csproj
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/.DS_Store
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | project.fragment.lock.json
46 | artifacts/
47 |
48 | *_i.c
49 | *_p.c
50 | *_i.h
51 | *.ilk
52 | *.meta
53 | *.obj
54 | *.pch
55 | *.pdb
56 | *.pgc
57 | *.pgd
58 | *.rsp
59 | *.sbr
60 | *.tlb
61 | *.tli
62 | *.tlh
63 | *.tmp
64 | *.tmp_proj
65 | *.log
66 | *.vspscc
67 | *.vssscc
68 | .builds
69 | *.pidb
70 | *.svclog
71 | *.scc
72 |
73 | # Chutzpah Test files
74 | _Chutzpah*
75 |
76 | # Visual C++ cache files
77 | ipch/
78 | *.aps
79 | *.ncb
80 | *.opendb
81 | *.opensdf
82 | *.sdf
83 | *.cachefile
84 | *.VC.db
85 | *.VC.VC.opendb
86 |
87 | # Visual Studio profiler
88 | *.psess
89 | *.vsp
90 | *.vspx
91 | *.sap
92 |
93 | # TFS 2012 Local Workspace
94 | $tf/
95 |
96 | # Guidance Automation Toolkit
97 | *.gpState
98 |
99 | # ReSharper is a .NET coding add-in
100 | _ReSharper*/
101 | *.[Rr]e[Ss]harper
102 | *.DotSettings.user
103 |
104 | # JustCode is a .NET coding add-in
105 | .JustCode
106 |
107 | # TeamCity is a build add-in
108 | _TeamCity*
109 |
110 | # DotCover is a Code Coverage Tool
111 | *.dotCover
112 |
113 | # NCrunch
114 | _NCrunch_*
115 | .*crunch*.local.xml
116 | nCrunchTemp_*
117 |
118 | # MightyMoose
119 | *.mm.*
120 | AutoTest.Net/
121 |
122 | # Web workbench (sass)
123 | .sass-cache/
124 |
125 | # Installshield output folder
126 | [Ee]xpress/
127 |
128 | # DocProject is a documentation generator add-in
129 | DocProject/buildhelp/
130 | DocProject/Help/*.HxT
131 | DocProject/Help/*.HxC
132 | DocProject/Help/*.hhc
133 | DocProject/Help/*.hhk
134 | DocProject/Help/*.hhp
135 | DocProject/Help/Html2
136 | DocProject/Help/html
137 |
138 | # Click-Once directory
139 | publish/
140 |
141 | # Publish Web Output
142 | *.[Pp]ublish.xml
143 | *.azurePubxml
144 | # TODO: Comment the next line if you want to checkin your web deploy settings
145 | # but database connection strings (with potential passwords) will be unencrypted
146 | #*.pubxml
147 | *.publishproj
148 |
149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
150 | # checkin your Azure Web App publish settings, but sensitive information contained
151 | # in these scripts will be unencrypted
152 | PublishScripts/
153 |
154 | # NuGet Packages
155 | *.nupkg
156 | # The packages folder can be ignored because of Package Restore
157 | **/packages/*
158 | # except build/, which is used as an MSBuild target.
159 | !**/packages/build/
160 | # Uncomment if necessary however generally it will be regenerated when needed
161 | #!**/packages/repositories.config
162 | # NuGet v3's project.json files produces more ignoreable files
163 | *.nuget.props
164 | *.nuget.targets
165 |
166 | # Microsoft Azure Build Output
167 | csx/
168 | *.build.csdef
169 |
170 | # Microsoft Azure Emulator
171 | ecf/
172 | rcf/
173 |
174 | # Windows Store app package directories and files
175 | AppPackages/
176 | BundleArtifacts/
177 | Package.StoreAssociation.xml
178 | _pkginfo.txt
179 |
180 | # Visual Studio cache files
181 | # files ending in .cache can be ignored
182 | *.[Cc]ache
183 | # but keep track of directories ending in .cache
184 | !*.[Cc]ache/
185 |
186 | # Others
187 | ClientBin/
188 | ~$*
189 | *~
190 | *.dbmdl
191 | *.dbproj.schemaview
192 | *.jfm
193 | *.pfx
194 | *.publishsettings
195 | node_modules/
196 | orleans.codegen.cs
197 |
198 | # Since there are multiple workflows, uncomment next line to ignore bower_components
199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
200 | #bower_components/
201 |
202 | # RIA/Silverlight projects
203 | Generated_Code/
204 |
205 | # Backup & report files from converting an old project file
206 | # to a newer Visual Studio version. Backup files are not needed,
207 | # because we have git ;-)
208 | _UpgradeReport_Files/
209 | Backup*/
210 | UpgradeLog*.XML
211 | UpgradeLog*.htm
212 |
213 | # SQL Server files
214 | *.mdf
215 | *.ldf
216 |
217 | # Business Intelligence projects
218 | *.rdl.data
219 | *.bim.layout
220 | *.bim_*.settings
221 |
222 | # Microsoft Fakes
223 | FakesAssemblies/
224 |
225 | # GhostDoc plugin setting file
226 | *.GhostDoc.xml
227 |
228 | # Node.js Tools for Visual Studio
229 | .ntvs_analysis.dat
230 |
231 | # Visual Studio 6 build log
232 | *.plg
233 |
234 | # Visual Studio 6 workspace options file
235 | *.opt
236 |
237 | # Visual Studio LightSwitch build output
238 | **/*.HTMLClient/GeneratedArtifacts
239 | **/*.DesktopClient/GeneratedArtifacts
240 | **/*.DesktopClient/ModelManifest.xml
241 | **/*.Server/GeneratedArtifacts
242 | **/*.Server/ModelManifest.xml
243 | _Pvt_Extensions
244 |
245 | # Paket dependency manager
246 | .paket/paket.exe
247 | paket-files/
248 |
249 | # FAKE - F# Make
250 | .fake/
251 |
252 | # JetBrains Rider
253 | .idea/
254 | *.sln.iml
255 |
256 | # CodeRush
257 | .cr/
258 |
259 | # Python Tools for Visual Studio (PTVS)
260 | __pycache__/
261 | *.pyc
--------------------------------------------------------------------------------
/.mfractor/BehaviorValidationPack.Core.f8be8c83-c14c-4ccf-80c2-af69947cf864.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/.mfractor/BehaviorValidationPack.Core.f8be8c83-c14c-4ccf-80c2-af69947cf864.db
--------------------------------------------------------------------------------
/.mfractor/Xamarin.Forms.BehaviorValidationPack.XFMaterial.446757ad-43c3-4f11-a6b9-41eee3ec88e8.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/.mfractor/Xamarin.Forms.BehaviorValidationPack.XFMaterial.446757ad-43c3-4f11-a6b9-41eee3ec88e8.db
--------------------------------------------------------------------------------
/BehaviorValidationPack.Core/BehaviorValidationPack.Core.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/BehaviorValidationPack.Core/Validations/Validators.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 |
7 | namespace BehaviorValidationPack.Core
8 | {
9 | public class Validators
10 | {
11 | public static bool CepValidator(string cep)
12 | {
13 | string cepRegex = @"^\d{5}-\d{3}$";
14 |
15 | if (string.IsNullOrEmpty(cep))
16 | return true;
17 |
18 | return (Regex.IsMatch(cep, cepRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)));
19 | }
20 |
21 | public static bool CpfValidator(string cpf)
22 | {
23 | if (string.IsNullOrEmpty(cpf)) {
24 | return false;
25 | }
26 |
27 | cpf = cpf.Replace(".", "").Replace("-", "");
28 | cpf = cpf.Trim();
29 | if (cpf.Length != 11)
30 | return false;
31 |
32 | int[] multiplicador1 = new int[9] { 10, 9, 8, 7, 6, 5, 4, 3, 2 };
33 | int[] multiplicador2 = new int[10] { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
34 | string tempCpf;
35 | string digito;
36 | int soma;
37 | int resto;
38 | tempCpf = cpf.Substring(0, 9);
39 | soma = 0;
40 |
41 | for (int i = 0; i < 9; i++)
42 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador1[i];
43 | resto = soma % 11;
44 | if (resto < 2)
45 | resto = 0;
46 | else
47 | resto = 11 - resto;
48 | digito = resto.ToString();
49 | tempCpf = tempCpf + digito;
50 | soma = 0;
51 | for (int i = 0; i < 10; i++)
52 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador2[i];
53 | resto = soma % 11;
54 | if (resto < 2)
55 | resto = 0;
56 | else
57 | resto = 11 - resto;
58 | digito += resto.ToString();
59 | return cpf.EndsWith(digito);
60 | }
61 |
62 | public static bool CnpjValidator(string cnpj)
63 | {
64 | if (string.IsNullOrEmpty(cnpj)) {
65 | return false;
66 | }
67 |
68 | cnpj = cnpj.Replace(".", "").Replace("-", "").Replace("/", "");
69 | cnpj = cnpj.Trim();
70 | if (cnpj.Length != 14) {
71 | return false;
72 | }
73 |
74 | int[] multiplicador1 = new int[12] { 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
75 | int[] multiplicador2 = new int [13]{ 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
76 | int soma;
77 | int resto;
78 | string digito;
79 | string tempCnpj;
80 |
81 | tempCnpj = cnpj.Substring(0, 12);
82 | soma = 0;
83 | for (int i = 0; i < 12; i++) {
84 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador1[i];
85 | }
86 | resto = (soma % 11);
87 | if (resto < 2)
88 | resto = 0;
89 | else
90 | resto = 11 - resto;
91 | digito = resto.ToString();
92 | tempCnpj += digito;
93 | soma = 0;
94 | for (int i = 0; i < 13; i++) {
95 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador2[i];
96 | }
97 | resto = (soma % 11);
98 | if (resto < 2)
99 | resto = 0;
100 | else
101 | resto = 11 - resto;
102 | digito += resto.ToString();
103 | return cnpj.EndsWith(digito);
104 | }
105 |
106 | public static bool CpfCnpjValidator(string cpfCnpj)
107 | {
108 | if (string.IsNullOrEmpty(cpfCnpj))
109 | return true;
110 |
111 | string cpfCnpjRegex = @"([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})";
112 | return (Regex.IsMatch(cpfCnpj, cpfCnpjRegex));
113 | }
114 |
115 | public static bool EmailValidator(string email)
116 | {
117 | if (string.IsNullOrEmpty(email))
118 | return true;
119 |
120 | string emailRegex = @"^(?("")("".+?(? 0)
137 | {
138 | isValid = true;
139 | }
140 |
141 | return isValid;
142 | }
143 |
144 | public static bool PasswordValidator(string password)
145 | {
146 | if (string.IsNullOrEmpty(password))
147 | return true;
148 |
149 | string passwordRegex = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$";
150 | return (Regex.IsMatch(password, passwordRegex));
151 | }
152 |
153 |
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/BehaviorValidationPack.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 16
3 | VisualStudioVersion = 16.0.30309.148
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.BehaviorValidationPack.XFMaterial", "Xamarin.Forms.BehaviorValidationPack.XFMaterial\Xamarin.Forms.BehaviorValidationPack.XFMaterial.csproj", "{446757AD-43C3-4F11-A6B9-41EEE3EC88E8}"
6 | EndProject
7 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.BehaviorValidationPack", "Xamarin.Forms.BehaviorsPack\Xamarin.Forms.BehaviorValidationPack.csproj", "{34989C13-613F-4D16-B7D7-E54CBED7A08B}"
8 | EndProject
9 | Global
10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
11 | Debug|Any CPU = Debug|Any CPU
12 | Release|Any CPU = Release|Any CPU
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {446757AD-43C3-4F11-A6B9-41EEE3EC88E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16 | {446757AD-43C3-4F11-A6B9-41EEE3EC88E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
17 | {446757AD-43C3-4F11-A6B9-41EEE3EC88E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {446757AD-43C3-4F11-A6B9-41EEE3EC88E8}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {34989C13-613F-4D16-B7D7-E54CBED7A08B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {34989C13-613F-4D16-B7D7-E54CBED7A08B}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {34989C13-613F-4D16-B7D7-E54CBED7A08B}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {34989C13-613F-4D16-B7D7-E54CBED7A08B}.Release|Any CPU.Build.0 = Release|Any CPU
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | GlobalSection(ExtensibilityGlobals) = postSolution
28 | SolutionGuid = {23C8E83B-31EC-45DC-9E7C-54196D776B5F}
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/BehaviorsPackSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2000
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BehaviorsPackSample.Android", "BehaviorsPackSample\BehaviorsPackSample.Android\BehaviorsPackSample.Android.csproj", "{BD05345E-60B0-4E62-B543-6D8BFB568372}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BehaviorsPackSample.iOS", "BehaviorsPackSample\BehaviorsPackSample.iOS\BehaviorsPackSample.iOS.csproj", "{D6D5F627-2133-48A7-9629-9C64589F8F42}"
9 | EndProject
10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BehaviorsPackSample", "BehaviorsPackSample\BehaviorsPackSample\BehaviorsPackSample.csproj", "{16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
15 | Ad-Hoc|ARM = Ad-Hoc|ARM
16 | Ad-Hoc|iPhone = Ad-Hoc|iPhone
17 | Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
18 | Ad-Hoc|x64 = Ad-Hoc|x64
19 | Ad-Hoc|x86 = Ad-Hoc|x86
20 | AppStore|Any CPU = AppStore|Any CPU
21 | AppStore|ARM = AppStore|ARM
22 | AppStore|iPhone = AppStore|iPhone
23 | AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
24 | AppStore|x64 = AppStore|x64
25 | AppStore|x86 = AppStore|x86
26 | Debug|Any CPU = Debug|Any CPU
27 | Debug|ARM = Debug|ARM
28 | Debug|iPhone = Debug|iPhone
29 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
30 | Debug|x64 = Debug|x64
31 | Debug|x86 = Debug|x86
32 | Release|Any CPU = Release|Any CPU
33 | Release|ARM = Release|ARM
34 | Release|iPhone = Release|iPhone
35 | Release|iPhoneSimulator = Release|iPhoneSimulator
36 | Release|x64 = Release|x64
37 | Release|x86 = Release|x86
38 | EndGlobalSection
39 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
40 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
41 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
42 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU
43 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
44 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
45 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU
46 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
47 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
48 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU
49 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
50 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
51 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU
52 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
53 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x64.Build.0 = Release|Any CPU
54 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU
55 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
56 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x86.Build.0 = Release|Any CPU
57 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU
58 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
59 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|Any CPU.Build.0 = Release|Any CPU
60 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|Any CPU.Deploy.0 = Release|Any CPU
61 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|ARM.ActiveCfg = Release|Any CPU
62 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|ARM.Build.0 = Release|Any CPU
63 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|ARM.Deploy.0 = Release|Any CPU
64 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhone.ActiveCfg = Release|Any CPU
65 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhone.Build.0 = Release|Any CPU
66 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhone.Deploy.0 = Release|Any CPU
67 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
68 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
69 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU
70 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x64.ActiveCfg = Release|Any CPU
71 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x64.Build.0 = Release|Any CPU
72 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x64.Deploy.0 = Release|Any CPU
73 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x86.ActiveCfg = Release|Any CPU
74 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x86.Build.0 = Release|Any CPU
75 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.AppStore|x86.Deploy.0 = Release|Any CPU
76 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|Any CPU.Build.0 = Debug|Any CPU
78 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
79 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|ARM.ActiveCfg = Debug|Any CPU
80 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|ARM.Build.0 = Debug|Any CPU
81 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|ARM.Deploy.0 = Debug|Any CPU
82 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhone.ActiveCfg = Debug|Any CPU
83 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhone.Build.0 = Debug|Any CPU
84 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhone.Deploy.0 = Debug|Any CPU
85 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
86 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
87 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
88 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x64.ActiveCfg = Debug|Any CPU
89 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x64.Build.0 = Debug|Any CPU
90 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x64.Deploy.0 = Debug|Any CPU
91 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x86.ActiveCfg = Debug|Any CPU
92 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x86.Build.0 = Debug|Any CPU
93 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Debug|x86.Deploy.0 = Debug|Any CPU
94 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|Any CPU.ActiveCfg = Release|Any CPU
95 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|Any CPU.Build.0 = Release|Any CPU
96 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|Any CPU.Deploy.0 = Release|Any CPU
97 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|ARM.ActiveCfg = Release|Any CPU
98 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|ARM.Build.0 = Release|Any CPU
99 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|ARM.Deploy.0 = Release|Any CPU
100 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhone.ActiveCfg = Release|Any CPU
101 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhone.Build.0 = Release|Any CPU
102 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhone.Deploy.0 = Release|Any CPU
103 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
104 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
105 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
106 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x64.ActiveCfg = Release|Any CPU
107 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x64.Build.0 = Release|Any CPU
108 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x64.Deploy.0 = Release|Any CPU
109 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x86.ActiveCfg = Release|Any CPU
110 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x86.Build.0 = Release|Any CPU
111 | {BD05345E-60B0-4E62-B543-6D8BFB568372}.Release|x86.Deploy.0 = Release|Any CPU
112 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
113 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone
114 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|Any CPU.Deploy.0 = Ad-Hoc|iPhone
115 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone
116 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|ARM.Build.0 = Ad-Hoc|iPhone
117 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|ARM.Deploy.0 = Ad-Hoc|iPhone
118 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
119 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
120 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhone.Deploy.0 = Ad-Hoc|iPhone
121 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
122 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
123 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Ad-Hoc|iPhoneSimulator
124 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone
125 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x64.Build.0 = Ad-Hoc|iPhone
126 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x64.Deploy.0 = Ad-Hoc|iPhone
127 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone
128 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x86.Build.0 = Ad-Hoc|iPhone
129 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Ad-Hoc|x86.Deploy.0 = Ad-Hoc|iPhone
130 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
131 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|Any CPU.Build.0 = AppStore|iPhone
132 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|Any CPU.Deploy.0 = AppStore|iPhone
133 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|ARM.ActiveCfg = AppStore|iPhone
134 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|ARM.Build.0 = AppStore|iPhone
135 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|ARM.Deploy.0 = AppStore|iPhone
136 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
137 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhone.Build.0 = AppStore|iPhone
138 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhone.Deploy.0 = AppStore|iPhone
139 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
140 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
141 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|iPhoneSimulator.Deploy.0 = AppStore|iPhoneSimulator
142 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x64.ActiveCfg = AppStore|iPhone
143 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x64.Build.0 = AppStore|iPhone
144 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x64.Deploy.0 = AppStore|iPhone
145 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x86.ActiveCfg = AppStore|iPhone
146 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x86.Build.0 = AppStore|iPhone
147 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.AppStore|x86.Deploy.0 = AppStore|iPhone
148 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
149 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
150 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
151 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|ARM.ActiveCfg = Debug|iPhone
152 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|ARM.Build.0 = Debug|iPhone
153 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|ARM.Deploy.0 = Debug|iPhone
154 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhone.ActiveCfg = Debug|iPhone
155 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhone.Build.0 = Debug|iPhone
156 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhone.Deploy.0 = Debug|iPhone
157 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
158 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
159 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator
160 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x64.ActiveCfg = Debug|iPhone
161 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x64.Build.0 = Debug|iPhone
162 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x64.Deploy.0 = Debug|iPhone
163 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x86.ActiveCfg = Debug|iPhone
164 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x86.Build.0 = Debug|iPhone
165 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Debug|x86.Deploy.0 = Debug|iPhone
166 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|Any CPU.ActiveCfg = Release|iPhone
167 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|Any CPU.Build.0 = Release|iPhone
168 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|Any CPU.Deploy.0 = Release|iPhone
169 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|ARM.ActiveCfg = Release|iPhone
170 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|ARM.Build.0 = Release|iPhone
171 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|ARM.Deploy.0 = Release|iPhone
172 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhone.ActiveCfg = Release|iPhone
173 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhone.Build.0 = Release|iPhone
174 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhone.Deploy.0 = Release|iPhone
175 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
176 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
177 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator
178 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x64.ActiveCfg = Release|iPhone
179 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x64.Build.0 = Release|iPhone
180 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x64.Deploy.0 = Release|iPhone
181 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x86.ActiveCfg = Release|iPhone
182 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x86.Build.0 = Release|iPhone
183 | {D6D5F627-2133-48A7-9629-9C64589F8F42}.Release|x86.Deploy.0 = Release|iPhone
184 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
185 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
186 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|Any CPU.Deploy.0 = Debug|Any CPU
187 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
188 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
189 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|ARM.Deploy.0 = Debug|Any CPU
190 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
191 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
192 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhone.Deploy.0 = Debug|Any CPU
193 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
194 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
195 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Debug|Any CPU
196 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
197 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
198 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x64.Deploy.0 = Debug|Any CPU
199 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
200 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
201 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Ad-Hoc|x86.Deploy.0 = Debug|Any CPU
202 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
203 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|Any CPU.Build.0 = Debug|Any CPU
204 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|Any CPU.Deploy.0 = Debug|Any CPU
205 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|ARM.ActiveCfg = Debug|Any CPU
206 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|ARM.Build.0 = Debug|Any CPU
207 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|ARM.Deploy.0 = Debug|Any CPU
208 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
209 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhone.Build.0 = Debug|Any CPU
210 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhone.Deploy.0 = Debug|Any CPU
211 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
212 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
213 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|iPhoneSimulator.Deploy.0 = Debug|Any CPU
214 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x64.ActiveCfg = Debug|Any CPU
215 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x64.Build.0 = Debug|Any CPU
216 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x64.Deploy.0 = Debug|Any CPU
217 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x86.ActiveCfg = Debug|Any CPU
218 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x86.Build.0 = Debug|Any CPU
219 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.AppStore|x86.Deploy.0 = Debug|Any CPU
220 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
221 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
222 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
223 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|ARM.ActiveCfg = Debug|Any CPU
224 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|ARM.Build.0 = Debug|Any CPU
225 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|ARM.Deploy.0 = Debug|Any CPU
226 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhone.ActiveCfg = Debug|Any CPU
227 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhone.Build.0 = Debug|Any CPU
228 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhone.Deploy.0 = Debug|Any CPU
229 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
230 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
231 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU
232 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x64.ActiveCfg = Debug|Any CPU
233 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x64.Build.0 = Debug|Any CPU
234 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x64.Deploy.0 = Debug|Any CPU
235 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x86.ActiveCfg = Debug|Any CPU
236 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x86.Build.0 = Debug|Any CPU
237 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Debug|x86.Deploy.0 = Debug|Any CPU
238 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
239 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|Any CPU.Build.0 = Release|Any CPU
240 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|Any CPU.Deploy.0 = Release|Any CPU
241 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|ARM.ActiveCfg = Release|Any CPU
242 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|ARM.Build.0 = Release|Any CPU
243 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|ARM.Deploy.0 = Release|Any CPU
244 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhone.ActiveCfg = Release|Any CPU
245 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhone.Build.0 = Release|Any CPU
246 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhone.Deploy.0 = Release|Any CPU
247 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
248 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
249 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU
250 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x64.ActiveCfg = Release|Any CPU
251 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x64.Build.0 = Release|Any CPU
252 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x64.Deploy.0 = Release|Any CPU
253 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x86.ActiveCfg = Release|Any CPU
254 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x86.Build.0 = Release|Any CPU
255 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}.Release|x86.Deploy.0 = Release|Any CPU
256 | EndGlobalSection
257 | GlobalSection(SolutionProperties) = preSolution
258 | HideSolutionNode = FALSE
259 | EndGlobalSection
260 | GlobalSection(ExtensibilityGlobals) = postSolution
261 | SolutionGuid = {551AC234-B6C1-4D1A-8567-C8367201147D}
262 | EndGlobalSection
263 | EndGlobal
264 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/BehaviorsPackSample.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {BD05345E-60B0-4E62-B543-6D8BFB568372}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df}
9 | Library
10 | BehaviorsPackSample.Droid
11 | BehaviorsPackSample.Android
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 | v8.1
19 |
20 |
21 |
22 |
23 | true
24 | full
25 | false
26 | bin\Debug
27 | DEBUG;
28 | prompt
29 | 4
30 | None
31 |
32 |
33 | true
34 | pdbonly
35 | true
36 | bin\Release
37 | prompt
38 | 4
39 | true
40 | false
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 28.0.0.3
53 |
54 |
55 | 28.0.0.3
56 |
57 |
58 | 28.0.0.3
59 |
60 |
61 | 28.0.0.3
62 |
63 |
64 | 28.0.0.3
65 |
66 |
67 | 28.0.0.3
68 |
69 |
70 | 28.0.0.3
71 |
72 |
73 | 28.0.0.3
74 |
75 |
76 | 28.0.0.3
77 |
78 |
79 | 28.0.0.3
80 |
81 |
82 | 28.0.0.3
83 |
84 |
85 | 1.6.5
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}
126 | BehaviorsPackSample
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | namespace BehaviorsPackSample.Droid
11 | {
12 | [Activity(Label = "BehaviorsPackSample", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14 | {
15 | protected override void OnCreate(Bundle bundle)
16 | {
17 | TabLayoutResource = Resource.Layout.Tabbar;
18 | ToolbarResource = Resource.Layout.Toolbar;
19 |
20 | base.OnCreate(bundle);
21 |
22 | global::Xamarin.Forms.Forms.Init(this, bundle);
23 | XF.Material.Droid.Material.Init(this, savedInstanceState);
24 | LoadApplication(new App());
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("BehaviorsPackSample.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("BehaviorsPackSample.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
32 | // Add some common permissions, these can be removed if not needed
33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
35 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
8 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace BehaviorsPackSample.iOS
9 | {
10 | // The UIApplicationDelegate for the application. This class is responsible for launching the
11 | // User Interface of the application, as well as listening (and optionally responding) to
12 | // application events from iOS.
13 | [Register("AppDelegate")]
14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
15 | {
16 | //
17 | // This method is invoked when the application has loaded and is ready to run. In this
18 | // method you should instantiate the window, load the UI into it and then make the window
19 | // visible.
20 | //
21 | // You have 17 seconds to return from this method, or iOS will terminate your application.
22 | //
23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
24 | {
25 | global::Xamarin.Forms.Forms.Init();
26 | XF.Material.iOS.Material.Init();
27 | LoadApplication(new App());
28 |
29 | return base.FinishedLaunching(app, options);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/BehaviorsPackSample.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {D6D5F627-2133-48A7-9629-9C64589F8F42}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {6143fdea-f3c2-4a09-aafa-6e230626515e}
11 | Exe
12 | BehaviorsPackSample.iOS
13 | Resources
14 | BehaviorsPackSample.iOS
15 |
16 |
17 |
18 |
19 | true
20 | full
21 | false
22 | bin\iPhoneSimulator\Debug
23 | DEBUG
24 | prompt
25 | 4
26 | false
27 | x86_64
28 | None
29 | true
30 |
31 |
32 | none
33 | true
34 | bin\iPhoneSimulator\Release
35 | prompt
36 | 4
37 | None
38 | x86_64
39 | false
40 |
41 |
42 | true
43 | full
44 | false
45 | bin\iPhone\Debug
46 | DEBUG
47 | prompt
48 | 4
49 | false
50 | ARM64
51 | iPhone Developer
52 | true
53 | Entitlements.plist
54 |
55 |
56 | none
57 | true
58 | bin\iPhone\Release
59 | prompt
60 | 4
61 | ARM64
62 | false
63 | iPhone Developer
64 | Entitlements.plist
65 |
66 |
67 | none
68 | True
69 | bin\iPhone\Ad-Hoc
70 | prompt
71 | 4
72 | False
73 | ARM64
74 | True
75 | Automatic:AdHoc
76 | iPhone Distribution
77 | Entitlements.plist
78 |
79 |
80 | none
81 | True
82 | bin\iPhone\AppStore
83 | prompt
84 | 4
85 | False
86 | ARM64
87 | Automatic:AppStore
88 | iPhone Distribution
89 | Entitlements.plist
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 | false
102 |
103 |
104 | false
105 |
106 |
107 | false
108 |
109 |
110 | false
111 |
112 |
113 | false
114 |
115 |
116 | false
117 |
118 |
119 | false
120 |
121 |
122 | false
123 |
124 |
125 | false
126 |
127 |
128 | false
129 |
130 |
131 | false
132 |
133 |
134 | false
135 |
136 |
137 | false
138 |
139 |
140 | false
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | 1.6.5
153 |
154 |
155 |
156 |
157 |
158 | {16E8C4D6-B673-4A24-900A-A2FA0B0B86DA}
159 | BehaviorsPackSample
160 |
161 |
162 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.0
25 | CFBundleDisplayName
26 | BehaviorsPackSample
27 | CFBundleIdentifier
28 | com.companyname.BehaviorsPackSample
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | BehaviorsPackSample
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace BehaviorsPackSample.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BehaviorsPackSample.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("BehaviorsPackSample.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | [assembly: XamlCompilation (XamlCompilationOptions.Compile)]
6 | namespace BehaviorsPackSample
7 | {
8 | public partial class App : Application
9 | {
10 | public App ()
11 | {
12 | InitializeComponent();
13 | XF.Material.Forms.Material.Init(this);
14 |
15 | MainPage = new MainPage();
16 | }
17 |
18 | protected override void OnStart ()
19 | {
20 | // Handle when your app starts
21 | }
22 |
23 | protected override void OnSleep ()
24 | {
25 | // Handle when your app sleeps
26 | }
27 |
28 | protected override void OnResume ()
29 | {
30 | // Handle when your app resumes
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/BehaviorsPackSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Xamarin.Forms;
7 |
8 | namespace BehaviorsPackSample
9 | {
10 | public partial class MainPage : ContentPage
11 | {
12 | public MainPage()
13 | {
14 | InitializeComponent();
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/MaterialPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/BehaviorsPackSample/BehaviorsPackSample/MaterialPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | using Xamarin.Forms;
5 |
6 | namespace BehaviorsPackSample
7 | {
8 | public partial class MaterialPage : ContentPage
9 | {
10 | public MaterialPage()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Xamarin.Forms.BehaviorValidationPack
2 |
3 | Package with multiple field validations for Xamarin.Forms.
4 |
5 | Easily validate numbers, texts and implement masks.
6 |
7 | ###### This is the component, works on iOS, Android and UWP.
8 |
9 | **NuGet**
10 |
11 | |Name|Info|
12 | | ------------------- | :------------------: |
13 | |Xamarin.Forms.BehaviorValidationPack|[](https://www.nuget.org/packages/Xamarin.Forms.BehaviorValidationPack/)|
14 | |Xamarin.Forms.BehaviorValidationPack.XFMaterial|[](https://www.nuget.org/packages/Xamarin.Forms.BehaviorValidationPack.XFMaterial/)|
15 |
16 |
17 | **Platform Support**
18 |
19 | Xamarin.Forms.BehaviorValidationPack is a .NET Standard 2.0 library.Its only dependency is the Xamarin.Forms
20 |
21 | ## Setup / Usage
22 |
23 | Does not require additional configuration. Just install the package in the shared project and use.
24 |
25 | You just need to add the reference in your xaml file.
26 |
27 | ```csharp
28 | xmlns:behaviorPack="clr-namespace:Xamarin.Forms.BehaviorValidationPack;assembly=Xamarin.Forms.BehaviorValidationPack"
29 | ```
30 |
31 | **Behavior**
32 |
33 |
34 | ```csharp
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | ```
53 |
54 | **Behavior for XF-Material-Library**
55 |
56 | ###### This package is for anyone using the [XF.Material](https://github.com/Baseflow/XF-Material-Library)
57 |
58 |
59 | ```csharp
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | ```
78 |
79 | **Available Behaviors**
80 |
81 | Global Validators
82 |
83 | * CompareValidationBehavior : Compare if two Entrys are the same. Ideal for passwords.
84 | * DateValidationBehavior : Checks if an Date is valid.
85 | * EmailValidationBehavior : Checks if an email is valid.
86 | * MaxLengthValidationBehavior : Limits a Entry with a maximum number of characters.
87 | * NumberValidationBehavior : Valid if a Entry is numeric.
88 | * PasswordValidationBehavior : Validate the strength of a password:
89 | at least 8 characters
90 | at least 1 numeric character
91 | at least 1 lowercase letter
92 | at least 1 uppercase letter
93 | at least 1 special character
94 |
95 |
96 | Brazilians Validators
97 |
98 | * CEPValidationBehavior : Checks if an CEP is valid.
99 | * CNPJValidationBehavior : Checks if an CNPJ is valid.
100 | * CPFValidationBehavior : Checks if an CPF is valid.
101 | * CPFCNPJValidationBehavior : Checks if an CPF or CNPJ is valid.
102 |
103 | Masks
104 |
105 | * MaskedBehavior : Creates a custom mask on an entry.
106 |
107 | Based on MaskedBehavior by [Adam Pedley](https://github.com/adamped) (https://xamarinhelp.com/masked-entry-in-xamarin-forms/).
108 |
109 |
110 | ```csharp
111 |
112 | ```
113 |
114 |
115 | The complete example can be downloaded here: https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/tree/master/BehaviorsPackSample
116 |
--------------------------------------------------------------------------------
/Resources/behaviorIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/Resources/behaviorIcon.png
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/Xamarin.Forms.BehaviorValidationPack.XFMaterial/.DS_Store
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/CEPValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class CEPValidationBehavior : Behavior
10 | {
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(MaterialTextField bindable)
14 | {
15 | bindable.Unfocused += Bindable_Unfocused;
16 | DefaultColor = bindable.TextColor;
17 | base.OnAttachedTo(bindable);
18 | }
19 |
20 |
21 | protected override void OnDetachingFrom(MaterialTextField bindable)
22 | {
23 | bindable.Unfocused -= Bindable_Unfocused;
24 | base.OnDetachingFrom(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = false;
30 | IsValid = Validators.CepValidator(((MaterialTextField)sender).ValidatedText());
31 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 |
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/CNPJValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class CNPJValidationBehavior : Behavior
10 | {
11 |
12 | private static Color DefaultColor = Color.Default;
13 |
14 | protected override void OnAttachedTo(MaterialTextField bindable)
15 | {
16 | bindable.Unfocused += Bindable_Unfocused;
17 | DefaultColor = bindable.TextColor;
18 | base.OnAttachedTo(bindable);
19 | }
20 |
21 |
22 | protected override void OnDetachingFrom(MaterialTextField bindable)
23 | {
24 | bindable.Unfocused -= Bindable_Unfocused;
25 | base.OnDetachingFrom(bindable);
26 | }
27 |
28 | void Bindable_Unfocused(object sender, FocusEventArgs e)
29 | {
30 | bool IsValid = Validators.CnpjValidator(((MaterialTextField)sender).ValidatedText());
31 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/CPFCNPJValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class CPFCNPJValidationBehavior : Behavior
10 | {
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(MaterialTextField bindable)
14 | {
15 | bindable.Unfocused += Bindable_Unfocused;
16 | DefaultColor = bindable.TextColor;
17 |
18 | base.OnAttachedTo(bindable);
19 | }
20 |
21 |
22 | protected override void OnDetachingFrom(MaterialTextField bindable)
23 | {
24 | bindable.Unfocused -= Bindable_Unfocused;
25 | base.OnDetachingFrom(bindable);
26 | }
27 |
28 | void Bindable_Unfocused(object sender, FocusEventArgs e)
29 | {
30 | bool IsValid = Validators.CpfCnpjValidator(((MaterialTextField)sender).ValidatedText());
31 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/CPFValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class CPFValidationBehavior : Behavior
10 | {
11 |
12 | private static Color DefaultColor = Color.Default;
13 |
14 | protected override void OnAttachedTo(MaterialTextField bindable)
15 | {
16 | bindable.Unfocused += Bindable_Unfocused;
17 | DefaultColor = bindable.TextColor;
18 | base.OnAttachedTo(bindable);
19 | }
20 |
21 |
22 | protected override void OnDetachingFrom(MaterialTextField bindable)
23 | {
24 | bindable.Unfocused -= Bindable_Unfocused;
25 | base.OnDetachingFrom(bindable);
26 | }
27 |
28 | void Bindable_Unfocused(object sender, FocusEventArgs e)
29 | {
30 | bool IsValid = Validators.CpfValidator(((MaterialTextField)sender).ValidatedText());
31 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/CompareValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | using XF.Material.Forms.UI;
7 |
8 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
9 | {
10 | public class CompareValidationBehavior : Behavior
11 | {
12 |
13 | private static Color DefaultColor = Color.Default;
14 |
15 | public static BindableProperty TextProperty =
16 | BindableProperty.Create(tc => tc.Text, string.Empty, BindingMode.TwoWay);
17 |
18 | public string Text
19 | {
20 | get
21 | {
22 | return (string)GetValue(TextProperty);
23 | }
24 | set
25 | {
26 | SetValue(TextProperty, value);
27 | }
28 | }
29 |
30 |
31 | protected override void OnAttachedTo(MaterialTextField bindable)
32 | {
33 | bindable.Unfocused += Bindable_Unfocused;
34 | DefaultColor = bindable.TextColor;
35 | base.OnAttachedTo(bindable);
36 | }
37 |
38 | protected override void OnDetachingFrom(MaterialTextField bindable)
39 | {
40 | bindable.Unfocused -= Bindable_Unfocused;
41 | base.OnDetachingFrom(bindable);
42 | }
43 |
44 | void Bindable_Unfocused(object sender, FocusEventArgs e)
45 | {
46 | bool IsValid = false;
47 | IsValid = ((MaterialTextField)sender).ValidatedText() == Text;
48 |
49 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/DateValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class DateValidationBehavior : Behavior
10 | {
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(DatePicker datepicker)
14 | {
15 | datepicker.DateSelected += Datepicker_DateSelected;
16 | DefaultColor = datepicker.TextColor;
17 | base.OnAttachedTo(datepicker);
18 | }
19 |
20 | private void Datepicker_DateSelected(object sender, DateChangedEventArgs e)
21 | {
22 |
23 | bool isValid = Validators.DateValidator(e.NewDate);
24 | ((DatePicker)sender).BackgroundColor = isValid ? DefaultColor : Color.Red;
25 | }
26 |
27 | protected override void OnDetachingFrom(DatePicker datepicker)
28 | {
29 | datepicker.DateSelected -= Datepicker_DateSelected;
30 | base.OnDetachingFrom(datepicker);
31 | }
32 |
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/EmailValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class EmailValidationBehavior : Behavior
10 | {
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(MaterialTextField bindable)
14 | {
15 | bindable.Unfocused += Bindable_Unfocused;
16 | DefaultColor = bindable.TextColor;
17 | base.OnAttachedTo(bindable);
18 | }
19 |
20 |
21 | protected override void OnDetachingFrom(MaterialTextField bindable)
22 | {
23 | bindable.Unfocused -= Bindable_Unfocused;
24 | base.OnDetachingFrom(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = false;
30 | IsValid = Validators.EmailValidator(((MaterialTextField)sender).ValidatedText());
31 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 |
33 | }
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/MaskedBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class MaskedBehavior : Behavior
10 | {
11 | private string _mask = "";
12 | public string Mask
13 | {
14 | get => _mask;
15 | set
16 | {
17 | _mask = value;
18 | SetPositions();
19 | }
20 | }
21 |
22 | protected override void OnAttachedTo(MaterialTextField entry)
23 | {
24 | entry.TextChanged += OnEntryTextChanged;
25 | base.OnAttachedTo(entry);
26 | }
27 |
28 | protected override void OnDetachingFrom(MaterialTextField entry)
29 | {
30 | entry.TextChanged -= OnEntryTextChanged;
31 | base.OnDetachingFrom(entry);
32 | }
33 |
34 | IDictionary _positions;
35 |
36 | void SetPositions()
37 | {
38 | if (string.IsNullOrEmpty(Mask))
39 | {
40 | _positions = null;
41 | return;
42 | }
43 |
44 | var list = new Dictionary();
45 | for (var i = 0; i < Mask.Length; i++)
46 | if (Mask[i] != 'X')
47 | list.Add(i, Mask[i]);
48 |
49 | _positions = list;
50 | }
51 |
52 | private void OnEntryTextChanged(object sender, TextChangedEventArgs args)
53 | {
54 | var entry = sender as MaterialTextField;
55 |
56 | var text = entry.Text;
57 |
58 | if (string.IsNullOrWhiteSpace(text) || _positions == null)
59 | return;
60 |
61 | if (text.Length > _mask.Length)
62 | {
63 | entry.Text = text.Remove(text.Length - 1);
64 | return;
65 | }
66 |
67 | foreach (var position in _positions)
68 | if (text.Length >= position.Key + 1)
69 | {
70 | var value = position.Value.ToString();
71 | if (text.Substring(position.Key, 1) != value)
72 | text = text.Insert(position.Key, value);
73 | }
74 |
75 | if (entry.Text != text)
76 | entry.Text = text;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/MaxLengthValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class MaxLengthValidationBehavior : Behavior
10 | {
11 | public static readonly BindableProperty MaxLengthProperty =
12 | BindableProperty.Create("MaxLength", typeof(int), typeof(MaxLengthValidationBehavior), 0);
13 |
14 | public int MaxLength
15 | {
16 | get { return (int)GetValue(MaxLengthProperty); }
17 | set { SetValue(MaxLengthProperty, value); }
18 | }
19 |
20 | protected override void OnAttachedTo(MaterialTextField bindable)
21 | {
22 | bindable.TextChanged += bindable_TextChanged;
23 | }
24 |
25 | private void bindable_TextChanged(object sender, TextChangedEventArgs e)
26 | {
27 |
28 | if (e.NewTextValue.Length >= MaxLength)
29 | ((MaterialTextField)sender).Text = e.NewTextValue.Substring(0, MaxLength);
30 |
31 | }
32 |
33 | protected override void OnDetachingFrom(MaterialTextField bindable)
34 | {
35 | bindable.TextChanged -= bindable_TextChanged;
36 |
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/NumberValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | using XF.Material.Forms.UI;
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class NumberValidationBehavior : Behavior
10 | {
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(MaterialTextField entry)
14 | {
15 | entry.TextChanged += OnEntryTextChanged;
16 | DefaultColor = entry.TextColor;
17 | base.OnAttachedTo(entry);
18 | }
19 |
20 | protected override void OnDetachingFrom(MaterialTextField entry)
21 | {
22 | entry.TextChanged -= OnEntryTextChanged;
23 | base.OnDetachingFrom(entry);
24 | }
25 |
26 | void OnEntryTextChanged(object sender, TextChangedEventArgs args)
27 | {
28 | int result;
29 |
30 | bool isValid = int.TryParse(args.NewTextValue, out result);
31 |
32 | ((MaterialTextField)sender).TextColor = isValid ? DefaultColor : Color.Red;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Behaviors/PasswordValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 | using XF.Material.Forms.UI;
7 |
8 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
9 | {
10 | //at least 8 characters
11 | //at least 1 numeric character
12 | //at least 1 lowercase letter
13 | //at least 1 uppercase letter
14 | //at least 1 special character
15 | public class PasswordValidationBehavior : Behavior
16 | {
17 | const string passwordRegex = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$";
18 |
19 | private static Color DefaultColor = Color.Default;
20 |
21 | protected override void OnAttachedTo(MaterialTextField bindable)
22 | {
23 | bindable.Unfocused += Bindable_Unfocused;
24 | DefaultColor = bindable.TextColor;
25 | base.OnAttachedTo(bindable);
26 | }
27 |
28 | void Bindable_Unfocused(object sender, FocusEventArgs e)
29 | {
30 | bool IsValid = false;
31 | IsValid = Validators.PasswordValidator(((MaterialTextField)sender).ValidatedText());
32 | ((MaterialTextField)sender).TextColor = IsValid ? DefaultColor : Color.Red;
33 | }
34 |
35 | protected override void OnDetachingFrom(MaterialTextField bindable)
36 | {
37 | bindable.Unfocused -= Bindable_Unfocused;
38 | base.OnDetachingFrom(bindable);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Extensions/MaterialTextFieldExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using XF.Material.Forms.UI;
3 |
4 |
5 | public static class MaterialTextFieldExtensions
6 | {
7 |
8 | public static string ValidatedText(this MaterialTextField materialTextField)
9 | {
10 | return materialTextField?.Text ?? string.Empty;
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Validations/Validators.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack.XFMaterial
8 | {
9 | public class Validators
10 | {
11 | public static bool CepValidator(string cep)
12 | {
13 | string cepRegex = @"^\d{5}-\d{3}$";
14 |
15 | if (string.IsNullOrEmpty(cep))
16 | return true;
17 |
18 | return (Regex.IsMatch(cep, cepRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)));
19 | }
20 |
21 | public static bool CpfValidator(string cpf)
22 | {
23 | if (string.IsNullOrEmpty(cpf)) {
24 | return false;
25 | }
26 |
27 | cpf = cpf.Replace(".", "").Replace("-", "");
28 | cpf = cpf.Trim();
29 | if (cpf.Length != 11)
30 | return false;
31 |
32 | int[] multiplicador1 = new int[9] { 10, 9, 8, 7, 6, 5, 4, 3, 2 };
33 | int[] multiplicador2 = new int[10] { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
34 | string tempCpf;
35 | string digito;
36 | int soma;
37 | int resto;
38 | tempCpf = cpf.Substring(0, 9);
39 | soma = 0;
40 |
41 | for (int i = 0; i < 9; i++)
42 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador1[i];
43 | resto = soma % 11;
44 | if (resto < 2)
45 | resto = 0;
46 | else
47 | resto = 11 - resto;
48 | digito = resto.ToString();
49 | tempCpf = tempCpf + digito;
50 | soma = 0;
51 | for (int i = 0; i < 10; i++)
52 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador2[i];
53 | resto = soma % 11;
54 | if (resto < 2)
55 | resto = 0;
56 | else
57 | resto = 11 - resto;
58 | digito += resto.ToString();
59 | return cpf.EndsWith(digito);
60 | }
61 |
62 | public static bool CnpjValidator(string cnpj)
63 | {
64 | if (string.IsNullOrEmpty(cnpj)) {
65 | return false;
66 | }
67 |
68 | cnpj = cnpj.Replace(".", "").Replace("-", "").Replace("/", "");
69 | cnpj = cnpj.Trim();
70 | if (cnpj.Length != 14) {
71 | return false;
72 | }
73 |
74 | int[] multiplicador1 = new int[12] { 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
75 | int[] multiplicador2 = new int [13]{ 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
76 | int soma;
77 | int resto;
78 | string digito;
79 | string tempCnpj;
80 |
81 | tempCnpj = cnpj.Substring(0, 12);
82 | soma = 0;
83 | for (int i = 0; i < 12; i++) {
84 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador1[i];
85 | }
86 | resto = (soma % 11);
87 | if (resto < 2)
88 | resto = 0;
89 | else
90 | resto = 11 - resto;
91 | digito = resto.ToString();
92 | tempCnpj += digito;
93 | soma = 0;
94 | for (int i = 0; i < 13; i++) {
95 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador2[i];
96 | }
97 | resto = (soma % 11);
98 | if (resto < 2)
99 | resto = 0;
100 | else
101 | resto = 11 - resto;
102 | digito += resto.ToString();
103 | return cnpj.EndsWith(digito);
104 | }
105 |
106 | public static bool CpfCnpjValidator(string cpfCnpj)
107 | {
108 | if (string.IsNullOrEmpty(cpfCnpj))
109 | return true;
110 |
111 | string cpfCnpjRegex = @"([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})";
112 | return (Regex.IsMatch(cpfCnpj, cpfCnpjRegex));
113 | }
114 |
115 | public static bool EmailValidator(string email)
116 | {
117 | if (string.IsNullOrEmpty(email))
118 | return true;
119 |
120 | string emailRegex = @"^(?("")("".+?(? 0)
137 | {
138 | isValid = true;
139 | }
140 |
141 | return isValid;
142 | }
143 |
144 | public static bool PasswordValidator(string password)
145 | {
146 | if (string.IsNullOrEmpty(password))
147 | return true;
148 |
149 | string passwordRegex = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$";
150 | return (Regex.IsMatch(password, passwordRegex));
151 | }
152 |
153 |
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.XFMaterial/Xamarin.Forms.BehaviorValidationPack.XFMaterial.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | 1.0.0
6 | KBits
7 | Useful behaviors for XF Material field validation
8 | Copyright ©2020 KBits
9 | https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack
10 | https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack
11 | xamarin xamarin.forms xamarin forms validation validators behavior behaviors material
12 | First version
13 | behaviorIcon.png
14 | false
15 | true
16 | tbertuzzi
17 | 1.0.0.0
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | True
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorValidationPack.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2000
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xamarin.Forms.BehaviorValidationPack", "Xamarin.Forms.BehaviorsPack\Xamarin.Forms.BehaviorValidationPack.csproj", "{74FD2F70-CD06-4244-9045-175F968D01D5}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {74FD2F70-CD06-4244-9045-175F968D01D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {74FD2F70-CD06-4244-9045-175F968D01D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {74FD2F70-CD06-4244-9045-175F968D01D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {74FD2F70-CD06-4244-9045-175F968D01D5}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {58F55836-68A8-4AE4-AEB9-D5F92F33266E}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/0ff35a91fdcd1a9d267d2c2fe8c3c94f24d3258e/Xamarin.Forms.BehaviorsPack/.DS_Store
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/CEPValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class CEPValidationBehavior : Behavior
9 | {
10 | private static Color DefaultColor = Color.Default;
11 |
12 | protected override void OnAttachedTo(Entry bindable)
13 | {
14 | bindable.Unfocused += Bindable_Unfocused;
15 | DefaultColor = bindable.TextColor;
16 | base.OnAttachedTo(bindable);
17 | }
18 |
19 |
20 | protected override void OnDetachingFrom(Entry bindable)
21 | {
22 | bindable.Unfocused -= Bindable_Unfocused;
23 | base.OnDetachingFrom(bindable);
24 | }
25 |
26 | void Bindable_Unfocused(object sender, FocusEventArgs e)
27 | {
28 | bool IsValid = false;
29 | IsValid = Validators.CepValidator(((Entry)sender).ValidatedText());
30 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
31 |
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/CNPJValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class CNPJValidationBehavior : Behavior
9 | {
10 |
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(Entry bindable)
14 | {
15 | bindable.Unfocused += Bindable_Unfocused;
16 | DefaultColor = bindable.TextColor;
17 | base.OnAttachedTo(bindable);
18 | }
19 |
20 |
21 | protected override void OnDetachingFrom(Entry bindable)
22 | {
23 | bindable.Unfocused -= Bindable_Unfocused;
24 | base.OnDetachingFrom(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = Validators.CnpjValidator(((Entry)sender).ValidatedText());
30 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/CPFCNPJValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class CPFCNPJValidationBehavior : Behavior
9 | {
10 | private static Color DefaultColor = Color.Default;
11 |
12 | protected override void OnAttachedTo(Entry bindable)
13 | {
14 | bindable.Unfocused += Bindable_Unfocused;
15 | DefaultColor = bindable.TextColor;
16 |
17 | base.OnAttachedTo(bindable);
18 | }
19 |
20 |
21 | protected override void OnDetachingFrom(Entry bindable)
22 | {
23 | bindable.Unfocused -= Bindable_Unfocused;
24 | base.OnDetachingFrom(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = Validators.CpfCnpjValidator(((Entry)sender).ValidatedText());
30 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/CPFValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class CPFValidationBehavior : Behavior
9 | {
10 |
11 | private static Color DefaultColor = Color.Default;
12 |
13 | protected override void OnAttachedTo(Entry bindable)
14 | {
15 | bindable.Unfocused += Bindable_Unfocused;
16 | DefaultColor = bindable.TextColor;
17 | base.OnAttachedTo(bindable);
18 | }
19 |
20 |
21 | protected override void OnDetachingFrom(Entry bindable)
22 | {
23 | bindable.Unfocused -= Bindable_Unfocused;
24 | base.OnDetachingFrom(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = Validators.CpfValidator(((Entry)sender).ValidatedText());
30 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/CompareValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class CompareValidationBehavior : Behavior
9 | {
10 |
11 | private static Color DefaultColor = Color.Default;
12 |
13 | public static BindableProperty TextProperty =
14 | BindableProperty.Create(tc => tc.Text, string.Empty, BindingMode.TwoWay);
15 |
16 | public string Text
17 | {
18 | get
19 | {
20 | return (string)GetValue(TextProperty);
21 | }
22 | set
23 | {
24 | SetValue(TextProperty, value);
25 | }
26 | }
27 |
28 |
29 | protected override void OnAttachedTo(Entry bindable)
30 | {
31 | bindable.Unfocused += Bindable_Unfocused;
32 | DefaultColor = bindable.TextColor;
33 | base.OnAttachedTo(bindable);
34 | }
35 |
36 | protected override void OnDetachingFrom(Entry bindable)
37 | {
38 | bindable.Unfocused -= Bindable_Unfocused;
39 | base.OnDetachingFrom(bindable);
40 | }
41 |
42 | void Bindable_Unfocused(object sender, FocusEventArgs e)
43 | {
44 | bool IsValid = false;
45 | IsValid = ((Entry)sender).ValidatedText() == Text;
46 |
47 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/DateValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class DateValidationBehavior : Behavior
9 | {
10 | private static Color DefaultColor = Color.Default;
11 |
12 | protected override void OnAttachedTo(DatePicker datepicker)
13 | {
14 | datepicker.DateSelected += Datepicker_DateSelected;
15 | DefaultColor = datepicker.TextColor;
16 | base.OnAttachedTo(datepicker);
17 | }
18 |
19 | private void Datepicker_DateSelected(object sender, DateChangedEventArgs e)
20 | {
21 |
22 | bool isValid = Validators.DateValidator(e.NewDate);
23 | ((DatePicker)sender).BackgroundColor = isValid ? DefaultColor : Color.Red;
24 | }
25 |
26 | protected override void OnDetachingFrom(DatePicker datepicker)
27 | {
28 | datepicker.DateSelected -= Datepicker_DateSelected;
29 | base.OnDetachingFrom(datepicker);
30 | }
31 |
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/EmailValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class EmailValidationBehavior : Behavior
9 | {
10 | private static Color DefaultColor = Color.Default;
11 |
12 | protected override void OnAttachedTo(Entry bindable)
13 | {
14 | bindable.Unfocused += Bindable_Unfocused;
15 | DefaultColor = bindable.TextColor;
16 | base.OnAttachedTo(bindable);
17 | }
18 |
19 |
20 | protected override void OnDetachingFrom(Entry bindable)
21 | {
22 | bindable.Unfocused -= Bindable_Unfocused;
23 | base.OnDetachingFrom(bindable);
24 | }
25 |
26 | void Bindable_Unfocused(object sender, FocusEventArgs e)
27 | {
28 | bool IsValid = false;
29 | IsValid = Validators.EmailValidator(((Entry)sender).ValidatedText());
30 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
31 |
32 | }
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/MaskedBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class MaskedBehavior : Behavior
9 | {
10 | private string _mask = "";
11 | public string Mask
12 | {
13 | get => _mask;
14 | set
15 | {
16 | _mask = value;
17 | SetPositions();
18 | }
19 | }
20 |
21 | protected override void OnAttachedTo(Entry entry)
22 | {
23 | entry.TextChanged += OnEntryTextChanged;
24 | base.OnAttachedTo(entry);
25 | }
26 |
27 | protected override void OnDetachingFrom(Entry entry)
28 | {
29 | entry.TextChanged -= OnEntryTextChanged;
30 | base.OnDetachingFrom(entry);
31 | }
32 |
33 | IDictionary _positions;
34 |
35 | void SetPositions()
36 | {
37 | if (string.IsNullOrEmpty(Mask))
38 | {
39 | _positions = null;
40 | return;
41 | }
42 |
43 | var list = new Dictionary();
44 | for (var i = 0; i < Mask.Length; i++)
45 | if (Mask[i] != 'X')
46 | list.Add(i, Mask[i]);
47 |
48 | _positions = list;
49 | }
50 |
51 | private void OnEntryTextChanged(object sender, TextChangedEventArgs args)
52 | {
53 | var entry = sender as Entry;
54 |
55 | var text = entry.Text;
56 |
57 | if (string.IsNullOrWhiteSpace(text) || _positions == null)
58 | return;
59 |
60 | if (text.Length > _mask.Length)
61 | {
62 | entry.Text = text.Remove(text.Length - 1);
63 | return;
64 | }
65 |
66 | foreach (var position in _positions)
67 | if (text.Length >= position.Key + 1)
68 | {
69 | var value = position.Value.ToString();
70 | if (text.Substring(position.Key, 1) != value)
71 | text = text.Insert(position.Key, value);
72 | }
73 |
74 | if (entry.Text != text)
75 | entry.Text = text;
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/MaxLengthValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class MaxLengthValidationBehavior : Behavior
9 | {
10 | public static readonly BindableProperty MaxLengthProperty =
11 | BindableProperty.Create("MaxLength", typeof(int), typeof(MaxLengthValidationBehavior), 0);
12 |
13 | public int MaxLength
14 | {
15 | get { return (int)GetValue(MaxLengthProperty); }
16 | set { SetValue(MaxLengthProperty, value); }
17 | }
18 |
19 | protected override void OnAttachedTo(Entry bindable)
20 | {
21 | bindable.TextChanged += bindable_TextChanged;
22 | }
23 |
24 | private void bindable_TextChanged(object sender, TextChangedEventArgs e)
25 | {
26 |
27 | if (e.NewTextValue.Length >= MaxLength)
28 | ((Entry)sender).Text = e.NewTextValue.Substring(0, MaxLength);
29 |
30 | }
31 |
32 | protected override void OnDetachingFrom(Entry bindable)
33 | {
34 | bindable.TextChanged -= bindable_TextChanged;
35 |
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/NumberValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 |
6 | namespace Xamarin.Forms.BehaviorValidationPack
7 | {
8 | public class NumberValidationBehavior : Behavior
9 | {
10 | private static Color DefaultColor = Color.Default;
11 |
12 | protected override void OnAttachedTo(Entry entry)
13 | {
14 | entry.TextChanged += OnEntryTextChanged;
15 | DefaultColor = entry.TextColor;
16 | base.OnAttachedTo(entry);
17 | }
18 |
19 | protected override void OnDetachingFrom(Entry entry)
20 | {
21 | entry.TextChanged -= OnEntryTextChanged;
22 | base.OnDetachingFrom(entry);
23 | }
24 |
25 | void OnEntryTextChanged(object sender, TextChangedEventArgs args)
26 | {
27 | int result;
28 |
29 | bool isValid = int.TryParse(args.NewTextValue, out result);
30 |
31 | ((Entry)sender).TextColor = isValid ? DefaultColor : Color.Red;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Behaviors/PasswordValidationBehavior.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack
8 | {
9 | //at least 8 characters
10 | //at least 1 numeric character
11 | //at least 1 lowercase letter
12 | //at least 1 uppercase letter
13 | //at least 1 special character
14 | public class PasswordValidationBehavior : Behavior
15 | {
16 | const string passwordRegex = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$";
17 |
18 | private static Color DefaultColor = Color.Default;
19 |
20 | protected override void OnAttachedTo(Entry bindable)
21 | {
22 | bindable.Unfocused += Bindable_Unfocused;
23 | DefaultColor = bindable.TextColor;
24 | base.OnAttachedTo(bindable);
25 | }
26 |
27 | void Bindable_Unfocused(object sender, FocusEventArgs e)
28 | {
29 | bool IsValid = false;
30 | IsValid = Validators.PasswordValidator(((Entry)sender).ValidatedText());
31 | ((Entry)sender).TextColor = IsValid ? DefaultColor : Color.Red;
32 | }
33 |
34 | protected override void OnDetachingFrom(Entry bindable)
35 | {
36 | bindable.Unfocused -= Bindable_Unfocused;
37 | base.OnDetachingFrom(bindable);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Extensions/EntryExtensions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 |
4 | public static class EntryExtensions
5 | {
6 | public static string ValidatedText(this Entry entry)
7 | {
8 | return entry?.Text ?? string.Empty;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Validations/Validators.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.RegularExpressions;
5 |
6 |
7 | namespace Xamarin.Forms.BehaviorValidationPack
8 | {
9 | public class Validators
10 | {
11 | public static bool CepValidator(string cep)
12 | {
13 | string cepRegex = @"^\d{5}-\d{3}$";
14 |
15 | if (string.IsNullOrEmpty(cep))
16 | return true;
17 |
18 | return (Regex.IsMatch(cep, cepRegex, RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(250)));
19 | }
20 |
21 | public static bool CpfValidator(string cpf)
22 | {
23 | if (string.IsNullOrEmpty(cpf)) {
24 | return false;
25 | }
26 |
27 | cpf = cpf.Replace(".", "").Replace("-", "");
28 | cpf = cpf.Trim();
29 | if (cpf.Length != 11)
30 | return false;
31 |
32 | int[] multiplicador1 = new int[9] { 10, 9, 8, 7, 6, 5, 4, 3, 2 };
33 | int[] multiplicador2 = new int[10] { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 };
34 | string tempCpf;
35 | string digito;
36 | int soma;
37 | int resto;
38 | tempCpf = cpf.Substring(0, 9);
39 | soma = 0;
40 |
41 | for (int i = 0; i < 9; i++)
42 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador1[i];
43 | resto = soma % 11;
44 | if (resto < 2)
45 | resto = 0;
46 | else
47 | resto = 11 - resto;
48 | digito = resto.ToString();
49 | tempCpf = tempCpf + digito;
50 | soma = 0;
51 | for (int i = 0; i < 10; i++)
52 | soma += int.Parse(tempCpf[i].ToString()) * multiplicador2[i];
53 | resto = soma % 11;
54 | if (resto < 2)
55 | resto = 0;
56 | else
57 | resto = 11 - resto;
58 | digito += resto.ToString();
59 | return cpf.EndsWith(digito);
60 | }
61 |
62 | public static bool CnpjValidator(string cnpj)
63 | {
64 | if (string.IsNullOrEmpty(cnpj)) {
65 | return false;
66 | }
67 |
68 | cnpj = cnpj.Replace(".", "").Replace("-", "").Replace("/", "");
69 | cnpj = cnpj.Trim();
70 | if (cnpj.Length != 14) {
71 | return false;
72 | }
73 |
74 | int[] multiplicador1 = new int[12] { 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
75 | int[] multiplicador2 = new int [13]{ 6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2 };
76 | int soma;
77 | int resto;
78 | string digito;
79 | string tempCnpj;
80 |
81 | tempCnpj = cnpj.Substring(0, 12);
82 | soma = 0;
83 | for (int i = 0; i < 12; i++) {
84 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador1[i];
85 | }
86 | resto = (soma % 11);
87 | if (resto < 2)
88 | resto = 0;
89 | else
90 | resto = 11 - resto;
91 | digito = resto.ToString();
92 | tempCnpj += digito;
93 | soma = 0;
94 | for (int i = 0; i < 13; i++) {
95 | soma += int.Parse(tempCnpj[i].ToString()) * multiplicador2[i];
96 | }
97 | resto = (soma % 11);
98 | if (resto < 2)
99 | resto = 0;
100 | else
101 | resto = 11 - resto;
102 | digito += resto.ToString();
103 | return cnpj.EndsWith(digito);
104 | }
105 |
106 | public static bool CpfCnpjValidator(string cpfCnpj)
107 | {
108 | if (string.IsNullOrEmpty(cpfCnpj))
109 | return true;
110 |
111 | string cpfCnpjRegex = @"([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})";
112 | return (Regex.IsMatch(cpfCnpj, cpfCnpjRegex));
113 | }
114 |
115 | public static bool EmailValidator(string email)
116 | {
117 | if (string.IsNullOrEmpty(email))
118 | return true;
119 |
120 | string emailRegex = @"^(?("")("".+?(? 0)
137 | {
138 | isValid = true;
139 | }
140 |
141 | return isValid;
142 | }
143 |
144 | public static bool PasswordValidator(string password)
145 | {
146 | if (string.IsNullOrEmpty(password))
147 | return true;
148 |
149 | string passwordRegex = @"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$";
150 | return (Regex.IsMatch(password, passwordRegex));
151 | }
152 |
153 |
154 | }
155 | }
156 |
--------------------------------------------------------------------------------
/Xamarin.Forms.BehaviorsPack/Xamarin.Forms.BehaviorValidationPack.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 | true
6 | tbertuzzi
7 | KBits
8 | Useful behaviors for field validation
9 | Copyright ©2020 KBits
10 | http://opensource.org/licenses/MS-PL
11 | https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack/blob/master/Resources/behaviorIcon.png?raw=true
12 | https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack
13 | https://github.com/TBertuzzi/Xamarin.Forms.BehaviorValidationPack
14 | xamarin xamarin.forms xamarin forms validation validators behavior behaviors
15 | 1.1.1.0
16 | 1.1.1.0
17 | 1.1.1
18 | Xamarin.Forms.BehaviorValidationPack
19 | Xamarin.Forms.BehaviorValidationPack
20 | Update CPNJ e CPF Rules
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------