├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Doc
├── Img
│ ├── 2017-12-25_11-28-43.png
│ ├── 2017-12-25_11-29-38.png
│ ├── 2017-12-25_11-31-10.png
│ ├── 2017-12-25_11-31-59.png
│ ├── 2017-12-25_11-33-09.png
│ ├── 2017-12-25_11-33-36.png
│ ├── 2017-12-25_11-40-33.png
│ ├── 2017-12-25_11-41-25.png
│ ├── 2017-12-25_12-14-21.png
│ ├── 2017-12-25_12-15-02.png
│ ├── 2017-12-25_12-22-15.png
│ ├── 2017-12-25_12-23-13.png
│ ├── 2017-12-25_12-24-48.png
│ ├── 2017-12-25_12-25-55.png
│ ├── 2017-12-25_12-51-53.png
│ ├── 2017-12-25_12-55-16.png
│ ├── 2017-12-27_14-26-46.png
│ ├── 2018-01-03_14-40-53.png
│ ├── 2018-01-04_11-14-39.png
│ ├── 2018-01-04_11-15-00.png
│ ├── 2018-01-04_11-30-09.png
│ ├── 2018-01-04_11-32-51.png
│ ├── 2018-01-04_11-34-15.png
│ ├── 2018-01-04_11-34-46.png
│ ├── 2018-01-04_11-35-04.png
│ ├── 2018-01-04_11-35-45.png
│ ├── 2018-01-04_15-18-41.png
│ ├── 2018-01-04_15-19-44.png
│ ├── 2018-01-04_15-24-40.png
│ ├── 2018-01-04_15-25-17.png
│ ├── 2018-01-04_15-26-08.png
│ ├── 2018-01-04_15-30-54.png
│ ├── 2018-01-04_20-33-16.png
│ ├── 2018-01-04_20-33-37.png
│ ├── 2018-01-04_20-35-52.png
│ ├── 2018-01-05_13-43-24.png
│ ├── 2018-01-08_09-53-48.png
│ ├── 2018-01-08_16-12-08.png
│ ├── 2018-01-08_17-23-14.png
│ ├── 2018-01-08_17-43-56.png
│ ├── 2018-01-08_17-45-48.png
│ ├── 2018-01-08_18-06-01.png
│ ├── 2018-01-14_10-57-00.png
│ ├── 2018-01-15_15-01-00.png
│ ├── 2018-01-15_15-57-00.png
│ ├── 2018-01-15_16-15-00.png
│ └── Azure-Functions-Logo.png
├── creating-vs.md
├── creating.md
├── first-client.md
├── implementing.md
├── refactoring-client.md
├── refactoring.md
└── second-client.md
├── LICENSE.md
├── LbCalculator
├── Calculator.Data
│ ├── AdditionResult.cs
│ └── Calculator.Data.csproj
├── LbCalculator.sln
└── LbCalculator
│ ├── .gitignore
│ ├── Add.cs
│ ├── LbCalculator.csproj
│ └── host.json
├── README.md
├── Snippets.vssettings
├── XamCalculator - Start
├── XamCalculator.sln
└── XamCalculator
│ ├── XamCalculator.Android
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── MainActivity.cs
│ ├── Properties
│ │ ├── AndroidManifest.xml
│ │ └── AssemblyInfo.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ ├── Resource.designer.cs
│ │ ├── drawable-hdpi
│ │ │ └── icon.png
│ │ ├── drawable-xhdpi
│ │ │ └── icon.png
│ │ ├── drawable-xxhdpi
│ │ │ └── icon.png
│ │ ├── drawable
│ │ │ └── icon.png
│ │ ├── layout
│ │ │ ├── Main.axml
│ │ │ ├── Tabbar.axml
│ │ │ └── Toolbar.axml
│ │ ├── mipmap-hdpi
│ │ │ └── Icon.png
│ │ ├── mipmap-mdpi
│ │ │ └── Icon.png
│ │ ├── mipmap-xhdpi
│ │ │ └── Icon.png
│ │ ├── mipmap-xxhdpi
│ │ │ └── Icon.png
│ │ ├── mipmap-xxxhdpi
│ │ │ └── Icon.png
│ │ └── values
│ │ │ ├── Strings.xml
│ │ │ └── styles.xml
│ └── XamCalculator.Android.csproj
│ ├── XamCalculator.UWP
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Assets
│ │ ├── LockScreenLogo.scale-100.png
│ │ ├── LockScreenLogo.scale-125.png
│ │ ├── LockScreenLogo.scale-150.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── LockScreenLogo.scale-400.png
│ │ ├── SplashScreen.scale-100.png
│ │ ├── SplashScreen.scale-125.png
│ │ ├── SplashScreen.scale-150.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── SplashScreen.scale-400.png
│ │ ├── Square150x150Logo.scale-100.png
│ │ ├── Square150x150Logo.scale-125.png
│ │ ├── Square150x150Logo.scale-150.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-400.png
│ │ ├── Square44x44Logo.scale-100.png
│ │ ├── Square44x44Logo.scale-125.png
│ │ ├── Square44x44Logo.scale-150.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Square44x44Logo.scale-400.png
│ │ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ │ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ │ ├── StoreLogo.png
│ │ ├── Wide310x150Logo.scale-100.png
│ │ ├── Wide310x150Logo.scale-125.png
│ │ ├── Wide310x150Logo.scale-150.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ └── Wide310x150Logo.scale-400.png
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ └── Default.rd.xml
│ └── XamCalculator.UWP.csproj
│ ├── XamCalculator.iOS
│ ├── AppDelegate.cs
│ ├── 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
│ │ ├── Icon-60@2x.png
│ │ ├── Icon-60@3x.png
│ │ ├── Icon-76.png
│ │ ├── Icon-76@2x.png
│ │ ├── Icon-Small-40.png
│ │ ├── Icon-Small-40@2x.png
│ │ ├── Icon-Small-40@3x.png
│ │ ├── Icon-Small.png
│ │ ├── Icon-Small@2x.png
│ │ ├── Icon-Small@3x.png
│ │ └── LaunchScreen.storyboard
│ ├── XamCalculator.iOS.csproj
│ └── packages.config
│ └── XamCalculator
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ └── XamCalculator.csproj
└── XamCalculator
├── XamCalculator.sln
└── XamCalculator
├── XamCalculator.Android
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Resources
│ ├── AboutResources.txt
│ ├── Resource.designer.cs
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-xhdpi
│ │ └── icon.png
│ ├── drawable-xxhdpi
│ │ └── icon.png
│ ├── drawable
│ │ └── icon.png
│ ├── layout
│ │ ├── Main.axml
│ │ ├── Tabbar.axml
│ │ └── Toolbar.axml
│ ├── mipmap-hdpi
│ │ └── Icon.png
│ ├── mipmap-mdpi
│ │ └── Icon.png
│ ├── mipmap-xhdpi
│ │ └── Icon.png
│ ├── mipmap-xxhdpi
│ │ └── Icon.png
│ ├── mipmap-xxxhdpi
│ │ └── Icon.png
│ └── values
│ │ ├── Strings.xml
│ │ └── styles.xml
└── XamCalculator.Android.csproj
├── XamCalculator.UWP
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── LockScreenLogo.scale-100.png
│ ├── LockScreenLogo.scale-125.png
│ ├── LockScreenLogo.scale-150.png
│ ├── LockScreenLogo.scale-200.png
│ ├── LockScreenLogo.scale-400.png
│ ├── SplashScreen.scale-100.png
│ ├── SplashScreen.scale-125.png
│ ├── SplashScreen.scale-150.png
│ ├── SplashScreen.scale-200.png
│ ├── SplashScreen.scale-400.png
│ ├── Square150x150Logo.scale-100.png
│ ├── Square150x150Logo.scale-125.png
│ ├── Square150x150Logo.scale-150.png
│ ├── Square150x150Logo.scale-200.png
│ ├── Square150x150Logo.scale-400.png
│ ├── Square44x44Logo.scale-100.png
│ ├── Square44x44Logo.scale-125.png
│ ├── Square44x44Logo.scale-150.png
│ ├── Square44x44Logo.scale-200.png
│ ├── Square44x44Logo.scale-400.png
│ ├── Square44x44Logo.targetsize-16_altform-unplated.png
│ ├── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── Square44x44Logo.targetsize-256_altform-unplated.png
│ ├── Square44x44Logo.targetsize-32_altform-unplated.png
│ ├── Square44x44Logo.targetsize-48_altform-unplated.png
│ ├── StoreLogo.png
│ ├── Wide310x150Logo.scale-100.png
│ ├── Wide310x150Logo.scale-125.png
│ ├── Wide310x150Logo.scale-150.png
│ ├── Wide310x150Logo.scale-200.png
│ └── Wide310x150Logo.scale-400.png
├── MainPage.xaml
├── MainPage.xaml.cs
├── Package.appxmanifest
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
└── XamCalculator.UWP.csproj
├── XamCalculator.iOS
├── AppDelegate.cs
├── 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
│ ├── Icon-60@2x.png
│ ├── Icon-60@3x.png
│ ├── Icon-76.png
│ ├── Icon-76@2x.png
│ ├── Icon-Small-40.png
│ ├── Icon-Small-40@2x.png
│ ├── Icon-Small-40@3x.png
│ ├── Icon-Small.png
│ ├── Icon-Small@2x.png
│ ├── Icon-Small@3x.png
│ └── LaunchScreen.storyboard
├── XamCalculator.iOS.csproj
└── packages.config
└── XamCalculator
├── App.xaml
├── App.xaml.cs
├── MainPage.xaml
├── MainPage.xaml.cs
└── XamCalculator.csproj
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
4 | > Please provide us with the following information:
5 | > ---------------------------------------------------------------
6 |
7 | ### This issue is for a: (mark with an `x`)
8 | ```
9 | - [ ] bug report -> please search issues before submitting
10 | - [ ] feature request
11 | - [ ] documentation issue or request
12 | - [ ] regression (a behavior that used to work and stopped in a new release)
13 | ```
14 |
15 | ### Minimal steps to reproduce
16 | >
17 |
18 | ### Any log messages given by the failure
19 | >
20 |
21 | ### Expected/desired behavior
22 | >
23 |
24 | ### OS and Version?
25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
26 |
27 | ### Versions
28 | >
29 |
30 | ### Mention any other details that might be useful
31 |
32 | > ---------------------------------------------------------------
33 | > Thanks! We'll be in touch soon.
34 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Purpose
2 |
3 | * ...
4 |
5 | ## Does this introduce a breaking change?
6 |
7 | ```
8 | [ ] Yes
9 | [ ] No
10 | ```
11 |
12 | ## Pull Request Type
13 | What kind of change does this Pull Request introduce?
14 |
15 |
16 | ```
17 | [ ] Bugfix
18 | [ ] Feature
19 | [ ] Code style update (formatting, local variables)
20 | [ ] Refactoring (no functional changes, no api changes)
21 | [ ] Documentation content changes
22 | [ ] Other... Please describe:
23 | ```
24 |
25 | ## How to Test
26 | * Get the code
27 |
28 | ```
29 | git clone [repo-address]
30 | cd [repo-name]
31 | git checkout [branch-name]
32 | npm install
33 | ```
34 |
35 | * Test the code
36 |
37 | ```
38 | ```
39 |
40 | ## What to Check
41 | Verify that the following are valid
42 | * ...
43 |
44 | ## Other Information
45 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # MSTest test Results
33 | [Tt]est[Rr]esult*/
34 | [Bb]uild[Ll]og.*
35 |
36 | # NUNIT
37 | *.VisualState.xml
38 | TestResult.xml
39 |
40 | # Build Results of an ATL Project
41 | [Dd]ebugPS/
42 | [Rr]eleasePS/
43 | dlldata.c
44 |
45 | # .NET Core
46 | project.lock.json
47 | project.fragment.lock.json
48 | artifacts/
49 | **/Properties/launchSettings.json
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # Visual Studio code coverage results
117 | *.coverage
118 | *.coveragexml
119 |
120 | # NCrunch
121 | _NCrunch_*
122 | .*crunch*.local.xml
123 | nCrunchTemp_*
124 |
125 | # MightyMoose
126 | *.mm.*
127 | AutoTest.Net/
128 |
129 | # Web workbench (sass)
130 | .sass-cache/
131 |
132 | # Installshield output folder
133 | [Ee]xpress/
134 |
135 | # DocProject is a documentation generator add-in
136 | DocProject/buildhelp/
137 | DocProject/Help/*.HxT
138 | DocProject/Help/*.HxC
139 | DocProject/Help/*.hhc
140 | DocProject/Help/*.hhk
141 | DocProject/Help/*.hhp
142 | DocProject/Help/Html2
143 | DocProject/Help/html
144 |
145 | # Click-Once directory
146 | publish/
147 |
148 | # Publish Web Output
149 | *.[Pp]ublish.xml
150 | *.azurePubxml
151 | # TODO: Comment the next line if you want to checkin your web deploy settings
152 | # but database connection strings (with potential passwords) will be unencrypted
153 | *.pubxml
154 | *.publishproj
155 |
156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
157 | # checkin your Azure Web App publish settings, but sensitive information contained
158 | # in these scripts will be unencrypted
159 | PublishScripts/
160 |
161 | # NuGet Packages
162 | *.nupkg
163 | # The packages folder can be ignored because of Package Restore
164 | **/packages/*
165 | # except build/, which is used as an MSBuild target.
166 | !**/packages/build/
167 | # Uncomment if necessary however generally it will be regenerated when needed
168 | #!**/packages/repositories.config
169 | # NuGet v3's project.json files produces more ignorable files
170 | *.nuget.props
171 | *.nuget.targets
172 |
173 | # Microsoft Azure Build Output
174 | csx/
175 | *.build.csdef
176 |
177 | # Microsoft Azure Emulator
178 | ecf/
179 | rcf/
180 |
181 | # Windows Store app package directories and files
182 | AppPackages/
183 | BundleArtifacts/
184 | Package.StoreAssociation.xml
185 | _pkginfo.txt
186 |
187 | # Visual Studio cache files
188 | # files ending in .cache can be ignored
189 | *.[Cc]ache
190 | # but keep track of directories ending in .cache
191 | !*.[Cc]ache/
192 |
193 | # Others
194 | ClientBin/
195 | ~$*
196 | *~
197 | *.dbmdl
198 | *.dbproj.schemaview
199 | *.jfm
200 | *.pfx
201 | *.publishsettings
202 | orleans.codegen.cs
203 |
204 | # Since there are multiple workflows, uncomment next line to ignore bower_components
205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
206 | #bower_components/
207 |
208 | # RIA/Silverlight projects
209 | Generated_Code/
210 |
211 | # Backup & report files from converting an old project file
212 | # to a newer Visual Studio version. Backup files are not needed,
213 | # because we have git ;-)
214 | _UpgradeReport_Files/
215 | Backup*/
216 | UpgradeLog*.XML
217 | UpgradeLog*.htm
218 |
219 | # SQL Server files
220 | *.mdf
221 | *.ldf
222 | *.ndf
223 |
224 | # Business Intelligence projects
225 | *.rdl.data
226 | *.bim.layout
227 | *.bim_*.settings
228 |
229 | # Microsoft Fakes
230 | FakesAssemblies/
231 |
232 | # GhostDoc plugin setting file
233 | *.GhostDoc.xml
234 |
235 | # Node.js Tools for Visual Studio
236 | .ntvs_analysis.dat
237 | node_modules/
238 |
239 | # Typescript v1 declaration files
240 | typings/
241 |
242 | # Visual Studio 6 build log
243 | *.plg
244 |
245 | # Visual Studio 6 workspace options file
246 | *.opt
247 |
248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
249 | *.vbw
250 |
251 | # Visual Studio LightSwitch build output
252 | **/*.HTMLClient/GeneratedArtifacts
253 | **/*.DesktopClient/GeneratedArtifacts
254 | **/*.DesktopClient/ModelManifest.xml
255 | **/*.Server/GeneratedArtifacts
256 | **/*.Server/ModelManifest.xml
257 | _Pvt_Extensions
258 |
259 | # Paket dependency manager
260 | .paket/paket.exe
261 | paket-files/
262 |
263 | # FAKE - F# Make
264 | .fake/
265 |
266 | # JetBrains Rider
267 | .idea/
268 | *.sln.iml
269 |
270 | # CodeRush
271 | .cr/
272 |
273 | # Python Tools for Visual Studio (PTVS)
274 | __pycache__/
275 | *.pyc
276 |
277 | # Cake - Uncomment if you are using it
278 | # tools/**
279 | # !tools/packages.config
280 |
281 | # Telerik's JustMock configuration file
282 | *.jmconfig
283 |
284 | # BizTalk build output
285 | *.btp.cs
286 | *.btm.cs
287 | *.odx.cs
288 | *.xsd.cs
289 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [project-title] Changelog
2 |
3 |
4 | # x.y.z (yyyy-mm-dd)
5 |
6 | *Features*
7 | * ...
8 |
9 | *Bug Fixes*
10 | * ...
11 |
12 | *Breaking Changes*
13 | * ...
14 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to [project-title]
2 |
3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5 | the rights to use your contribution. For details, visit https://cla.microsoft.com.
6 |
7 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
8 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
9 | provided by the bot. You will only need to do this once across all repos using our CLA.
10 |
11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
14 |
15 | - [Code of Conduct](#coc)
16 | - [Issues and Bugs](#issue)
17 | - [Feature Requests](#feature)
18 | - [Submission Guidelines](#submit)
19 |
20 | ## Code of Conduct
21 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
22 |
23 | ## Found an Issue?
24 | If you find a bug in the source code or a mistake in the documentation, you can help us by
25 | [submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
26 | [submit a Pull Request](#submit-pr) with a fix.
27 |
28 | ## Want a Feature?
29 | You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
30 | Repository. If you would like to *implement* a new feature, please submit an issue with
31 | a proposal for your work first, to be sure that we can use it.
32 |
33 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
34 |
35 | ## Submission Guidelines
36 |
37 | ### Submitting an Issue
38 | Before you submit an issue, search the archive, maybe your question was already answered.
39 |
40 | If your issue appears to be a bug, and hasn't been reported, open a new issue.
41 | Help us to maximize the effort we can spend fixing issues and adding new
42 | features, by not reporting duplicate issues. Providing the following information will increase the
43 | chances of your issue being dealt with quickly:
44 |
45 | * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
46 | * **Version** - what version is affected (e.g. 0.1.2)
47 | * **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
48 | * **Browsers and Operating System** - is this a problem with all browsers?
49 | * **Reproduce the Error** - provide a live example or a unambiguous set of steps
50 | * **Related Issues** - has a similar issue been reported before?
51 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
52 | causing the problem (line of code or commit)
53 |
54 | You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new].
55 |
56 | ### Submitting a Pull Request (PR)
57 | Before you submit your Pull Request (PR) consider the following guidelines:
58 |
59 | * Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR
60 | that relates to your submission. You don't want to duplicate effort.
61 |
62 | * Make your changes in a new git fork:
63 |
64 | * Commit your changes using a descriptive commit message
65 | * Push your fork to GitHub:
66 | * In GitHub, create a pull request
67 | * If we suggest changes then:
68 | * Make the required updates.
69 | * Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
70 |
71 | ```shell
72 | git rebase master -i
73 | git push -f
74 | ```
75 |
76 | That's it! Thank you for your contribution!
77 |
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-28-43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-28-43.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-29-38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-29-38.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-31-10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-31-10.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-31-59.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-31-59.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-33-09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-33-09.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-33-36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-33-36.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-40-33.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-40-33.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_11-41-25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_11-41-25.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-14-21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-14-21.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-15-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-15-02.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-22-15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-22-15.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-23-13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-23-13.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-24-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-24-48.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-25-55.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-25-55.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-51-53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-51-53.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-25_12-55-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-25_12-55-16.png
--------------------------------------------------------------------------------
/Doc/Img/2017-12-27_14-26-46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2017-12-27_14-26-46.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-03_14-40-53.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-03_14-40-53.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-14-39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-14-39.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-15-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-15-00.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-30-09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-30-09.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-32-51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-32-51.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-34-15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-34-15.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-34-46.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-34-46.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-35-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-35-04.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_11-35-45.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_11-35-45.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-18-41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-18-41.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-19-44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-19-44.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-24-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-24-40.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-25-17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-25-17.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-26-08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-26-08.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_15-30-54.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_15-30-54.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_20-33-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_20-33-16.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_20-33-37.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_20-33-37.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-04_20-35-52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-04_20-35-52.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-05_13-43-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-05_13-43-24.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_09-53-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_09-53-48.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_16-12-08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_16-12-08.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_17-23-14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_17-23-14.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_17-43-56.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_17-43-56.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_17-45-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_17-45-48.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-08_18-06-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-08_18-06-01.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-14_10-57-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-14_10-57-00.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-15_15-01-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-15_15-01-00.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-15_15-57-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-15_15-57-00.png
--------------------------------------------------------------------------------
/Doc/Img/2018-01-15_16-15-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/2018-01-15_16-15-00.png
--------------------------------------------------------------------------------
/Doc/Img/Azure-Functions-Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/Doc/Img/Azure-Functions-Logo.png
--------------------------------------------------------------------------------
/Doc/creating.md:
--------------------------------------------------------------------------------
1 | # Creating the Azure Function in the Azure Web Portal
2 |
3 | In this section, we will build the Azure Functions application in the Azure web portal and then add an HTTP Triggered function. This will allow us to call the function from the Xamarin client, for example with an [HttpClient](http://gslb.ch/a75a-xamfunc18) instance.
4 |
5 | > Note: If you prefer, you can create the Azure Function in Visual Studio 2017 instead. [A detailed tutorial can be found here](./creating-vs.md).
6 |
7 | To create the Azure Functions application in the Azure portal, follow these steps:
8 |
9 | 1. Log into the [Azure Portal](http://portal.azure.com) with your user account.
10 |
11 | > Note: You will need an Azure account to create this sample. If you don't have one already, [you can get a free trial account here](http://gslb.ch/a17a-xamfunc18).
12 |
13 | 2. Click the "Create a resource" menu item.
14 |
15 | 
16 |
17 | 3. In the Azure Marketplace, select "Serverless Function App".
18 |
19 | 
20 |
21 | 4. Fill the form with the following data:
22 |
23 | - App Name: This is a unique name for your application. One application can contain multiple functions.
24 |
25 | - Subscription: The subscription to which these functions will be billed. In some cases you will only see one subscription here, but some people have multiple subscriptions associated to their account.
26 |
27 | - Resource group: This is a logical grouping of Azure resources. It makes sense to have one resource group per application, so you can easily locate the resources that you are using. In this case we are creating a new resource group for this application.
28 |
29 | - OS: The operating system of the server on which the functions will run.
30 |
31 | - Hosting plan: This shows how the function usage will be billed.
32 | - Consumption plan means that the function will be billed whenever it is called, and only for the time that it runs. This is the best plan to get started.
33 | - App Service Plan is best after your business starts attracting more users and you need some more predictable billing.
34 |
35 | - Location will be the physical location of the server on which your functions will run. You should choose a server close to your users.
36 |
37 | - Storage: You can either create a new storage account, or use an existing one. Note that this sample doesn't use storage but you still need to specify a storage account.
38 |
39 | > Note: The storage account name should be entered in lower case.
40 |
41 | - Application Insights: If you want to add extra analytics on your functions application, you can switch this on. This provides you with stats about the usage, crash reports, custom events, etc. In this sample we will not use Application Insights.
42 |
43 | 
44 |
45 | 5. Click the Create button. This will trigger the deployment, and you should see a popup like shown below.
46 |
47 | 
48 |
49 | 6. After a moment, you should see a new notification: Deployment succeeded. You can then click the button to go to the resource, or simply close the notification.
50 |
51 | 
52 |
53 | > Note: You can always go back to the application by clicking on the Function Apps menu item on the left-hand side.
54 |
55 | 
56 |
57 | 7. Once you are in the Functions Apps section in the portal, expand the application itself. Next to the "Functions" submenu, click on the "+" sign when you hover over the submenu.
58 |
59 | 
60 |
61 | Now we need to choose what will *trigger* the function that we will create. There are a large number of triggers available and we cannot review all of them here, but there is [documentation available on our Docs website](http://gslb.ch/a63a-xamfunc18). The most common triggers are:
62 |
63 | - [HTTP Trigger](http://gslb.ch/a65a-xamfunc18): The function will be executed when an HTTP request arrives. This is the type of trigger we will use.
64 | - [Timer trigger](http://gslb.ch/a66a-xamfunc18): The function is executed every interval of time, where the interval is specified [by a CRON expression](https://en.wikipedia.org/wiki/Cron#CRON_expression).
65 | - [Blob trigger](http://gslb.ch/a64a-xamfunc18): The function is executed when a file is uploaded to a given blob container
66 | - [and more...](http://gslb.ch/a63a-xamfunc18)
67 |
68 | 8. Click on the "Custom function" button as shown below.
69 |
70 | 
71 |
72 | 9. You will now see a large list of potential triggers, which can be implemented in various languages. Scroll down until you see the "HTTP trigger with parameter". In this sample, we will create the function in C#, so click the corresponding button.
73 |
74 | 
75 |
76 | 10. Enter a name for the function (for example "Add") and press Create.
77 |
78 | 
79 |
80 | 11. The function is created, and some basic implementation is added. Let's test to see how the function works. Since it is an HTTP trigger, we can execute the function by calling a URL. You can get the URL from the top right corner, where the "Get function URL" button is found.
81 |
82 | 
83 |
84 | 12. Copy the URL from the popup window.
85 |
86 | 
87 |
88 | 13. Open a web browser window and paste the link into the location bar. Before you press the Enter key, make sure to replace the ```{name}``` parameter in the URL with your own name. Then press enter and you should see the response "Hello Laurent" appear (except that your own name should be shown instead of Laurent).
89 |
90 | ## Conclusion
91 |
92 | We now have the infrastructure in place for our Azure Function. Once you are a bit more experienced, the process of creating such a function should not take more than a few minutes.
93 |
94 | [In the next section, we will now modify the function's interface and then implement it.](./implementing.md)
--------------------------------------------------------------------------------
/Doc/first-client.md:
--------------------------------------------------------------------------------
1 | # Implementing the first version of the Xamarin.Forms client app
2 |
3 | We will start this sample by creating a Xamarin.Forms client app which works offline. Then we will see how we can transfer the business logic of this app to the Azure cloud.
4 |
5 | > Note: If you are already familiar with Xamarin.Forms, you can jump to the next step without fear. You will find the client that we create in this page in [the XamCalculator - Start folder](https://github.com/lbugnion/sample-azure-simplexamarinfunction/tree/master/XamCalculator%20-%20Start).
6 |
7 | The Xamarin client app that we create here is extremely simple and obviously not a real life scenario. However it shows all the steps necessary to creating the client and the server applications, and it should give you a good jumpstart into your own projects and use cases.
8 |
9 | 1. In Visual Studio 2017, select File > New > Project.
10 |
11 | > Note: We use Visual Studio 2017 on Windows for this sample, but you can also create Xamarin.Forms applications in Visual Studio for Mac if you prefer. Xamarin is available for free in all editions of Visual Studio, including the free Community edition, on PC and Mac.
12 | > - [Visual Studio Community Edition for Windows](http://gslb.ch/a72a-xamfunc18)
13 | > - [Visual Studio for Mac](http://gslb.ch/a73a-xamfunc18)
14 |
15 | 2. In the New Project dialog, select the Cross-Platform category, and then Cross-Platform App (Xamarin.Forms) with Visual C#. Name the new application ```XamCalculator```, select a location for the project and press OK.
16 |
17 | 
18 |
19 | > Note: The Cross-platform category is available if you selected the "Mobile development with .NET" workload in the Visual Studio 2017 installer.
20 |
21 | 3. In the New Cross Platform App dialog, select the following settings, then press OK.
22 | - Android, iOS and Windows
23 | - Xamarin.Forms
24 | - .NET Standard
25 |
26 | 
27 |
28 | The new application consists of 4 projects:
29 |
30 | - XamCalculator: This is the shared .NET Standard project, where we will implement the UI and the code calling the function. This project is referenced by each of the 3 other projects.
31 | - XamCalculator.Android: The Android version of the application.
32 | - XamCalculator.iOS: The iOS version of the application.
33 | - XamCalculator.UWP: The Universal Windows Platform (UWP) of the application.
34 |
35 | Later we will see how we can select each application to test it and run it.
36 |
37 | 4. In the XamCalculator project, select the MainPage.xaml and open it in the editor.
38 |
39 | 5. Replace the existing XAML with the following:
40 |
41 | ```xml
42 |
43 |
47 |
48 |
50 |
51 |
54 |
55 |
58 |
59 |
61 |
62 |
66 |
67 |
68 |
69 | ```
70 |
71 | The code above creates a new user interface with 4 UI elements placed under each other. The layout is performed by the ```StackLayout``` panel. By default, the StackLayout uses a vertical layout, but it could also be changed to horizontal if needed. [There are many other layout types](http://gslb.ch/a67a-xamfunc18) that can be used to create more complex layouts.
72 |
73 | - The first and second UI elements are [Entry controls](http://gslb.ch/a68a-xamfunc18) where the user will be able to enter some text. We will access this text from the code behind. Note how we use the [Placeholder property](http://gslb.ch/a69a-xamfunc18) to show a placeholder text when the field is empty. The controls are named ```Number1``` and ```Number2```.
74 |
75 | - The third element is a [Button control](http://gslb.ch/a70a-xamfunc18). This control can be clicked by the user, which will create an event that we will respond to. The button is named ```AddButton```.
76 |
77 | - The last element is a [Label control](http://gslb.ch/a71a-xamfunc18), used to show some simple text output to the user. The Label is named ```Result```.
78 |
79 | 6. Open the MainPage.xaml.cs now. This C# code file is what we call "code behind". This is the view's controller, where we will handle events and modify the UI accordingly.
80 |
81 | 7. Modify the MainPage class to look like this:
82 |
83 | ```CS
84 | public partial class MainPage : ContentPage
85 | {
86 | public MainPage()
87 | {
88 | InitializeComponent();
89 |
90 | AddButton.Clicked += async (s, e) =>
91 | {
92 | int number1 = 0, number2 = 0;
93 |
94 | var success = int.TryParse(Number1.Text, out number1)
95 | && int.TryParse(Number2.Text, out number2);
96 |
97 | if (!success)
98 | {
99 | await DisplayAlert(
100 | "Error in inputs",
101 | "You must enter two integers", "OK");
102 | return;
103 | }
104 |
105 | var result = number1 + number2;
106 | Result.Text = result + $" {result.GetType()}";
107 | };
108 | }
109 | }
110 | ```
111 |
112 | Let's review the code above:
113 |
114 | - In the ```MainPage``` constructor, we handle the Clicked event of the Button control. When this event is called, the event handler will be executed.
115 |
116 | - We parse the text that the user entered. We want to make sure that we send integers to the server, to avoid error there. Parsing the text with the ```TryParse``` method ensures that the user input is suitable.
117 |
118 | - If the user enters incorrect inputs, we show a warning message and we stop the execution.
119 |
120 | - If the user input is correct, we perform the addition.
121 |
122 | - Finally, we show the result to the user, as well as the type of the result.
123 |
124 | Now we can test the application and see if it works as expected.
125 |
126 | ## Testing the app
127 |
128 | You can run and test the application on an emulator/simulator, or on a device directly.
129 |
130 | ### On Android
131 |
132 | For example, here is how you can test the app on Android:
133 |
134 | 1. Right-click on the Android application and select "Set as Startup Project".
135 |
136 | 
137 |
138 | 2. Make sure that an emulator is selected in the Run dropdown.
139 |
140 | 
141 |
142 | 3. Press the Run button to debug the code.
143 |
144 | 4. In the emulator window, enter two operands and press the Add button. After a short wait, you should see the result.
145 |
146 | 
147 |
148 | ### On iOS and Windows
149 |
150 | You can of course also test on iOS and Windows. To do this [you can follow the steps described here](./second-client.md#testing-the-client-app). The result you will see should be very similar to what you see on Android.
151 |
152 | ## Conclusion
153 |
154 | Our "offline" client app works great, but now is the time to leverage the power of the cloud. Of course for this extremely simple sample, putting code in the cloud makes literally no sense. However there are many other scenarios where leveraging Azure is a great idea:
155 |
156 | - You can take advantage of a server to process calculations that would be too complex or too slow on a mobile client.
157 |
158 | - You can have one server processing the code and caching the results instead of thousands of mobile clients, thus saving resources.
159 |
160 | - and dozens more reasons.
161 |
162 | We will now show you how to create an Azure Functions app ([in the Azure portal](./creating.md) or [in Visual Studio 2017](./creating-vs.md)), move the business logic code from the Xamarin client app to the cloud, and then [modify the Xamarin client app](./second-client.md) to use this new online resource.
--------------------------------------------------------------------------------
/Doc/implementing.md:
--------------------------------------------------------------------------------
1 | # Modifying the function's interface and implementing it
2 |
3 | At this stage [we have created a basic function with the default implementation in the Azure portal](./creating.md). Now we are going to modify its interface to suit our purpose, and we will implement its code.
4 |
5 | > Note: You can also create the Azure Function in Visual Studio 2017 if you prefer. [You can find a complete tutorial here](./creating-vs.md).
6 |
7 | ## Modifying the interface
8 |
9 | At the moment, our function's URL looks something like:
10 |
11 | ```https://xamfunctionssample.azurewebsites.net/HttpTriggerCSharp/name/{name}?code=9r9jauRrThIFjGcP1nz3xRJLiriF9IAo5dmPlsLHBfS4hq0gv06E7A==```
12 |
13 | What we need for our "Add" function however is two operands. We will call them ```num1``` and ```num2```. Also, the name ```HttpTriggerCSharp``` is not very descriptive and we will use a better name such as ```add```. So our target URL should be:
14 |
15 | ```https://xamfunctionssample.azurewebsites.net/api/add/num1/{num1}/num2/{num2}?code=9r9jauRrThIFjGcP1nz3xRJLiriF9IAo5dmPlsLHBfS4hq0gv06E7A==```
16 |
17 | 1. In the web portal, under the function's name, click on the Integrate menu item.
18 |
19 | 
20 |
21 | 2. Modify the ```Route template``` to look like the following:
22 |
23 | ```
24 | add/num1/{num1}/num2/{num2}
25 | ```
26 |
27 | 
28 |
29 | 3. Click again on the name of the function, just above the Integrate menu item. This should display the code again in the editor window.
30 |
31 | 4. Modify the code to look like this:
32 |
33 | ```CS
34 | using System.Net;
35 |
36 | public static HttpResponseMessage Run(
37 | HttpRequestMessage req,
38 | int num1,
39 | int num2,
40 | TraceWriter log)
41 | {
42 | log.Info($"C# HTTP trigger function processed a request with {num1} and {num2}");
43 |
44 | // Fetching the name from the path parameter in the request URL
45 | return req.CreateResponse(HttpStatusCode.OK, $"Called {num1} + {num2}" );
46 | }
47 | ```
48 |
49 | The code above expects two parameters ```num1``` and ```num2``` of type ```int```. The mapping between the URL and the function's signature will be done by the Azure Functions runtime.
50 |
51 | ## Testing the new signature
52 |
53 | You can test the new signature with the following steps:
54 |
55 | 1. In the web portal, under the function's code, expand the Logs section.
56 |
57 | 
58 |
59 | 2. Click again on the "Get function URL" button on the top right corner.
60 |
61 | 3. Copy the URL from the popup box. Notice that it should correspond to the URL we wanted to target earlier.
62 |
63 | 4. Paste the URL in the location bar of a new browser window.
64 |
65 | 5. Replace the ```{num1}``` parameter with an integer, for example ```12```.
66 |
67 | 6. Replace the ```{num2}``` parameter with another integer, for example ```34```.
68 |
69 | 7. Press enter to load the URL in the browser window. After a short wait, you should see the result:
70 |
71 | ```
72 | Called 12 + 34
73 | ```
74 |
75 | 8. Switch back to the logs section in the function's browser window. You should see a log entry there looking like:
76 |
77 | ```
78 | 2017-12-27T13:30:05.126 Function started (Id=525c6fba-a346-4df7-a133-007660da482e)
79 |
80 | 2017-12-27T13:30:05.254 C# HTTP trigger function processed a request with 12 and 34
81 |
82 | 2017-12-27T13:30:05.254 Function completed (Success, Id=525c6fba-a346-4df7-a133-007660da482e, Duration=129ms)
83 | ```
84 |
85 | In case there is an issue with the function, the log window will give additional indications. You can of course add more logging calls if necessary.
86 |
87 | ## Implementing the Add function
88 |
89 | Now that we know that the function works with the new signature, we can implement the addition code:
90 |
91 | 1. Replace the function's body with the following code:
92 |
93 | ```CS
94 | using System.Net;
95 |
96 | public static HttpResponseMessage Run(
97 | HttpRequestMessage req,
98 | int num1,
99 | int num2,
100 | TraceWriter log)
101 | {
102 | log.Info($"C# HTTP trigger function processed a request with {num1} and {num2}");
103 |
104 | var addition = num1 + num2;
105 |
106 | // Fetching the name from the path parameter in the request URL
107 | return req.CreateResponse(HttpStatusCode.OK, addition);
108 | }
109 | ```
110 |
111 | 2. Return to the previous browser window where we tested the function's signature before, and refresh the page. After a short wait, you should now see the result ```46```.
112 |
113 | Interestingly, in the code above we simply declared that ```num1``` and ```num2``` are integers, and the Azure Functions runtime automatically parsed the values from the URL into integers for us. This is quite convenient.
114 |
115 | ## Getting the URL for the Xamarin client app
116 |
117 | Later in the sample, we will need the URL of the service for our client. Since all the communication between the client and the server happens over HTTP, the URL is the interface for it.
118 |
119 | 3. In the web portal, above the code editor window, click on the "Get function URL" button.
120 |
121 | 
122 |
123 | 4. Copy the URL from the pop-up window and keep it safe for later.
124 |
125 | 
126 |
127 | ## Conclusion
128 |
129 | Our function's code is now complete. We can now [move to the client's implementation](./first-client.md).
130 |
131 |
--------------------------------------------------------------------------------
/Doc/refactoring-client.md:
--------------------------------------------------------------------------------
1 | # Refactoring the Xamarin client app to use JSON
2 |
3 | The function is now returning a JSON-formatted string. Thankfully parsing JSON in C# is extremely easy with the help of the [JSON.NET Nuget package](https://www.nuget.org/packages/Newtonsoft.Json). In this section, we will add the Nuget package to our Xamarin application, and then modify the code slightly to take advantage of this package and deserialize the JSON result.
4 |
5 | 1. Open the XamCalculator solution in Visual Studio.
6 |
7 | 2. In the Solution Explorer, right-click on the XamCalculator solution and select "Manage Nuget Packages for Solution" from the context menu.
8 |
9 | 
10 |
11 | 3. Make sure that Browse is selected and type ```json.net``` in the search box.
12 |
13 | 4. Select Newtonsoft.Json from the list.
14 |
15 | 
16 |
17 | 5. On the right hand side, make sure to select the XamCalculator project and click on the Install button. If needed, accept the license.
18 |
19 | 
20 |
21 | ## Adding the class library
22 |
23 | When we modified the server side code, we added a portable class library (PCL) to the Azure Functions application and stored the object code into this library. This will allow us to easily reuse this code in the client application too.
24 |
25 | 1. In the Solution Explorer, right click on the XamCalculator solution and select Add, Existing Project from the context menu.
26 |
27 | 2. Navigate to the Calculator.Data project that we created earlier. You need to locate the file Calculator.Data.csproj and select it in the dialog.
28 |
29 | 3. Right click on the XamCalculator project (not the Solution but the main project of the Xamarin.Forms application) and select Add, Reference from the context menu.
30 |
31 | 4. In the Reference Manager dialog, select the Calculator.Data project and click on OK.
32 |
33 | 5. Open the file MainPage.xaml.cs and update the code of the try/catch block as follows. Note that nothing else changes in the client application!
34 |
35 | ```CS
36 | try
37 | {
38 | var url = Url.Replace("{num1}", number1.ToString())
39 | .Replace("{num2}", number2.ToString());
40 |
41 | var json = await Client.GetStringAsync(url);
42 |
43 | var deserialized = JsonConvert.DeserializeObject(json);
44 |
45 | Result.Text = deserialized.Result + $" {deserialized.Result.GetType()}";
46 | }
47 | catch (Exception ex)
48 | {
49 | error = ex;
50 | }
51 | ```
52 |
53 | The changes to the client application are very minor: We use exactly the same URL with the two operands. What we get from the service is now a JSON-formatted string.
54 |
55 | The next step is to deserialize the JSON into an instance of the ```AdditionResult``` class. This is the exact same class that we used on the server. The JSON format is only used for the HTTP transport.
56 |
57 | Finally, we use the ```Result``` property of the ```AdditionResult``` class. You can now test the application again in iOS, Android or in Windows 10 UWP (following [the instructions we used earlier](./first-client.md#testing-the-client-app)). For example, here is the application running in the Android emulator:
58 |
59 | 
60 |
61 | Note how the ```Result``` property is now of type ```System.Int32``` instead of ```System.String``` like before. Also, we can pass multiple values from the server to the client, and easily add properties to the ```AdditionResult``` class if needed for new features of the application.
62 |
63 | ## Conclusion
64 |
65 | At this point, we have an Azure Functions application with one HTTP endpoint, and a Xamarin.Forms app running on iOS, Android and Windows 10. The server and the client use JSON to communicate. Modifying and extending the application for your own usage should be straightforward.
66 |
67 | This concludes this sample. We hope that you found this code and tutorial useful. Please don't hesitate to enter comments and questions in the Issues tab above. You can also contact me privately but I prefer to keep the discussion in the open, so everyone can see the answers.
68 |
69 | Happy coding!
70 |
71 | [Laurent](https://twitter.com/lbugnion)
--------------------------------------------------------------------------------
/Doc/refactoring.md:
--------------------------------------------------------------------------------
1 | # Refactoring the Function to use JSON
2 |
3 | One thing that we notice [when we use the Xamarin client](./second-client.md) is that the type of the result is ```System.String```. This is because we use HTTP to communicate between the client and the server, and HTTP (HyperText Transfer Protocol) is of course text-based. As such, it means that we need an additional agreement between the client and the server, to specify the type of the result, so that the client can parse it and convert the result to the desired type. If the server developer decides to change the implementation and the type of the result, or to add more information in the result, the client developer needs to be notified and update the application accordingly. This is not very efficient.
4 |
5 | To avoid this kind of issues, many APIs these days use the JavaScript Object Notation JSON to encode the result of the function. JSON has various advantages: It is easy to serialize/deserialize and it can be transmitted as text over HTTP. We will now update our sample implementation to use JSON instead of a simple result.
6 |
7 | > Note: Some APIs also use XML to transmit data. XML is also text-based, so it also works fine with HTTP. However XML is more verbose than JSON and thus is lost in popularity, especially for mobile clients.
8 |
9 | ## Adding a class library
10 |
11 | In order to share code between the client and the server, we will use a class library that we will consume on the server and on the client. The class library can be seen as a contract between client and server. In this sample, we use .NET Standard for the Azure Function, so we will also create a .NET Standard class library. If you have selected a .NET Framework Azure Functions app, you can select a Portable Class Library here.
12 |
13 | Follow the steps to add the class library to the server project:
14 |
15 | 1. Open the Functions application project in Visual Studio.
16 |
17 | 2. In the Solution Explorer, right click on the Solution name and select Add, New Project from the context menu.
18 |
19 | 3. In the Add New Project dialog, select the .NET Standard category on the left-hand side, and then Class Library (.NET Standard).
20 |
21 | 4. Enter a name (for example Calculator.Data) and a location for the new project.
22 |
23 | 
24 |
25 | 5. In the Calculator.Data project, rename the file Class1.cs to AdditionResult.cs
26 |
27 | 7. Replace the class with the following code. For the sake of the sample, we will transmit the result of the addition as well as the current date/time on the server. We could also easily decide to transmit more information if necessary.
28 |
29 | ```CS
30 | public class AdditionResult
31 | {
32 | public int Result
33 | {
34 | get;
35 | set;
36 | }
37 |
38 | public DateTime TimeOnServer
39 | {
40 | get;
41 | set;
42 | }
43 | }
44 | ```
45 |
46 | ## Consuming the class library on the server
47 |
48 | Now that we have our new Data class library, we will use it on the server and modify the Function accordingly.
49 |
50 | 1. Right click on the LbCalculator Function project and select Add, Reference from the context menu.
51 |
52 | 2. In the Reference Manager dialog, select the Calculator.Data class library and press OK.
53 |
54 | 
55 |
56 | 3. Reopen the Add.cs file in the Azure Function application.
57 |
58 | 4. Replace the ```Add``` class with the following code:
59 |
60 | ```CS
61 | public static class Add
62 | {
63 | [FunctionName("Add")]
64 | public static IActionResult Run(
65 | [HttpTrigger(
66 | AuthorizationLevel.Function,
67 | "get",
68 | Route = "add/num1/{num1}/num2/{num2}")]
69 | HttpRequest req,
70 | int num1,
71 | int num2,
72 | TraceWriter log)
73 | {
74 | log.Info($"C# HTTP trigger function processed a request with {num1} and {num2}");
75 |
76 | var result = new AdditionResult
77 | {
78 | Result = num1 + num2,
79 | TimeOnServer = DateTime.Now
80 | };
81 |
82 | return new OkObjectResult(result);
83 | }
84 | }
85 | ```
86 | There are a few small changes to the previous version of the function:
87 |
88 | - The result is now an instance of the ```AdditionResult``` class that we added earlier in the ```Calculator.Data``` class library. Note how we also store the date/time on the server.
89 |
90 | - Instead of the ```addition```, we pass the ```result``` instance to the ```OkObjectResult``` constructor now.
91 |
92 | The ```result``` object will automatically be serialized to the JavaScript Object Notation JSON and passed back to the caller.
93 |
94 | ## Testing the new interface
95 |
96 | Now we can test the new function result in the web browser.
97 |
98 | 1. In Visual Studio, select Debug, Start without Debugging from the menu bar.
99 |
100 | 2. In the Command window with the Azure Runtime that opens up, copy the debug URL from the ```Http Function``` section (in green).
101 |
102 | 3. Like before, paste the debug URL in a web browser and replace the ```{num1}``` and ```{num2}``` occurrences in the URL with operands, for example ```12``` and ```34```.
103 |
104 | 4. In the web browser, you should now see a result looking like
105 |
106 | ```json
107 | {"Result":46,"TimeOnServer":"2018-01-08T10:11:54.5719894-08:00"}
108 | ```
109 |
110 | ## Publishing the new function to Azure
111 |
112 | Now that the code changed, we will publish the updated function to Azure. The process is easier [than the first time we did that](./creating-vs.md#publishing-the-function-to-azure), because we don't have to specify all the parameters again.
113 |
114 | 1. In Visual Studio, in the Solution Explorer, right click on the Azure functions application name and select Publish from the context menu.
115 |
116 | If everything went well before, the publication parameters should be all saved and available in Visual Studio. You should see something similar to the image below:
117 |
118 | 
119 |
120 | If you don't see something like that, you might have to re-publish the application to Azure. Follow the steps we did earlier, and select the existing functions application instead of creating a new one from scratch.
121 |
122 | 2. Press on the Publish button. You can see the progress in Visual Studio's Output window.
123 |
124 | 3. After a short while, the changes are published to Azure. You can test the new function's interface by using [the exact same URL we obtained before from the Azure web portal](./creating-vs.md#getting-the-url-for-the-xamarin-client-app). Simply reload this URL in the web browser, and you should now see a JSON formatted result, including the date/time on the server.
125 |
126 | > Note: If you are observant, you might notice that the date/time returned by the server is always the UTC date/time, even if you selected a different region when you created the functions application. This is because all Azure servers run in UTC date/time, to make it easier to let applications communicate with each other.
127 |
128 | ## Conclusion
129 |
130 | Now that we saw that the new interface of the Azure function works fine, and the function now returns a JSON-formatted result. [We can now modify the Xamarin.Forms client](./refactoring-client.md) to take advantage of the new result.
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
--------------------------------------------------------------------------------
/LbCalculator/Calculator.Data/AdditionResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Calculator.Data
4 | {
5 | public class AdditionResult
6 | {
7 | public int Result
8 | {
9 | get;
10 | set;
11 | }
12 |
13 | public DateTime TimeOnServer
14 | {
15 | get;
16 | set;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/LbCalculator/Calculator.Data/Calculator.Data.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/LbCalculator/LbCalculator.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27130.2020
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LbCalculator", "LbCalculator\LbCalculator.csproj", "{2A9748FC-D60E-40AE-BE5C-988128DFB17F}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Calculator.Data", "Calculator.Data\Calculator.Data.csproj", "{181116A3-A973-4288-8CDF-BC5E8D810120}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {2A9748FC-D60E-40AE-BE5C-988128DFB17F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {2A9748FC-D60E-40AE-BE5C-988128DFB17F}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {2A9748FC-D60E-40AE-BE5C-988128DFB17F}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {2A9748FC-D60E-40AE-BE5C-988128DFB17F}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {181116A3-A973-4288-8CDF-BC5E8D810120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {181116A3-A973-4288-8CDF-BC5E8D810120}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {181116A3-A973-4288-8CDF-BC5E8D810120}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {181116A3-A973-4288-8CDF-BC5E8D810120}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {BEF6B969-3B7A-4E74-9C98-9B0AA2C2CA4E}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/LbCalculator/LbCalculator/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # Azure Functions localsettings file
5 | local.settings.json
6 |
7 | # User-specific files
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # MSTest test Results
34 | [Tt]est[Rr]esult*/
35 | [Bb]uild[Ll]og.*
36 |
37 | # NUNIT
38 | *.VisualState.xml
39 | TestResult.xml
40 |
41 | # Build Results of an ATL Project
42 | [Dd]ebugPS/
43 | [Rr]eleasePS/
44 | dlldata.c
45 |
46 | # DNX
47 | project.lock.json
48 | project.fragment.lock.json
49 | artifacts/
50 |
51 | *_i.c
52 | *_p.c
53 | *_i.h
54 | *.ilk
55 | *.meta
56 | *.obj
57 | *.pch
58 | *.pdb
59 | *.pgc
60 | *.pgd
61 | *.rsp
62 | *.sbr
63 | *.tlb
64 | *.tli
65 | *.tlh
66 | *.tmp
67 | *.tmp_proj
68 | *.log
69 | *.vspscc
70 | *.vssscc
71 | .builds
72 | *.pidb
73 | *.svclog
74 | *.scc
75 |
76 | # Chutzpah Test files
77 | _Chutzpah*
78 |
79 | # Visual C++ cache files
80 | ipch/
81 | *.aps
82 | *.ncb
83 | *.opendb
84 | *.opensdf
85 | *.sdf
86 | *.cachefile
87 | *.VC.db
88 | *.VC.VC.opendb
89 |
90 | # Visual Studio profiler
91 | *.psess
92 | *.vsp
93 | *.vspx
94 | *.sap
95 |
96 | # TFS 2012 Local Workspace
97 | $tf/
98 |
99 | # Guidance Automation Toolkit
100 | *.gpState
101 |
102 | # ReSharper is a .NET coding add-in
103 | _ReSharper*/
104 | *.[Rr]e[Ss]harper
105 | *.DotSettings.user
106 |
107 | # JustCode is a .NET coding add-in
108 | .JustCode
109 |
110 | # TeamCity is a build add-in
111 | _TeamCity*
112 |
113 | # DotCover is a Code Coverage Tool
114 | *.dotCover
115 |
116 | # NCrunch
117 | _NCrunch_*
118 | .*crunch*.local.xml
119 | nCrunchTemp_*
120 |
121 | # MightyMoose
122 | *.mm.*
123 | AutoTest.Net/
124 |
125 | # Web workbench (sass)
126 | .sass-cache/
127 |
128 | # Installshield output folder
129 | [Ee]xpress/
130 |
131 | # DocProject is a documentation generator add-in
132 | DocProject/buildhelp/
133 | DocProject/Help/*.HxT
134 | DocProject/Help/*.HxC
135 | DocProject/Help/*.hhc
136 | DocProject/Help/*.hhk
137 | DocProject/Help/*.hhp
138 | DocProject/Help/Html2
139 | DocProject/Help/html
140 |
141 | # Click-Once directory
142 | publish/
143 |
144 | # Publish Web Output
145 | *.[Pp]ublish.xml
146 | *.azurePubxml
147 | # TODO: Comment the next line if you want to checkin your web deploy settings
148 | # but database connection strings (with potential passwords) will be unencrypted
149 | #*.pubxml
150 | *.publishproj
151 |
152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
153 | # checkin your Azure Web App publish settings, but sensitive information contained
154 | # in these scripts will be unencrypted
155 | PublishScripts/
156 |
157 | # NuGet Packages
158 | *.nupkg
159 | # The packages folder can be ignored because of Package Restore
160 | **/packages/*
161 | # except build/, which is used as an MSBuild target.
162 | !**/packages/build/
163 | # Uncomment if necessary however generally it will be regenerated when needed
164 | #!**/packages/repositories.config
165 | # NuGet v3's project.json files produces more ignoreable files
166 | *.nuget.props
167 | *.nuget.targets
168 |
169 | # Microsoft Azure Build Output
170 | csx/
171 | *.build.csdef
172 |
173 | # Microsoft Azure Emulator
174 | ecf/
175 | rcf/
176 |
177 | # Windows Store app package directories and files
178 | AppPackages/
179 | BundleArtifacts/
180 | Package.StoreAssociation.xml
181 | _pkginfo.txt
182 |
183 | # Visual Studio cache files
184 | # files ending in .cache can be ignored
185 | *.[Cc]ache
186 | # but keep track of directories ending in .cache
187 | !*.[Cc]ache/
188 |
189 | # Others
190 | ClientBin/
191 | ~$*
192 | *~
193 | *.dbmdl
194 | *.dbproj.schemaview
195 | *.jfm
196 | *.pfx
197 | *.publishsettings
198 | node_modules/
199 | orleans.codegen.cs
200 |
201 | # Since there are multiple workflows, uncomment next line to ignore bower_components
202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
203 | #bower_components/
204 |
205 | # RIA/Silverlight projects
206 | Generated_Code/
207 |
208 | # Backup & report files from converting an old project file
209 | # to a newer Visual Studio version. Backup files are not needed,
210 | # because we have git ;-)
211 | _UpgradeReport_Files/
212 | Backup*/
213 | UpgradeLog*.XML
214 | UpgradeLog*.htm
215 |
216 | # SQL Server files
217 | *.mdf
218 | *.ldf
219 |
220 | # Business Intelligence projects
221 | *.rdl.data
222 | *.bim.layout
223 | *.bim_*.settings
224 |
225 | # Microsoft Fakes
226 | FakesAssemblies/
227 |
228 | # GhostDoc plugin setting file
229 | *.GhostDoc.xml
230 |
231 | # Node.js Tools for Visual Studio
232 | .ntvs_analysis.dat
233 |
234 | # Visual Studio 6 build log
235 | *.plg
236 |
237 | # Visual Studio 6 workspace options file
238 | *.opt
239 |
240 | # Visual Studio LightSwitch build output
241 | **/*.HTMLClient/GeneratedArtifacts
242 | **/*.DesktopClient/GeneratedArtifacts
243 | **/*.DesktopClient/ModelManifest.xml
244 | **/*.Server/GeneratedArtifacts
245 | **/*.Server/ModelManifest.xml
246 | _Pvt_Extensions
247 |
248 | # Paket dependency manager
249 | .paket/paket.exe
250 | paket-files/
251 |
252 | # FAKE - F# Make
253 | .fake/
254 |
255 | # JetBrains Rider
256 | .idea/
257 | *.sln.iml
258 |
259 | # CodeRush
260 | .cr/
261 |
262 | # Python Tools for Visual Studio (PTVS)
263 | __pycache__/
264 | *.pyc
--------------------------------------------------------------------------------
/LbCalculator/LbCalculator/Add.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.Azure.WebJobs;
3 | using Microsoft.Azure.WebJobs.Extensions.Http;
4 | using Microsoft.AspNetCore.Http;
5 | using Calculator.Data;
6 | using System;
7 | using Microsoft.Extensions.Logging;
8 |
9 | namespace LbCalculator
10 | {
11 | public static class Add
12 | {
13 | [FunctionName("Add")]
14 | public static IActionResult Run(
15 | [HttpTrigger(
16 | AuthorizationLevel.Function,
17 | "get",
18 | Route = "add/num1/{num1}/num2/{num2}")]
19 | HttpRequest req,
20 | int num1,
21 | int num2,
22 | ILogger log)
23 | {
24 | log.LogInformation($"C# HTTP trigger function processed a request with {num1} and {num2}");
25 |
26 | var result = new AdditionResult
27 | {
28 | Result = num1 + num2,
29 | TimeOnServer = DateTime.Now
30 | };
31 |
32 | return new OkObjectResult(result);
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/LbCalculator/LbCalculator/LbCalculator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 | v2
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | PreserveNewest
15 |
16 |
17 | PreserveNewest
18 | Never
19 |
20 |
21 |
--------------------------------------------------------------------------------
/LbCalculator/LbCalculator/host.json:
--------------------------------------------------------------------------------
1 | {
2 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | page_type: sample
3 | description: "Implement a simple Azure Function in the Azure Portal and build a cross-platform client with Xamarin.Forms."
4 | languages:
5 | - csharp
6 | products:
7 | - dotnet
8 | - azure
9 | - xamarin
10 | - azure-functions
11 | ---
12 |
13 | # Implementing a simple Azure Function with a Xamarin.Forms client
14 |
15 | 
16 |
17 | [Azure Functions](http://gslb.ch/a10a-xamfunc18) are a great way to implement an API in an easy manner, without any deployment or maintenance headaches. You can implement the code in the Azure Web Portal directly (or in Visual Studio if you prefer, of course). Functions are also running at a very interesting cost, since they are only billed when they are actually executed. If your business is just starting and you have only a few users, the costs will be very low. Later when the business expands, you have the possibility to switch to a different plan making it easier to budget your costs.
18 |
19 | Because they are very easy to implement and maintain, and accessible through HTTP, Azure Functions are a great way to implement an API for a mobile application. Microsoft offers great cross-platform tools for iOS, Android and Windows with [Xamarin](https://developer.xamarin.com). As such, Xamarin and Azure Functions are working great together. This article will show how to implement a very simple Azure Function in the Azure Web Portal or in Visual Studio at first, and build a cross-platform client with Xamarin.Forms, running on Android, iOS and Windows.
20 |
21 | Later we will refine this application by using the JavaScript Object Notation JSON as a communication medium between the server and the mobile clients.
22 |
23 | ## Table of content
24 |
25 | - [Implementing the first version of the Xamarin.Forms client app](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/first-client.md).
26 |
27 | - [Creating the Azure Function in the Azure Web Portal](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/creating.md).
28 |
29 | - [Modifying the function's interface and implementing it](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/implementing.md).
30 |
31 | - [Creating the Azure Function in Visual Studio](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/creating-vs.md).
32 |
33 | - [Modifying the Xamarin.Forms client app to use the Azure Function](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/second-client.md).
34 |
35 | ## Modifying the application to use JavaScript Object Notation JSON instead
36 |
37 | In this section, we will modify the function application interface to use JSON instead of normal text to pass the result to the client.
38 |
39 | - [Modifying the server application to use JSON](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/refactoring.md).
40 |
41 | - [Modifying the client application to use JSON](https://github.com/Azure-Samples/functions-xamarin-getting-started/blob/master/Doc/refactoring-client.md).
42 |
43 |
--------------------------------------------------------------------------------
/Snippets.vssettings:
--------------------------------------------------------------------------------
1 | false1000{0A057BAD-6706-45D2-A800-683A29EC6BA3}6BE0FAD70D8A105178875027649B5A8B-- FUNCTIONS ------falseGeneralGeneralGeneralGeneral2Text: private const string Url = "https://lbcalculator.azurewebsites.net/api/add/num1/{num1}/num2/{num2}";
2 |
3 | {0A057BAD-6706-45D2-A800-683A29EC6BA3}6BE0FAD70D8A105178875027649B5A8BURLtrueGeneralGeneralGeneralGeneral1 private const string Url = "https://lbcalculator.azurewebsites.net/api/add/num1/{num1}/num2/{num2}";
4 |
5 | 2{0A057BAD-6706-45D2-A800-683A29EC6BA3}BFC7653FDA86856C0744F71C1FFF3F51Http ClientfalseGeneralGeneralGeneralGeneral1
6 | private HttpClient _client;
7 |
8 | private HttpClient Client
9 | {
10 | get
11 | {
12 | if (_client == null)
13 | {
14 | _client = new HttpClient();
15 | }
16 |
17 | return _client;
18 | }
19 | }
20 | 3{0A057BAD-6706-45D2-A800-683A29EC6BA3}AFC44C1CF8382F1A7F11DAADDA5076CB-> Clicked 1falseGeneralGeneralGeneralGeneral1 int number1 = 0, number2 = 0;
21 |
22 | var success = int.TryParse(Number1.Text, out number1)
23 | && int.TryParse(Number2.Text, out number2);
24 |
25 | if (!success)
26 | {
27 | await DisplayAlert("Error in inputs", "You must enter two integers", "OK");
28 | return;
29 | }
30 | 4{0A057BAD-6706-45D2-A800-683A29EC6BA3}12F9962A6B1B228AD193F525F26DC726-> Clicked 2falseGeneralGeneralGeneralGeneral1
31 | Result.Text = "Please wait...";
32 | AddButton.IsEnabled = false;
33 | Exception error = null;
34 |
35 | try
36 | {
37 | }
38 | catch (Exception ex)
39 | {
40 | error = ex;
41 | }
42 | 5{0A057BAD-6706-45D2-A800-683A29EC6BA3}87AA3C70C9AC942243359E78EC17BF2A-> tryfalseGeneralGeneralGeneralGeneral1 var url = Url.Replace("{num1}", number1.ToString())
43 | .Replace("{num2}", number2.ToString());
44 |
45 | var json = await Client.GetStringAsync(url);
46 |
47 | var deserialized = JsonConvert.DeserializeObject<AdditionResult>(json);
48 |
49 | Result.Text = deserialized.Result.ToString();
50 | 6{0A057BAD-6706-45D2-A800-683A29EC6BA3}85C88767A65711355467815ABBDF5D36-> Clicked 3falseGeneralGeneralGeneralGeneral1
51 | if (error != null)
52 | {
53 | Result.Text = "Error!!";
54 | await DisplayAlert("There was an error", error.Message, "OK");
55 | }
56 |
57 | AddButton.IsEnabled = true;
58 | 77
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 XamCalculator.Droid
11 | {
12 | [Activity(Label = "XamCalculator", Icon = "@drawable/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 | LoadApplication(new App());
24 | }
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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("XamCalculator.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-mdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-mdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | XamCalculator.Droid
5 |
6 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.Android/XamCalculator.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {4EE25F99-9136-4CA8-8E4A-097309F58F24}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | XamCalculator.Droid
10 | XamCalculator.Android
11 | v8.1
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 |
19 |
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug
26 | DEBUG;
27 | prompt
28 | 4
29 | None
30 |
31 |
32 | true
33 | pdbonly
34 | true
35 | bin\Release
36 | prompt
37 | 4
38 | true
39 | false
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 | Designer
79 |
80 |
81 |
82 |
83 | {16E57EAC-BF4E-496E-9667-39A7DAA7D78D}
84 | XamCalculator
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | namespace XamCalculator.UWP
19 | {
20 | ///
21 | /// Provides application-specific behavior to supplement the default Application class.
22 | ///
23 | sealed partial class App : Application
24 | {
25 | ///
26 | /// Initializes the singleton application object. This is the first line of authored code
27 | /// executed, and as such is the logical equivalent of main() or WinMain().
28 | ///
29 | public App()
30 | {
31 | this.InitializeComponent();
32 | this.Suspending += OnSuspending;
33 | }
34 |
35 | ///
36 | /// Invoked when the application is launched normally by the end user. Other entry points
37 | /// will be used such as when the application is launched to open a specific file.
38 | ///
39 | /// Details about the launch request and process.
40 | protected override void OnLaunched(LaunchActivatedEventArgs e)
41 | {
42 |
43 |
44 | Frame rootFrame = Window.Current.Content as Frame;
45 |
46 | // Do not repeat app initialization when the Window already has content,
47 | // just ensure that the window is active
48 | if (rootFrame == null)
49 | {
50 | // Create a Frame to act as the navigation context and navigate to the first page
51 | rootFrame = new Frame();
52 |
53 | rootFrame.NavigationFailed += OnNavigationFailed;
54 |
55 | Xamarin.Forms.Forms.Init(e);
56 |
57 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
58 | {
59 | //TODO: Load state from previously suspended application
60 | }
61 |
62 | // Place the frame in the current Window
63 | Window.Current.Content = rootFrame;
64 | }
65 |
66 | if (rootFrame.Content == null)
67 | {
68 | // When the navigation stack isn't restored navigate to the first page,
69 | // configuring the new page by passing required information as a navigation
70 | // parameter
71 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
72 | }
73 | // Ensure the current window is active
74 | Window.Current.Activate();
75 | }
76 |
77 | ///
78 | /// Invoked when Navigation to a certain page fails
79 | ///
80 | /// The Frame which failed navigation
81 | /// Details about the navigation failure
82 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
83 | {
84 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
85 | }
86 |
87 | ///
88 | /// Invoked when application execution is being suspended. Application state is saved
89 | /// without knowing whether the application will be terminated or resumed with the contents
90 | /// of memory still intact.
91 | ///
92 | /// The source of the suspend request.
93 | /// Details about the suspend request.
94 | private void OnSuspending(object sender, SuspendingEventArgs e)
95 | {
96 | var deferral = e.SuspendingOperation.GetDeferral();
97 | //TODO: Save application state and stop any background activity
98 | deferral.Complete();
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace XamCalculator.UWP
17 | {
18 | public sealed partial class MainPage
19 | {
20 | public MainPage()
21 | {
22 | this.InitializeComponent();
23 |
24 | LoadApplication(new XamCalculator.App());
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | XamCalculator.UWP
18 | Pierce Boggan
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/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("XamCalculator.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("XamCalculator.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 XamCalculator.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 | LoadApplication(new App());
27 |
28 | return base.FinishedLaunching(app, options);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 | 10.3
25 | CFBundleDisplayName
26 | XamCalculator
27 | CFBundleIdentifier
28 | com.yourcompany.XamCalculator
29 | CFBundleVersion
30 | 1.0
31 | CFBundleIconFiles
32 |
33 | Icon-60@2x
34 | Icon-60@3x
35 | Icon-76
36 | Icon-76@2x
37 | Default
38 | Default@2x
39 | Default-568h@2x
40 | Default-Portrait
41 | Default-Portrait@2x
42 | Icon-Small-40
43 | Icon-Small-40@2x
44 | Icon-Small-40@3x
45 | Icon-Small
46 | Icon-Small@2x
47 | Icon-Small@3x
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | CFBundleName
52 | XamCalculator
53 |
54 |
55 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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("XamCalculator.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator - Start/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/XamCalculator.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {52859590-1A56-451F-A5E0-197CED3BFF40}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | Exe
11 | XamCalculator.iOS
12 | Resources
13 | XamCalculator.iOS
14 |
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\iPhoneSimulator\Debug
22 | DEBUG
23 | prompt
24 | 4
25 | false
26 | x86_64
27 | None
28 | true
29 |
30 |
31 | none
32 | true
33 | bin\iPhoneSimulator\Release
34 | prompt
35 | 4
36 | None
37 | x86_64
38 | false
39 |
40 |
41 | true
42 | full
43 | false
44 | bin\iPhone\Debug
45 | DEBUG
46 | prompt
47 | 4
48 | false
49 | ARM64
50 | iPhone Developer
51 | true
52 | Entitlements.plist
53 |
54 |
55 | none
56 | true
57 | bin\iPhone\Release
58 | prompt
59 | 4
60 | ARM64
61 | false
62 | iPhone Developer
63 | Entitlements.plist
64 |
65 |
66 | none
67 | True
68 | bin\iPhone\Ad-Hoc
69 | prompt
70 | 4
71 | False
72 | ARM64
73 | True
74 | Automatic:AdHoc
75 | iPhone Distribution
76 | Entitlements.plist
77 |
78 |
79 | none
80 | True
81 | bin\iPhone\AppStore
82 | prompt
83 | 4
84 | False
85 | ARM64
86 | Automatic:AppStore
87 | iPhone Distribution
88 | Entitlements.plist
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 |
126 |
127 | {16E57EAC-BF4E-496E-9667-39A7DAA7D78D}
128 | XamCalculator
129 |
130 |
131 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator.iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using Xamarin.Forms;
7 |
8 | namespace XamCalculator
9 | {
10 | public partial class App : Application
11 | {
12 | public App ()
13 | {
14 | InitializeComponent();
15 |
16 | MainPage = new XamCalculator.MainPage();
17 | }
18 |
19 | protected override void OnStart ()
20 | {
21 | // Handle when your app starts
22 | }
23 |
24 | protected override void OnSleep ()
25 | {
26 | // Handle when your app sleeps
27 | }
28 |
29 | protected override void OnResume ()
30 | {
31 | // Handle when your app resumes
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
13 |
14 |
17 |
18 |
20 |
21 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Xamarin.Forms;
2 |
3 | namespace XamCalculator
4 | {
5 | public partial class MainPage : ContentPage
6 | {
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 |
11 | AddButton.Clicked += async (s, e) =>
12 | {
13 | int number1 = 0, number2 = 0;
14 |
15 | var success = int.TryParse(Number1.Text, out number1)
16 | && int.TryParse(Number2.Text, out number2);
17 |
18 | if (!success)
19 | {
20 | await DisplayAlert(
21 | "Error in inputs",
22 | "You must enter two integers", "OK");
23 | return;
24 | }
25 |
26 | var result = number1 + number2;
27 | Result.Text = result + $" {result.GetType()}";
28 | };
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/XamCalculator - Start/XamCalculator/XamCalculator/XamCalculator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | *.xaml
14 |
15 |
16 | *.xaml
17 |
18 |
19 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 XamCalculator.Droid
11 | {
12 | [Activity(Label = "XamCalculator", Icon = "@drawable/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 | LoadApplication(new App());
24 | }
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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("XamCalculator.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/layout/Main.axml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-mdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-mdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.Android/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | XamCalculator.Droid
5 |
6 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.Android/XamCalculator.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {4EE25F99-9136-4CA8-8E4A-097309F58F24}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | Library
9 | XamCalculator.Droid
10 | XamCalculator.Android
11 | v8.1
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 |
19 |
20 |
21 |
22 | true
23 | full
24 | false
25 | bin\Debug
26 | DEBUG;
27 | prompt
28 | 4
29 | None
30 |
31 |
32 | true
33 | pdbonly
34 | true
35 | bin\Release
36 | prompt
37 | 4
38 | true
39 | false
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 | Designer
79 |
80 |
81 |
82 |
83 | {16E57EAC-BF4E-496E-9667-39A7DAA7D78D}
84 | XamCalculator
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.ApplicationModel;
7 | using Windows.ApplicationModel.Activation;
8 | using Windows.Foundation;
9 | using Windows.Foundation.Collections;
10 | using Windows.UI.Xaml;
11 | using Windows.UI.Xaml.Controls;
12 | using Windows.UI.Xaml.Controls.Primitives;
13 | using Windows.UI.Xaml.Data;
14 | using Windows.UI.Xaml.Input;
15 | using Windows.UI.Xaml.Media;
16 | using Windows.UI.Xaml.Navigation;
17 |
18 | namespace XamCalculator.UWP
19 | {
20 | ///
21 | /// Provides application-specific behavior to supplement the default Application class.
22 | ///
23 | sealed partial class App : Application
24 | {
25 | ///
26 | /// Initializes the singleton application object. This is the first line of authored code
27 | /// executed, and as such is the logical equivalent of main() or WinMain().
28 | ///
29 | public App()
30 | {
31 | this.InitializeComponent();
32 | this.Suspending += OnSuspending;
33 | }
34 |
35 | ///
36 | /// Invoked when the application is launched normally by the end user. Other entry points
37 | /// will be used such as when the application is launched to open a specific file.
38 | ///
39 | /// Details about the launch request and process.
40 | protected override void OnLaunched(LaunchActivatedEventArgs e)
41 | {
42 |
43 |
44 | Frame rootFrame = Window.Current.Content as Frame;
45 |
46 | // Do not repeat app initialization when the Window already has content,
47 | // just ensure that the window is active
48 | if (rootFrame == null)
49 | {
50 | // Create a Frame to act as the navigation context and navigate to the first page
51 | rootFrame = new Frame();
52 |
53 | rootFrame.NavigationFailed += OnNavigationFailed;
54 |
55 | Xamarin.Forms.Forms.Init(e);
56 |
57 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
58 | {
59 | //TODO: Load state from previously suspended application
60 | }
61 |
62 | // Place the frame in the current Window
63 | Window.Current.Content = rootFrame;
64 | }
65 |
66 | if (rootFrame.Content == null)
67 | {
68 | // When the navigation stack isn't restored navigate to the first page,
69 | // configuring the new page by passing required information as a navigation
70 | // parameter
71 | rootFrame.Navigate(typeof(MainPage), e.Arguments);
72 | }
73 | // Ensure the current window is active
74 | Window.Current.Activate();
75 | }
76 |
77 | ///
78 | /// Invoked when Navigation to a certain page fails
79 | ///
80 | /// The Frame which failed navigation
81 | /// Details about the navigation failure
82 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
83 | {
84 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
85 | }
86 |
87 | ///
88 | /// Invoked when application execution is being suspended. Application state is saved
89 | /// without knowing whether the application will be terminated or resumed with the contents
90 | /// of memory still intact.
91 | ///
92 | /// The source of the suspend request.
93 | /// Details about the suspend request.
94 | private void OnSuspending(object sender, SuspendingEventArgs e)
95 | {
96 | var deferral = e.SuspendingOperation.GetDeferral();
97 | //TODO: Save application state and stop any background activity
98 | deferral.Complete();
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/LockScreenLogo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-16_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-256_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-32_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Square44x44Logo.targetsize-48_altform-unplated.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.UWP/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Runtime.InteropServices.WindowsRuntime;
6 | using Windows.Foundation;
7 | using Windows.Foundation.Collections;
8 | using Windows.UI.Xaml;
9 | using Windows.UI.Xaml.Controls;
10 | using Windows.UI.Xaml.Controls.Primitives;
11 | using Windows.UI.Xaml.Data;
12 | using Windows.UI.Xaml.Input;
13 | using Windows.UI.Xaml.Media;
14 | using Windows.UI.Xaml.Navigation;
15 |
16 | namespace XamCalculator.UWP
17 | {
18 | public sealed partial class MainPage
19 | {
20 | public MainPage()
21 | {
22 | this.InitializeComponent();
23 |
24 | LoadApplication(new XamCalculator.App());
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 |
16 |
17 | XamCalculator.UWP
18 | Pierce Boggan
19 | Assets\StoreLogo.png
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/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("XamCalculator.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("XamCalculator.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.UWP/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 XamCalculator.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 | LoadApplication(new App());
27 |
28 | return base.FinishedLaunching(app, options);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 | 10.3
25 | CFBundleDisplayName
26 | XamCalculator
27 | CFBundleIdentifier
28 | com.yourcompany.XamCalculator
29 | CFBundleVersion
30 | 1.0
31 | CFBundleIconFiles
32 |
33 | Icon-60@2x
34 | Icon-60@3x
35 | Icon-76
36 | Icon-76@2x
37 | Default
38 | Default@2x
39 | Default-568h@2x
40 | Default-Portrait
41 | Default-Portrait@2x
42 | Icon-Small-40
43 | Icon-Small-40@2x
44 | Icon-Small-40@3x
45 | Icon-Small
46 | Icon-Small@2x
47 | Icon-Small@3x
48 |
49 | UILaunchStoryboardName
50 | LaunchScreen
51 | CFBundleName
52 | XamCalculator
53 |
54 |
55 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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("XamCalculator.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-60@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-60@3x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-76.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-76@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small-40@3x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@2x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure-Samples/functions-xamarin-getting-started/a2f9a2486fb56716184d66dc48c75f3e8afb67f0/XamCalculator/XamCalculator/XamCalculator.iOS/Resources/Icon-Small@3x.png
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.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 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/XamCalculator.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {52859590-1A56-451F-A5E0-197CED3BFF40}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | Exe
11 | XamCalculator.iOS
12 | Resources
13 | XamCalculator.iOS
14 |
15 |
16 |
17 |
18 | true
19 | full
20 | false
21 | bin\iPhoneSimulator\Debug
22 | DEBUG
23 | prompt
24 | 4
25 | false
26 | x86_64
27 | None
28 | true
29 |
30 |
31 | none
32 | true
33 | bin\iPhoneSimulator\Release
34 | prompt
35 | 4
36 | None
37 | x86_64
38 | false
39 |
40 |
41 | true
42 | full
43 | false
44 | bin\iPhone\Debug
45 | DEBUG
46 | prompt
47 | 4
48 | false
49 | ARM64
50 | iPhone Developer
51 | true
52 | Entitlements.plist
53 |
54 |
55 | none
56 | true
57 | bin\iPhone\Release
58 | prompt
59 | 4
60 | ARM64
61 | false
62 | iPhone Developer
63 | Entitlements.plist
64 |
65 |
66 | none
67 | True
68 | bin\iPhone\Ad-Hoc
69 | prompt
70 | 4
71 | False
72 | ARM64
73 | True
74 | Automatic:AdHoc
75 | iPhone Distribution
76 | Entitlements.plist
77 |
78 |
79 | none
80 | True
81 | bin\iPhone\AppStore
82 | prompt
83 | 4
84 | False
85 | ARM64
86 | Automatic:AppStore
87 | iPhone Distribution
88 | Entitlements.plist
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 |
126 |
127 | {16E57EAC-BF4E-496E-9667-39A7DAA7D78D}
128 | XamCalculator
129 |
130 |
131 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator.iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | using Xamarin.Forms;
7 |
8 | namespace XamCalculator
9 | {
10 | public partial class App : Application
11 | {
12 | public App ()
13 | {
14 | InitializeComponent();
15 |
16 | MainPage = new XamCalculator.MainPage();
17 | }
18 |
19 | protected override void OnStart ()
20 | {
21 | // Handle when your app starts
22 | }
23 |
24 | protected override void OnSleep ()
25 | {
26 | // Handle when your app sleeps
27 | }
28 |
29 | protected override void OnResume ()
30 | {
31 | // Handle when your app resumes
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
13 |
14 |
17 |
18 |
20 |
21 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Calculator.Data;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Net.Http;
5 | using Xamarin.Forms;
6 |
7 | namespace XamCalculator
8 | {
9 | public partial class MainPage : ContentPage
10 | {
11 | private const string Url = "https://lbcalculator.azurewebsites.net/api/add/num1/{num1}/num2/{num2}";
12 |
13 | private HttpClient _client;
14 |
15 | private HttpClient Client
16 | {
17 | get
18 | {
19 | if (_client == null)
20 | {
21 | _client = new HttpClient();
22 | }
23 |
24 | return _client;
25 | }
26 | }
27 |
28 | public MainPage()
29 | {
30 | InitializeComponent();
31 |
32 | AddButton.Clicked += async (s, e) =>
33 | {
34 | int number1 = 0, number2 = 0;
35 |
36 | var success = int.TryParse(Number1.Text, out number1)
37 | && int.TryParse(Number2.Text, out number2);
38 |
39 | if (!success)
40 | {
41 | await DisplayAlert("Error in inputs", "You must enter two integers", "OK");
42 | return;
43 | }
44 |
45 | Result.Text = "Please wait...";
46 | AddButton.IsEnabled = false;
47 | Exception error = null;
48 |
49 | try
50 | {
51 | var url = Url.Replace("{num1}", number1.ToString())
52 | .Replace("{num2}", number2.ToString());
53 |
54 | var json = await Client.GetStringAsync(url);
55 |
56 | var deserialized = JsonConvert.DeserializeObject(json);
57 |
58 | Result.Text = deserialized.Result + $" {deserialized.Result.GetType()}";
59 | }
60 | catch (Exception ex)
61 | {
62 | error = ex;
63 | }
64 |
65 | if (error != null)
66 | {
67 | Result.Text = "Error!!";
68 | await DisplayAlert("There was an error", error.Message, "OK");
69 | }
70 |
71 | AddButton.IsEnabled = true;
72 | };
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/XamCalculator/XamCalculator/XamCalculator/XamCalculator.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | *.xaml
19 |
20 |
21 | *.xaml
22 |
23 |
24 |
--------------------------------------------------------------------------------