├── .gitignore
├── Art
├── 01-OpenVS.png
├── 02-SelectNetMauiTemplate.png
├── 03-ConfigureProject.png
├── 04-SelectNetFrameworkVersion.png
├── 05-SolutionStructure.png
├── 06-AddNewFolder.png
├── 07-AddNewItem.png
├── 08-AddNewContentPage.png
├── 09-ViewsFolderContent.png
├── 10-AddExistingItem.png
├── 11-AddImage.png
├── 12-NewResource.png
├── 13-InitialContent.png
├── 14-RecipeListViewXAMLCode.png
├── 15-InitialContent.png
├── 16-RecipeListViewCSharpCode.png
├── 17-SelectFramework.png
├── 18-AppRunning.png
├── 19-AppRunningWindows.png
├── 20-StyleColors.png
├── 21-AppRunningInLightMode.png
├── 22-EnablingDarkMode.png
├── 23-AppRunningInDarkMode.png
├── 24-RoundImageCorners.png
├── 25-DownloadMDIFont.png
├── 26-MDIFontFile.png
├── 27-IconFontToCSharpCode.png
├── 28-MDIHelperClassCode.png
├── 29-IconFontClassCode.png
├── 30-AddFontFile.png
├── 31-IconButton.png
├── 32-ImprovingUI.png
├── 33-RenameView.png
├── 34-RenameXaml.png
├── 35-RenameClass.png
├── 36-RenameAppShell.png
├── 37-ManageNuGetPackage.png
├── 38-InstallCommunityToolkitMVVM.png
├── 39-AddModels.png
├── 40-AddServices.png
├── 41-AddViewModels.png
├── 42-AddViews.png
├── 43-RecipeCollection.png
├── 44-RecipeDetail.png
├── 45-ImprovedRecipeCollection.png
├── 46-ManageNuGetPackage.png
├── 47-AddSQLiteNetPCLNuGetPackage.png
├── 48-AddSQLitePCLRawBundleGreenNuGetPackage.png
├── 49-AddSQLitePCLRawBundleProviderCdeclNuGetPackage.png
├── 50-AddConstantsClass.png
├── 51-AddBasicTableClass.png
├── 52-AddLocalDbServiceSupport.png
├── 53-NewFunctionality.png
├── 54-NewData.png
├── 55-GetDataFromLocalDB.png
├── 56-SettingsSupport.png
├── 57-HamburgerMenu.png
├── 58-ExpandedHamburgerMenu.png
├── 59-SettingsView.png
├── 60-SettingsSaved.png
├── 61-LocalRecipes.png
├── 62-NewSettings.png
└── 63-InternetRecipes.png
├── Finish
├── README.md
├── RefreshingRecipes.sln
└── RefreshingRecipes
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── Helpers
│ ├── Constants.cs
│ └── IconFont.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MauiProgram.cs
│ ├── Models
│ ├── BasicTable.cs
│ └── Recipe.cs
│ ├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── RefreshingRecipes.csproj
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ ├── OpenSans-Semibold.ttf
│ │ └── materialdesignicons-webfont.ttf
│ ├── Images
│ │ ├── dotnet_bot.svg
│ │ └── smoothie.png
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ ├── Services
│ ├── ILocalDbService.cs
│ ├── IRecipeService.cs
│ ├── LocalDbService.cs
│ └── RecipeService.cs
│ ├── ViewModels
│ ├── BaseViewModel.cs
│ ├── RecipeCollectionViewModel.cs
│ ├── RecipeDetailViewModel.cs
│ └── SettingsViewModel.cs
│ └── Views
│ ├── RecipeCollectionView.xaml
│ ├── RecipeCollectionView.xaml.cs
│ ├── RecipeDetailView.xaml
│ ├── RecipeDetailView.xaml.cs
│ ├── SettingsView.xaml
│ └── SettingsView.xaml.cs
├── Part1-GettingStarted
├── README-es.md
└── README.md
├── Part2-UIDesign
├── README-es.md
├── README.md
├── RefreshingRecipes.sln
└── RefreshingRecipes
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MauiProgram.cs
│ ├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── RefreshingRecipes.csproj
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ └── OpenSans-Semibold.ttf
│ ├── Images
│ │ ├── dotnet_bot.svg
│ │ └── smoothie.png
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ └── Views
│ ├── RecipeListView.xaml
│ └── RecipeListView.xaml.cs
├── Part3-MVVM
├── README-es.md
├── README.md
├── RefreshingRecipes.sln
└── RefreshingRecipes
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── Helpers
│ └── IconFont.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MauiProgram.cs
│ ├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── RefreshingRecipes.csproj
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ ├── OpenSans-Semibold.ttf
│ │ └── materialdesignicons-webfont.ttf
│ ├── Images
│ │ ├── dotnet_bot.svg
│ │ └── smoothie.png
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ └── Views
│ ├── RecipeListView.xaml
│ └── RecipeListView.xaml.cs
├── Part4-LocalStorage
├── README-es.md
├── README.md
├── RefreshingRecipes.sln
└── RefreshingRecipes
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AppShell.xaml
│ ├── AppShell.xaml.cs
│ ├── Helpers
│ └── IconFont.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MauiProgram.cs
│ ├── Models
│ └── Recipe.cs
│ ├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Properties
│ └── launchSettings.json
│ ├── RefreshingRecipes.csproj
│ ├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ ├── OpenSans-Semibold.ttf
│ │ └── materialdesignicons-webfont.ttf
│ ├── Images
│ │ ├── dotnet_bot.svg
│ │ └── smoothie.png
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
│ ├── Services
│ ├── IRecipeService.cs
│ └── RecipeService.cs
│ ├── ViewModels
│ ├── BaseViewModel.cs
│ ├── RecipeCollectionViewModel.cs
│ └── RecipeDetailViewModel.cs
│ └── Views
│ ├── RecipeCollectionView.xaml
│ ├── RecipeCollectionView.xaml.cs
│ ├── RecipeDetailView.xaml
│ └── RecipeDetailView.xaml.cs
├── README.md
├── Resources
└── smoothie.png
└── Translations
├── README.md
└── es
└── README.md
/.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 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 | .idea/
13 |
14 | # User-specific files (MonoDevelop/Xamarin Studio)
15 | *.userprefs
16 |
17 | # Mono auto generated files
18 | mono_crash.*
19 |
20 | # Build results
21 | [Dd]ebug/
22 | [Dd]ebugPublic/
23 | [Rr]elease/
24 | [Rr]eleases/
25 | x64/
26 | x86/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # StyleCop
66 | StyleCopReport.xml
67 |
68 | # Files built by Visual Studio
69 | *_i.c
70 | *_p.c
71 | *_h.h
72 | *.ilk
73 | *.meta
74 | *.obj
75 | *.iobj
76 | *.pch
77 | *.pdb
78 | *.ipdb
79 | *.pgc
80 | *.pgd
81 | *.rsp
82 | *.sbr
83 | *.tlb
84 | *.tli
85 | *.tlh
86 | *.tmp
87 | *.tmp_proj
88 | *_wpftmp.csproj
89 | *.log
90 | *.vspscc
91 | *.vssscc
92 | .builds
93 | *.pidb
94 | *.svclog
95 | *.scc
96 |
97 | # Chutzpah Test files
98 | _Chutzpah*
99 |
100 | # Visual C++ cache files
101 | ipch/
102 | *.aps
103 | *.ncb
104 | *.opendb
105 | *.opensdf
106 | *.sdf
107 | *.cachefile
108 | *.VC.db
109 | *.VC.VC.opendb
110 |
111 | # Visual Studio profiler
112 | *.psess
113 | *.vsp
114 | *.vspx
115 | *.sap
116 |
117 | # Visual Studio Trace Files
118 | *.e2e
119 |
120 | # TFS 2012 Local Workspace
121 | $tf/
122 |
123 | # Guidance Automation Toolkit
124 | *.gpState
125 |
126 | # ReSharper is a .NET coding add-in
127 | _ReSharper*/
128 | *.[Rr]e[Ss]harper
129 | *.DotSettings.user
130 |
131 | # TeamCity is a build add-in
132 | _TeamCity*
133 |
134 | # DotCover is a Code Coverage Tool
135 | *.dotCover
136 |
137 | # AxoCover is a Code Coverage Tool
138 | .axoCover/*
139 | !.axoCover/settings.json
140 |
141 | # Visual Studio code coverage results
142 | *.coverage
143 | *.coveragexml
144 |
145 | # NCrunch
146 | _NCrunch_*
147 | .*crunch*.local.xml
148 | nCrunchTemp_*
149 |
150 | # MightyMoose
151 | *.mm.*
152 | AutoTest.Net/
153 |
154 | # Web workbench (sass)
155 | .sass-cache/
156 |
157 | # Installshield output folder
158 | [Ee]xpress/
159 |
160 | # DocProject is a documentation generator add-in
161 | DocProject/buildhelp/
162 | DocProject/Help/*.HxT
163 | DocProject/Help/*.HxC
164 | DocProject/Help/*.hhc
165 | DocProject/Help/*.hhk
166 | DocProject/Help/*.hhp
167 | DocProject/Help/Html2
168 | DocProject/Help/html
169 |
170 | # Click-Once directory
171 | publish/
172 |
173 | # Publish Web Output
174 | *.[Pp]ublish.xml
175 | *.azurePubxml
176 | # Note: Comment the next line if you want to checkin your web deploy settings,
177 | # but database connection strings (with potential passwords) will be unencrypted
178 | *.pubxml
179 | *.publishproj
180 |
181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
182 | # checkin your Azure Web App publish settings, but sensitive information contained
183 | # in these scripts will be unencrypted
184 | PublishScripts/
185 |
186 | # NuGet Packages
187 | *.nupkg
188 | # NuGet Symbol Packages
189 | *.snupkg
190 | # The packages folder can be ignored because of Package Restore
191 | **/[Pp]ackages/*
192 | # except build/, which is used as an MSBuild target.
193 | !**/[Pp]ackages/build/
194 | # Uncomment if necessary however generally it will be regenerated when needed
195 | #!**/[Pp]ackages/repositories.config
196 | # NuGet v3's project.json files produces more ignorable files
197 | *.nuget.props
198 | *.nuget.targets
199 |
200 | # Microsoft Azure Build Output
201 | csx/
202 | *.build.csdef
203 |
204 | # Microsoft Azure Emulator
205 | ecf/
206 | rcf/
207 |
208 | # Windows Store app package directories and files
209 | AppPackages/
210 | BundleArtifacts/
211 | Package.StoreAssociation.xml
212 | _pkginfo.txt
213 | *.appx
214 | *.appxbundle
215 | *.appxupload
216 |
217 | # Visual Studio cache files
218 | # files ending in .cache can be ignored
219 | *.[Cc]ache
220 | # but keep track of directories ending in .cache
221 | !?*.[Cc]ache/
222 |
223 | # Others
224 | ClientBin/
225 | ~$*
226 | *~
227 | *.dbmdl
228 | *.dbproj.schemaview
229 | *.jfm
230 | *.pfx
231 | *.publishsettings
232 | orleans.codegen.cs
233 |
234 | # Including strong name files can present a security risk
235 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
236 | #*.snk
237 |
238 | # Since there are multiple workflows, uncomment next line to ignore bower_components
239 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
240 | #bower_components/
241 |
242 | # RIA/Silverlight projects
243 | Generated_Code/
244 |
245 | # Backup & report files from converting an old project file
246 | # to a newer Visual Studio version. Backup files are not needed,
247 | # because we have git ;-)
248 | _UpgradeReport_Files/
249 | Backup*/
250 | UpgradeLog*.XML
251 | UpgradeLog*.htm
252 | ServiceFabricBackup/
253 | *.rptproj.bak
254 |
255 | # SQL Server files
256 | *.mdf
257 | *.ldf
258 | *.ndf
259 |
260 | # Business Intelligence projects
261 | *.rdl.data
262 | *.bim.layout
263 | *.bim_*.settings
264 | *.rptproj.rsuser
265 | *- [Bb]ackup.rdl
266 | *- [Bb]ackup ([0-9]).rdl
267 | *- [Bb]ackup ([0-9][0-9]).rdl
268 |
269 | # Microsoft Fakes
270 | FakesAssemblies/
271 |
272 | # GhostDoc plugin setting file
273 | *.GhostDoc.xml
274 |
275 | # Node.js Tools for Visual Studio
276 | .ntvs_analysis.dat
277 | node_modules/
278 |
279 | # Visual Studio 6 build log
280 | *.plg
281 |
282 | # Visual Studio 6 workspace options file
283 | *.opt
284 |
285 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
286 | *.vbw
287 |
288 | # Visual Studio LightSwitch build output
289 | **/*.HTMLClient/GeneratedArtifacts
290 | **/*.DesktopClient/GeneratedArtifacts
291 | **/*.DesktopClient/ModelManifest.xml
292 | **/*.Server/GeneratedArtifacts
293 | **/*.Server/ModelManifest.xml
294 | _Pvt_Extensions
295 |
296 | # Paket dependency manager
297 | .paket/paket.exe
298 | paket-files/
299 |
300 | # FAKE - F# Make
301 | .fake/
302 |
303 | # CodeRush personal settings
304 | .cr/personal
305 |
306 | # Python Tools for Visual Studio (PTVS)
307 | __pycache__/
308 | *.pyc
309 |
310 | # Cake - Uncomment if you are using it
311 | # tools/**
312 | # !tools/packages.config
313 |
314 | # Tabs Studio
315 | *.tss
316 |
317 | # Telerik's JustMock configuration file
318 | *.jmconfig
319 |
320 | # BizTalk build output
321 | *.btp.cs
322 | *.btm.cs
323 | *.odx.cs
324 | *.xsd.cs
325 |
326 | # OpenCover UI analysis results
327 | OpenCover/
328 |
329 | # Azure Stream Analytics local run output
330 | ASALocalRun/
331 |
332 | # MSBuild Binary and Structured Log
333 | *.binlog
334 |
335 | # NVidia Nsight GPU debugger configuration file
336 | *.nvuser
337 |
338 | # MFractors (Xamarin productivity tool) working folder
339 | .mfractor/
340 |
341 | # Local History for Visual Studio
342 | .localhistory/
343 |
344 | # BeatPulse healthcheck temp database
345 | healthchecksdb
346 |
347 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
348 | MigrationBackup/
349 |
350 | # Ionide (cross platform F# VS Code tools) working folder
351 | .ionide/
--------------------------------------------------------------------------------
/Art/01-OpenVS.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/01-OpenVS.png
--------------------------------------------------------------------------------
/Art/02-SelectNetMauiTemplate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/02-SelectNetMauiTemplate.png
--------------------------------------------------------------------------------
/Art/03-ConfigureProject.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/03-ConfigureProject.png
--------------------------------------------------------------------------------
/Art/04-SelectNetFrameworkVersion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/04-SelectNetFrameworkVersion.png
--------------------------------------------------------------------------------
/Art/05-SolutionStructure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/05-SolutionStructure.png
--------------------------------------------------------------------------------
/Art/06-AddNewFolder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/06-AddNewFolder.png
--------------------------------------------------------------------------------
/Art/07-AddNewItem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/07-AddNewItem.png
--------------------------------------------------------------------------------
/Art/08-AddNewContentPage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/08-AddNewContentPage.png
--------------------------------------------------------------------------------
/Art/09-ViewsFolderContent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/09-ViewsFolderContent.png
--------------------------------------------------------------------------------
/Art/10-AddExistingItem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/10-AddExistingItem.png
--------------------------------------------------------------------------------
/Art/11-AddImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/11-AddImage.png
--------------------------------------------------------------------------------
/Art/12-NewResource.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/12-NewResource.png
--------------------------------------------------------------------------------
/Art/13-InitialContent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/13-InitialContent.png
--------------------------------------------------------------------------------
/Art/14-RecipeListViewXAMLCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/14-RecipeListViewXAMLCode.png
--------------------------------------------------------------------------------
/Art/15-InitialContent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/15-InitialContent.png
--------------------------------------------------------------------------------
/Art/16-RecipeListViewCSharpCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/16-RecipeListViewCSharpCode.png
--------------------------------------------------------------------------------
/Art/17-SelectFramework.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/17-SelectFramework.png
--------------------------------------------------------------------------------
/Art/18-AppRunning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/18-AppRunning.png
--------------------------------------------------------------------------------
/Art/19-AppRunningWindows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/19-AppRunningWindows.png
--------------------------------------------------------------------------------
/Art/20-StyleColors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/20-StyleColors.png
--------------------------------------------------------------------------------
/Art/21-AppRunningInLightMode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/21-AppRunningInLightMode.png
--------------------------------------------------------------------------------
/Art/22-EnablingDarkMode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/22-EnablingDarkMode.png
--------------------------------------------------------------------------------
/Art/23-AppRunningInDarkMode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/23-AppRunningInDarkMode.png
--------------------------------------------------------------------------------
/Art/24-RoundImageCorners.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/24-RoundImageCorners.png
--------------------------------------------------------------------------------
/Art/25-DownloadMDIFont.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/25-DownloadMDIFont.png
--------------------------------------------------------------------------------
/Art/26-MDIFontFile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/26-MDIFontFile.png
--------------------------------------------------------------------------------
/Art/27-IconFontToCSharpCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/27-IconFontToCSharpCode.png
--------------------------------------------------------------------------------
/Art/28-MDIHelperClassCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/28-MDIHelperClassCode.png
--------------------------------------------------------------------------------
/Art/29-IconFontClassCode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/29-IconFontClassCode.png
--------------------------------------------------------------------------------
/Art/30-AddFontFile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/30-AddFontFile.png
--------------------------------------------------------------------------------
/Art/31-IconButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/31-IconButton.png
--------------------------------------------------------------------------------
/Art/32-ImprovingUI.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/32-ImprovingUI.png
--------------------------------------------------------------------------------
/Art/33-RenameView.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/33-RenameView.png
--------------------------------------------------------------------------------
/Art/34-RenameXaml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/34-RenameXaml.png
--------------------------------------------------------------------------------
/Art/35-RenameClass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/35-RenameClass.png
--------------------------------------------------------------------------------
/Art/36-RenameAppShell.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/36-RenameAppShell.png
--------------------------------------------------------------------------------
/Art/37-ManageNuGetPackage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/37-ManageNuGetPackage.png
--------------------------------------------------------------------------------
/Art/38-InstallCommunityToolkitMVVM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/38-InstallCommunityToolkitMVVM.png
--------------------------------------------------------------------------------
/Art/39-AddModels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/39-AddModels.png
--------------------------------------------------------------------------------
/Art/40-AddServices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/40-AddServices.png
--------------------------------------------------------------------------------
/Art/41-AddViewModels.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/41-AddViewModels.png
--------------------------------------------------------------------------------
/Art/42-AddViews.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/42-AddViews.png
--------------------------------------------------------------------------------
/Art/43-RecipeCollection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/43-RecipeCollection.png
--------------------------------------------------------------------------------
/Art/44-RecipeDetail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/44-RecipeDetail.png
--------------------------------------------------------------------------------
/Art/45-ImprovedRecipeCollection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/45-ImprovedRecipeCollection.png
--------------------------------------------------------------------------------
/Art/46-ManageNuGetPackage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/46-ManageNuGetPackage.png
--------------------------------------------------------------------------------
/Art/47-AddSQLiteNetPCLNuGetPackage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/47-AddSQLiteNetPCLNuGetPackage.png
--------------------------------------------------------------------------------
/Art/48-AddSQLitePCLRawBundleGreenNuGetPackage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/48-AddSQLitePCLRawBundleGreenNuGetPackage.png
--------------------------------------------------------------------------------
/Art/49-AddSQLitePCLRawBundleProviderCdeclNuGetPackage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/49-AddSQLitePCLRawBundleProviderCdeclNuGetPackage.png
--------------------------------------------------------------------------------
/Art/50-AddConstantsClass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/50-AddConstantsClass.png
--------------------------------------------------------------------------------
/Art/51-AddBasicTableClass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/51-AddBasicTableClass.png
--------------------------------------------------------------------------------
/Art/52-AddLocalDbServiceSupport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/52-AddLocalDbServiceSupport.png
--------------------------------------------------------------------------------
/Art/53-NewFunctionality.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/53-NewFunctionality.png
--------------------------------------------------------------------------------
/Art/54-NewData.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/54-NewData.png
--------------------------------------------------------------------------------
/Art/55-GetDataFromLocalDB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/55-GetDataFromLocalDB.png
--------------------------------------------------------------------------------
/Art/56-SettingsSupport.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/56-SettingsSupport.png
--------------------------------------------------------------------------------
/Art/57-HamburgerMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/57-HamburgerMenu.png
--------------------------------------------------------------------------------
/Art/58-ExpandedHamburgerMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/58-ExpandedHamburgerMenu.png
--------------------------------------------------------------------------------
/Art/59-SettingsView.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/59-SettingsView.png
--------------------------------------------------------------------------------
/Art/60-SettingsSaved.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/60-SettingsSaved.png
--------------------------------------------------------------------------------
/Art/61-LocalRecipes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/61-LocalRecipes.png
--------------------------------------------------------------------------------
/Art/62-NewSettings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/62-NewSettings.png
--------------------------------------------------------------------------------
/Art/63-InternetRecipes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Art/63-InternetRecipes.png
--------------------------------------------------------------------------------
/Finish/README.md:
--------------------------------------------------------------------------------
1 | This is the final code version after completing the 4-step tutorial.
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31611.283
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RefreshingRecipes", "RefreshingRecipes\RefreshingRecipes.csproj", "{435D3059-1CA1-4836-891C-5AC7943D652D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Deploy.0 = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
19 |
20 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.Views;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | public partial class AppShell : Shell
6 | {
7 | public AppShell()
8 | {
9 | InitializeComponent();
10 |
11 | Routing.RegisterRoute(nameof(RecipeDetailView), typeof(RecipeDetailView));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Helpers/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes.Helpers
2 | {
3 | public static class Constants
4 | {
5 | public const string DatabaseFilename = "RecipesDb-v1_0.db3";
6 | public static string DatabasePath =>
7 | Path.Combine(FileSystem.AppDataDirectory, DatabaseFilename);
8 |
9 | public const string OnlineModeKey = "online_mode";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class MainPage : ContentPage
4 | {
5 | int count = 0;
6 |
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private void OnCounterClicked(object sender, EventArgs e)
13 | {
14 | count++;
15 |
16 | if (count == 1)
17 | CounterBtn.Text = $"Clicked {count} time";
18 | else
19 | CounterBtn.Text = $"Clicked {count} times";
20 |
21 | SemanticScreenReader.Announce(CounterBtn.Text);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using RefreshingRecipes.Services;
3 | using RefreshingRecipes.ViewModels;
4 | using RefreshingRecipes.Views;
5 |
6 | namespace RefreshingRecipes;
7 |
8 | public static class MauiProgram
9 | {
10 | public static MauiApp CreateMauiApp()
11 | {
12 | var builder = MauiApp.CreateBuilder();
13 | builder
14 | .UseMauiApp()
15 | .ConfigureFonts(fonts =>
16 | {
17 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
18 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
19 | fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
20 | });
21 |
22 | builder.Services.AddSingleton();
23 | builder.Services.AddSingleton();
24 |
25 | builder.Services.AddSingleton();
26 | builder.Services.AddTransient();
27 |
28 | builder.Services.AddTransient();
29 | builder.Services.AddTransient();
30 |
31 | builder.Services.AddTransient();
32 | builder.Services.AddTransient();
33 | #if DEBUG
34 | builder.Logging.AddDebug();
35 | #endif
36 |
37 | return builder.Build();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Models/BasicTable.cs:
--------------------------------------------------------------------------------
1 | using SQLite;
2 |
3 | namespace RefreshingRecipes.Models
4 | {
5 | public class BasicTable
6 | {
7 | [PrimaryKey, AutoIncrement]
8 | public int Id { get; set; }
9 |
10 | public BasicTable()
11 | {
12 |
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Models/Recipe.cs:
--------------------------------------------------------------------------------
1 | using SQLite;
2 |
3 | namespace RefreshingRecipes.Models
4 | {
5 | [Table("Recipes")]
6 | public class Recipe : BasicTable
7 | {
8 | public int RecipeId { get; set; }
9 |
10 | [MaxLength(255)]
11 | public string RecipeName { get; set; }
12 | public string RecipePhotoUrl { get; set; }
13 | public string RecipeInstructions { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UIRequiredDeviceCapabilities
11 |
12 | arm64
13 |
14 | UISupportedInterfaceOrientations
15 |
16 | UIInterfaceOrientationPortrait
17 | UIInterfaceOrientationLandscapeLeft
18 | UIInterfaceOrientationLandscapeRight
19 |
20 | UISupportedInterfaceOrientations~ipad
21 |
22 | UIInterfaceOrientationPortrait
23 | UIInterfaceOrientationPortraitUpsideDown
24 | UIInterfaceOrientationLandscapeLeft
25 | UIInterfaceOrientationLandscapeRight
26 |
27 | XSAppIconAssets
28 | Assets.xcassets/appicon.appiconset
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace RefreshingRecipes.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | $placeholder$
15 | User Name
16 | $placeholder$.png
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/RefreshingRecipes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android;net7.0-ios;net7.0-maccatalyst
5 | $(TargetFrameworks);net7.0-windows10.0.19041.0
6 |
7 |
8 | Exe
9 | RefreshingRecipes
10 | true
11 | true
12 | enable
13 |
14 |
15 | RefreshingRecipes
16 |
17 |
18 | com.companyname.refreshingrecipes
19 | a5c676cf-69f8-43fd-b842-fde4ca544807
20 |
21 |
22 | 1.0
23 | 1
24 |
25 | 11.0
26 | 13.1
27 | 21.0
28 | 10.0.17763.0
29 | 10.0.17763.0
30 | 6.5
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | RecipeDetailView.xaml
67 |
68 |
69 |
70 |
71 |
72 | MSBuild:Compile
73 |
74 |
75 | MSBuild:Compile
76 |
77 |
78 | MSBuild:Compile
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Finish/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Finish/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Finish/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Images/smoothie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Finish/RefreshingRecipes/Resources/Images/smoothie.png
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #512BD4
8 | #DFD8F7
9 | #2B0B98
10 | White
11 | Black
12 | #E1E1E1
13 | #C8C8C8
14 | #ACACAC
15 | #919191
16 | #6E6E6E
17 | #404040
18 | #212121
19 | #141414
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | #F7B548
35 | #FFD590
36 | #FFE5B9
37 | #28C2D1
38 | #7BDDEF
39 | #C3F2F4
40 | #3E8EED
41 | #72ACF1
42 | #A7CBF6
43 | #3b65ff
44 | #4b05ad
45 | #2b0b98
46 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Services/ILocalDbService.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.Models;
2 |
3 | namespace RefreshingRecipes.Services
4 | {
5 | public interface ILocalDbService
6 | {
7 | Task> GetItems() where T : BasicTable, new();
8 | Task CountItems() where T : BasicTable, new();
9 | Task AddItems(List items) where T : BasicTable, new();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Services/IRecipeService.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.Models;
2 |
3 | namespace RefreshingRecipes.Services
4 | {
5 | public interface IRecipeService
6 | {
7 | Task> GetRecipes();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Services/LocalDbService.cs:
--------------------------------------------------------------------------------
1 | using SQLite;
2 |
3 | using RefreshingRecipes.Models;
4 | using RefreshingRecipes.Helpers;
5 |
6 | namespace RefreshingRecipes.Services
7 | {
8 | public class LocalDbService : ILocalDbService
9 | {
10 | private string dbPath;
11 | private SQLiteAsyncConnection connection;
12 |
13 | public LocalDbService()
14 | {
15 | dbPath = Constants.DatabasePath;
16 | }
17 |
18 | private async Task Init()
19 | {
20 | if (connection != null)
21 | return;
22 |
23 | try
24 | {
25 | connection = new SQLiteAsyncConnection(dbPath);
26 |
27 | connection.Tracer = new Action(q =>
28 | System.Diagnostics.Debug.WriteLine(q));
29 | connection.Trace = true;
30 |
31 | await connection.CreateTableAsync();
32 | }
33 | catch (Exception ex)
34 | {
35 | }
36 | }
37 |
38 | public async Task> GetItems() where T : BasicTable, new()
39 | {
40 | await Init();
41 | return await connection.Table().ToListAsync();
42 | }
43 |
44 | public async Task CountItems() where T : BasicTable, new()
45 | {
46 | await Init();
47 | return await connection.Table().CountAsync();
48 | }
49 |
50 | public async Task AddItems(List items) where T : BasicTable, new()
51 | {
52 | await Init();
53 |
54 | var op = await connection.InsertAllAsync(items);
55 | return op == items.Count;
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Services/RecipeService.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http.Json;
2 |
3 | using RefreshingRecipes.Models;
4 |
5 | namespace RefreshingRecipes.Services
6 | {
7 | public class RecipeService : IRecipeService
8 | {
9 | HttpClient httpClient;
10 |
11 | public RecipeService()
12 | {
13 | this.httpClient = new HttpClient();
14 | }
15 |
16 | public async Task> GetRecipes()
17 | {
18 | var response = await httpClient.GetAsync("https://gist.githubusercontent.com/icebeam7/a6c1c7523e67272e294204aff0b115cc/raw/938694ed82fa34384c9704f6000fa0307ca72c06/recipes.json");
19 |
20 | if (response.IsSuccessStatusCode)
21 | return await response.Content.ReadFromJsonAsync>();
22 |
23 | return default;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/ViewModels/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace RefreshingRecipes.ViewModels
4 | {
5 | public partial class BaseViewModel : ObservableObject
6 | {
7 | [ObservableProperty]
8 | [NotifyPropertyChangedFor(nameof(IsNotBusy))]
9 | bool isBusy;
10 |
11 | [ObservableProperty]
12 | string title;
13 |
14 | public bool IsNotBusy => !IsBusy;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/ViewModels/RecipeCollectionViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | using RefreshingRecipes.Views;
4 | using RefreshingRecipes.Models;
5 | using RefreshingRecipes.Services;
6 | using RefreshingRecipes.Helpers;
7 |
8 | using CommunityToolkit.Mvvm.Input;
9 | using CommunityToolkit.Mvvm.ComponentModel;
10 |
11 | namespace RefreshingRecipes.ViewModels
12 | {
13 | public partial class RecipeCollectionViewModel : BaseViewModel
14 | {
15 | public ObservableCollection Recipes { get; } = new();
16 |
17 | IRecipeService recipeService;
18 | ILocalDbService localDbService;
19 | bool onlineMode;
20 |
21 | [ObservableProperty]
22 | Recipe selectedRecipe;
23 |
24 | public RecipeCollectionViewModel(IRecipeService recipeService, ILocalDbService localDbService)
25 | {
26 | Title = "Recipe List";
27 | this.recipeService = recipeService;
28 | this.localDbService = localDbService;
29 | onlineMode = Preferences.Get(Constants.OnlineModeKey, true);
30 | }
31 |
32 | [RelayCommand]
33 | async Task GetRecipesAsync()
34 | {
35 | if (IsBusy)
36 | return;
37 |
38 | try
39 | {
40 | IsBusy = true;
41 |
42 | var recipes = onlineMode
43 | ? (await recipeService.GetRecipes()).ToList()
44 | : await localDbService.GetItems();
45 |
46 | //var recipes = (await recipeService.GetRecipes()).ToList();
47 | //var recipes = await localDbService.GetItems();
48 |
49 | if (Recipes.Count != 0)
50 | Recipes.Clear();
51 |
52 | foreach (var recipe in recipes)
53 | Recipes.Add(recipe);
54 | }
55 | catch (Exception ex)
56 | {
57 | await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
58 | }
59 | finally
60 | {
61 | IsBusy = false;
62 | }
63 | }
64 |
65 | [RelayCommand]
66 | async Task GoToDetails()
67 | {
68 | if (SelectedRecipe == null)
69 | return;
70 |
71 | var data = new Dictionary
72 | {
73 | {"Recipe", SelectedRecipe }
74 | };
75 |
76 | await Shell.Current.GoToAsync(nameof(RecipeDetailView), true, data);
77 | }
78 |
79 | [RelayCommand]
80 | async Task AddLocalRecipesAsync()
81 | {
82 | if (IsBusy)
83 | return;
84 |
85 | try
86 | {
87 | IsBusy = true;
88 |
89 | if (await localDbService.CountItems() == 0)
90 | {
91 | var recipes = (await recipeService.GetRecipes()).ToList();
92 |
93 | var result = await localDbService.AddItems(recipes);
94 |
95 | await Shell.Current.DisplayAlert(
96 | "Result",
97 | result ? "The local database now contains new information!" : "There was an error",
98 | "OK");
99 | }
100 | else
101 | await Shell.Current.DisplayAlert("Error!", "The local database already contains information", "OK");
102 | }
103 | catch (Exception ex)
104 | {
105 | await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
106 | }
107 | finally
108 | {
109 | IsBusy = false;
110 | }
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/ViewModels/RecipeDetailViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using RefreshingRecipes.Models;
3 |
4 | namespace RefreshingRecipes.ViewModels
5 | {
6 | [QueryProperty(nameof(Recipe), "Recipe")]
7 | public partial class RecipeDetailViewModel : BaseViewModel
8 | {
9 | public RecipeDetailViewModel()
10 | {
11 |
12 | }
13 |
14 | [ObservableProperty]
15 | Recipe recipe;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/ViewModels/SettingsViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using CommunityToolkit.Mvvm.Input;
3 | using RefreshingRecipes.Helpers;
4 |
5 | namespace RefreshingRecipes.ViewModels
6 | {
7 | public partial class SettingsViewModel : BaseViewModel
8 | {
9 | [ObservableProperty]
10 | bool onlineMode;
11 |
12 | public SettingsViewModel()
13 | {
14 | Title = "Settings";
15 | onlineMode = Preferences.Get(Constants.OnlineModeKey, true);
16 | }
17 |
18 | [RelayCommand]
19 | private async Task SaveSettingsAsync()
20 | {
21 | Preferences.Set(Constants.OnlineModeKey, OnlineMode);
22 |
23 | await Shell.Current.DisplayAlert("Success!", "Settings saved!", "OK");
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/RecipeCollectionView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
76 |
77 |
88 |
89 |
95 |
96 |
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/RecipeCollectionView.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.ViewModels;
2 |
3 | namespace RefreshingRecipes.Views;
4 |
5 | public partial class RecipeCollectionView : ContentPage
6 | {
7 | public RecipeCollectionView(RecipeCollectionViewModel vm)
8 | {
9 | InitializeComponent();
10 |
11 | BindingContext = vm;
12 | }
13 | }
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/RecipeDetailView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
19 |
22 |
23 |
24 |
28 |
34 |
39 |
40 |
41 |
42 |
43 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/RecipeDetailView.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.ViewModels;
2 |
3 | namespace RefreshingRecipes.Views;
4 |
5 | public partial class RecipeDetailView : ContentPage
6 | {
7 | public RecipeDetailView(RecipeDetailViewModel vm)
8 | {
9 | InitializeComponent();
10 |
11 | BindingContext = vm;
12 |
13 | ShareButton.Clicked += async (s, a) =>
14 | {
15 | await Share.Default.RequestAsync(new ShareTextRequest
16 | {
17 | Text = vm.Recipe.RecipeInstructions,
18 | Title = vm.Recipe.RecipeName
19 | });
20 | };
21 | }
22 | }
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/SettingsView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
12 |
13 |
15 |
16 |
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/Finish/RefreshingRecipes/Views/SettingsView.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.ViewModels;
2 |
3 | namespace RefreshingRecipes.Views;
4 |
5 | public partial class SettingsView : ContentPage
6 | {
7 | public SettingsView(SettingsViewModel vm)
8 | {
9 | InitializeComponent();
10 |
11 | this.BindingContext = vm;
12 | }
13 | }
--------------------------------------------------------------------------------
/Part2-UIDesign/README-es.md:
--------------------------------------------------------------------------------
1 | # Part 2 - Diseño de la Interfaz de Usuario
2 | ¡Mejoremos la apariencia visual de nuestra aplicación!
3 |
4 | ### Responder a los cambios de tema del sistema (modo oscuro/claro)
5 | 1. Abre **RecipeListView.xaml**. Agrega el siguiente código como parte de las propiedades de **ContentPage**:
6 |
7 | ```xaml
8 | BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}"
9 | ```
10 |
11 | Estamos especificando el **color de fondo** para la página que cambia dependiendo si el dispositivo está usando su tema claro u oscuro. `Primary` y `Secondary` se definen en `Resources/Styles/Colors.xaml`, como puedes observar en la siguiente imagen.
12 |
13 | 
14 |
15 | 2. Para el `Label`, vamos a hacerla más grande, alinearla a la izquierda, ponerla en negrita y definirle un color de texto que también cambie según la preferencia de tema del usuario. Reemplaza la definición anterior del `Label` con este nuevo código:
16 |
17 | ```xaml
18 |
24 | ```
25 | 3. ¿Qué pasa con el botón? Respetaremos el tema oscuro/claro seleccionado para los colores de fondo y texto, por lo que este es el nuevo código (esta vez elegimos una definición más simple):
26 |
27 | ```xaml
28 |
33 | ```
34 |
35 | 4. ¡Compila y ejecuta la aplicación! Primero, veamos nuestra aplicación corriendo en Android:
36 |
37 | 
38 |
39 | Ahora, habilita el modo oscuro en tu dispositivo. Por ejemplo, a continuación se muestra cómo configurarlo en un emulador de Android.
40 |
41 | 
42 |
43 | Vuelve a tu aplicación y...
44 |
45 | 
46 |
47 | ... ¡la magia acaba de suceder! Puedes ver como el color de fondo de la página es diferente entre para cada tema, y lo mismo ocurre tanto con el color del texto del Label como con los colores del botón (texto y fondo).
48 |
49 | **Importante:** En lugar de especificar una propiedad dinámica para cada View en tu página, define un `Estilo` y aplícalo (esto maximiza la reutilización del código). Obtén más información sobre la clase [Style] (https://learn.microsoft.com/es-mx/dotnet/maui/user-interface/styles/xaml) y [App theme binding] (https://learn.microsoft.com/es-mx/dotnet/maui/user-interface/system-theme-changes).
50 |
51 | ### Esquinas redondeadas en la imagen
52 |
53 | 1. Puedes redondear las esquinas de la imagen envolviendo el control `Image` en un `Frame`. Agregamos este control y movemos la definición de la imagen adentro de la siguiente manera:
54 |
55 | ```xaml
56 |
60 |
64 |
65 | ```
66 |
67 | 2. Vuelve a ejecutar la aplicación y verás que las esquinas de la imagen se han redondeado:
68 |
69 | 
70 |
71 | ### Agrega fuentes personalizadas
72 | Finalmente, ¡agreguemos un conjunto popular de íconos a nuestra aplicación!
73 |
74 | 1. Descargue el set gratuito y de código abierto [Material Design Icons](https://pictogrammers.com/library/mdi/) ejecutando el comando `npm install`, tal como se muestra en la imagen:
75 |
76 | 
77 |
78 | 2. Una vez descargado, encontrará el archivo **materialdesignicons-webfont.ttf** en la carpeta Fonts.
79 |
80 | 
81 |
82 | 3. A continuación, debes generar una clase que contenga todos los glifos para que puedas hacer referencia a los iconos desde C#. Visita el sitio web **[Icon Font to #Code](https://andreinitescu.github.io/IconFont2Code/)**.
83 |
84 | 
85 |
86 | 4. Ahora, carga el archivo de fuentes y verás que se muestra un código auxiliar de una clase de C#. **Cópiala en el portapapeles**.
87 |
88 | 
89 |
90 | 5. Crea una nueva carpeta (`Helpers`) y un archivo C# (`IconFont.cs`) en tu proyecto. Reemplaza el código predeterminado con el código generado a partir de la herramienta (manteniendo el espacio de nombres predeterminado del proyecto).
91 |
92 | 
93 |
94 | 6. Ve a la carpeta `Fonts` (en la carpeta `Resources`), luego agrega el archivo existente `materialdesignicons-webfont.ttf` y asegúrate de que `Build Action` está configurado en `MauiFont`.
95 |
96 | 
97 |
98 | 7. Dado que necesitas registrar la fuente en tu clase **MauiProgram.cs**, agrega la siguiente línea en la extensión `ConfigureFonts`, la cual hace referencia al archivo de fuente y establece un alias que podemos usar en el código:
99 |
100 | ```csharp
101 | fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
102 | ```
103 |
104 | 8. Vuelve al archivo `RefreshingRecipes.xaml` y agrega la referencia del espacio de nombres `Helpers` en la definición superior de `ContentPage`:
105 |
106 | ```xaml
107 | xmlns:helpers="clr-namespace:RefreshingRecipes.Helpers"
108 | ```
109 |
110 | 9. Entonces, ¡estamos listos para agregar íconos a nuestra aplicación! Usemos uno para el botón que comparte la receta. Para ello, la propiedad `FontFamily` debe hacer referencia al alias que se definió previamente en `MauiProgram.cs`, el cual es `MaterialDesignIcons`.
111 |
112 | Además, el botón se mostrará como un botón circular.
113 |
114 | Este es el nuevo código para el botón:
115 |
116 | ```xaml
117 |
126 | ```
127 |
128 | Obtén más información sobre [Agregando fuentes personalizadas en .NET MAUI](https://cedricgabrang.medium.com/custom-fonts-material-design-icons-in-net-maui-acf59c9f98fe) y [Creando botones circulares en XAML]( https://askxammy.com/sencilla-manera-de-crear-botones-circulares-en-formularios-xamarin/).
129 |
130 | 10. ¡Probemos esta implementación! Ejecuta la aplicación:
131 |
132 | 
133 |
134 | ¡Felicidades! ¡Has terminado la Parte 2! Aprendamos ahora sobre el patrón MVVM en la [Parte 3](/Part3-MVVM/README-es.md).
135 |
136 | ### Contribuciones de la comunidad: mejorando la interfaz de usuario
137 |
138 | Gracias a [Bryan Oroxon](https://github.com/BryanOroxon/) por la siguiente implementación.
139 |
140 | 1. Agrega una nueva definición de Color en `Resources/Styles/Colors.xaml`:
141 |
142 | ```xaml
143 | #3b65ff
144 | ```
145 |
146 | 2. Echa un vistazo a la nueva y mejorada versión de código de [`RecipeListView.xaml`](/Part3-MVVM/RefreshingRecipes/Views/RecipeListView.xaml), donde se implementa `AppThemeBinding` para diferentes controles. Además, el diseño cambia un poco para mostrar el nombre de la bebida refrescante sobre la imagen.
147 |
148 | 3. Cuando ejecutas la aplicación implementando el código anterior (puedes copiar y pegar), así es como debería verse (cuando el modo oscuro está habilitado):
149 |
150 | 
--------------------------------------------------------------------------------
/Part2-UIDesign/README.md:
--------------------------------------------------------------------------------
1 | # Part 2 - UI Design
2 | Let's improve the visual appearance of our app!
3 |
4 | ### Respond to system theme changes (dark/light mode)
5 | 1. Open **RecipeListView.xaml**. Add the following code as part of the **ContentPage** properties:
6 |
7 | ```xaml
8 | BackgroundColor="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Primary}}"
9 | ```
10 |
11 | We are specifying the **background color** for the Page that changes based on whether the device is using its light or dark theme. `Primary` and `Secondary` are defined in `Resources/Styles/Colors.xaml`, as you can see in the next picture.
12 |
13 | 
14 |
15 | 2. For the `Label` let's make it larger, align it to the left, make it bold, and define a text color that also changes based on the user's theme preference. Replace the previous `Label` definition with this new code:
16 |
17 | ```xaml
18 |
24 | ```
25 |
26 | 3. What about the button? We will respect the dark/light selected theme for the background and text colors, so this is the new code for it (we chose a simpler definition this time):
27 |
28 |
29 | ```xaml
30 |
35 | ```
36 |
37 | 4. Compile and run the application! First, let's see how our application looks like in Android:
38 |
39 | 
40 |
41 | Now, enable the Dark mode on your device. For example, here are the settings for an Android emulator.
42 |
43 | 
44 |
45 | Switch back to your app and...
46 |
47 | 
48 |
49 | ...magic just happened! You can see how the page background color is different between light and dark themes, and the same happens with the label text color and the button colors (text and background).
50 |
51 | **Important:** Rather than specifying a dynamic property for each View in your page, define a `Style` and apply it (this maximizes code reutilization). Read more about [Styles](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/styles/xaml) and [App theme bindings](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/system-theme-changes).
52 |
53 |
54 | ### Round corners on the image
55 |
56 | 1. You can round the image corners by wrapping the `Image` into a `Frame`. We add this View and move the Image definition inside as follows:
57 |
58 | ```xaml
59 |
63 |
67 |
68 | ```
69 |
70 | 2. Run the app again, and you will see that the corners on the picture have been rounded:
71 |
72 | 
73 |
74 | ### Add custom fonts
75 | Finally, let's add a popular set of icons into our app!
76 |
77 | 1. Download the free and open-source [Material Design Icons](https://pictogrammers.com/library/mdi/) set by running the `npm install` command.
78 |
79 | 
80 |
81 | 2. Once downloaded, you will find the **materialdesignicons-webfont.ttf** file in the fonts folder.
82 |
83 | 
84 |
85 | 3. Next, you need to generate a class containing all the glyphs so you can reference your icons from C#. Visit the **[Icon Font to #Code](https://andreinitescu.github.io/IconFont2Code/)** website.
86 |
87 | 
88 |
89 | 4. Now upload the font file and you will see that a C# helper class code is shown. **Copy it to the clipboard**.
90 |
91 | 
92 |
93 | 5. Create a new folder (`Helpers`) and C# file (`IconFont.cs`) in your project. Replace the default class code with the code generated from the tool (keep the default namespace from your project).
94 |
95 | 
96 |
97 | 6. Go to the `Fonts` folder (under the `Resources` folder), then add the `materialdesignicons-webfont.ttf` existing file, and make sure the `Build Action` is set to `MauiFont`.
98 |
99 | 
100 |
101 | 7. Since you need to register the font in your **MauiProgram.cs** class, add the following line into the `ConfigureFonts` extension, which references the font file and sets an alias we can use in the code:
102 |
103 | ```csharp
104 | fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
105 | ```
106 |
107 | 8. Back into `RefreshingRecipes.xaml` file, add the `Helpers` namespace reference at the top `ContentPage` definition:
108 |
109 | ```xaml
110 | xmlns:helpers="clr-namespace:RefreshingRecipes.Helpers"
111 | ```
112 |
113 | 9. Then, we are ready to add icons into our app! Let's use one for the button that we use to share the recipe. To do that, the `FontFamily` property must reference the alias that was previously defined in `MauiProgram.cs`, which is `MaterialDesignIcons`.
114 |
115 | Moreover, the button will be displayed as a circle button.
116 |
117 | This is the new code for the button:
118 |
119 | ```xaml
120 |
129 | ```
130 |
131 | Learn more about [Adding custom fonts in .NET MAUI](https://cedricgabrang.medium.com/custom-fonts-material-design-icons-in-net-maui-acf59c9f98fe) and [Creating circle buttons in XAML](https://askxammy.com/easy-way-to-create-circle-buttons-in-xamarin-forms/)
132 |
133 | 10. Let's test this implementation! Run the app:
134 |
135 | 
136 |
137 | Congratulations! You have finished Part 2! Let's continue and learn about the MVVM pattern in [Part 3](/Part3-MVVM/README.md).
138 |
139 | ### Community Contributions - Improving the UI
140 |
141 | Thanks to [Bryan Oroxon](https://github.com/BryanOroxon/) for the following implementation.
142 |
143 | 1. Add a new Color definition in `Resources/Styles/Colors.xaml`:
144 |
145 | ```xaml
146 | #3b65ff
147 | ```
148 |
149 | 2. Take a look at the improved [`RecipeListView.xaml`](/Part3-MVVM/RefreshingRecipes/Views/RecipeListView.xaml), where `AppThemeBinding` is implemented for different controls. Moreover, the layout changes a bit to display the `Label` over the `Image`.
150 |
151 | 3. When you run the app, this is how it should look like (when Dark mode is enabled):
152 |
153 | 
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31611.283
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RefreshingRecipes", "RefreshingRecipes\RefreshingRecipes.csproj", "{435D3059-1CA1-4836-891C-5AC7943D652D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Deploy.0 = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class AppShell : Shell
4 | {
5 | public AppShell()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class MainPage : ContentPage
4 | {
5 | int count = 0;
6 |
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private void OnCounterClicked(object sender, EventArgs e)
13 | {
14 | count++;
15 |
16 | if (count == 1)
17 | CounterBtn.Text = $"Clicked {count} time";
18 | else
19 | CounterBtn.Text = $"Clicked {count} times";
20 |
21 | SemanticScreenReader.Announce(CounterBtn.Text);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | public static class MauiProgram
6 | {
7 | public static MauiApp CreateMauiApp()
8 | {
9 | var builder = MauiApp.CreateBuilder();
10 | builder
11 | .UseMauiApp()
12 | .ConfigureFonts(fonts =>
13 | {
14 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16 | });
17 |
18 | #if DEBUG
19 | builder.Logging.AddDebug();
20 | #endif
21 |
22 | return builder.Build();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UIRequiredDeviceCapabilities
11 |
12 | arm64
13 |
14 | UISupportedInterfaceOrientations
15 |
16 | UIInterfaceOrientationPortrait
17 | UIInterfaceOrientationLandscapeLeft
18 | UIInterfaceOrientationLandscapeRight
19 |
20 | UISupportedInterfaceOrientations~ipad
21 |
22 | UIInterfaceOrientationPortrait
23 | UIInterfaceOrientationPortraitUpsideDown
24 | UIInterfaceOrientationLandscapeLeft
25 | UIInterfaceOrientationLandscapeRight
26 |
27 | XSAppIconAssets
28 | Assets.xcassets/appicon.appiconset
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace RefreshingRecipes.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | $placeholder$
15 | User Name
16 | $placeholder$.png
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/RefreshingRecipes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android;net7.0-ios;net7.0-maccatalyst
5 | $(TargetFrameworks);net7.0-windows10.0.19041.0
6 |
7 |
8 | Exe
9 | RefreshingRecipes
10 | true
11 | true
12 | enable
13 |
14 |
15 | RefreshingRecipes
16 |
17 |
18 | com.companyname.refreshingrecipes
19 | a5c676cf-69f8-43fd-b842-fde4ca544807
20 |
21 |
22 | 1.0
23 | 1
24 |
25 | 11.0
26 | 13.1
27 | 21.0
28 | 10.0.17763.0
29 | 10.0.17763.0
30 | 6.5
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | MSBuild:Compile
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part2-UIDesign/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part2-UIDesign/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Images/smoothie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part2-UIDesign/RefreshingRecipes/Resources/Images/smoothie.png
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #512BD4
8 | #DFD8F7
9 | #2B0B98
10 | White
11 | Black
12 | #E1E1E1
13 | #C8C8C8
14 | #ACACAC
15 | #919191
16 | #6E6E6E
17 | #404040
18 | #212121
19 | #141414
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | #F7B548
35 | #FFD590
36 | #FFE5B9
37 | #28C2D1
38 | #7BDDEF
39 | #C3F2F4
40 | #3E8EED
41 | #72ACF1
42 | #A7CBF6
43 |
44 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Views/RecipeListView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
20 |
21 |
--------------------------------------------------------------------------------
/Part2-UIDesign/RefreshingRecipes/Views/RecipeListView.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes.Views;
2 |
3 | public partial class RecipeListView : ContentPage
4 | {
5 | public RecipeListView()
6 | {
7 | InitializeComponent();
8 |
9 | ShareButton.Clicked += async (s, a) =>
10 | {
11 | await Share.Default.RequestAsync(new ShareTextRequest
12 | {
13 | Text = "Enjoy a refreshing Raspberry smoothie.",
14 | Title = "Raspberry smoothie recipe"
15 | });
16 | };
17 | }
18 | }
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31611.283
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RefreshingRecipes", "RefreshingRecipes\RefreshingRecipes.csproj", "{435D3059-1CA1-4836-891C-5AC7943D652D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Deploy.0 = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class AppShell : Shell
4 | {
5 | public AppShell()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class MainPage : ContentPage
4 | {
5 | int count = 0;
6 |
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private void OnCounterClicked(object sender, EventArgs e)
13 | {
14 | count++;
15 |
16 | if (count == 1)
17 | CounterBtn.Text = $"Clicked {count} time";
18 | else
19 | CounterBtn.Text = $"Clicked {count} times";
20 |
21 | SemanticScreenReader.Announce(CounterBtn.Text);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | public static class MauiProgram
6 | {
7 | public static MauiApp CreateMauiApp()
8 | {
9 | var builder = MauiApp.CreateBuilder();
10 | builder
11 | .UseMauiApp()
12 | .ConfigureFonts(fonts =>
13 | {
14 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16 | fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
17 | });
18 |
19 | #if DEBUG
20 | builder.Logging.AddDebug();
21 | #endif
22 |
23 | return builder.Build();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UIRequiredDeviceCapabilities
11 |
12 | arm64
13 |
14 | UISupportedInterfaceOrientations
15 |
16 | UIInterfaceOrientationPortrait
17 | UIInterfaceOrientationLandscapeLeft
18 | UIInterfaceOrientationLandscapeRight
19 |
20 | UISupportedInterfaceOrientations~ipad
21 |
22 | UIInterfaceOrientationPortrait
23 | UIInterfaceOrientationPortraitUpsideDown
24 | UIInterfaceOrientationLandscapeLeft
25 | UIInterfaceOrientationLandscapeRight
26 |
27 | XSAppIconAssets
28 | Assets.xcassets/appicon.appiconset
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace RefreshingRecipes.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | $placeholder$
15 | User Name
16 | $placeholder$.png
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/RefreshingRecipes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android;net7.0-ios;net7.0-maccatalyst
5 | $(TargetFrameworks);net7.0-windows10.0.19041.0
6 |
7 |
8 | Exe
9 | RefreshingRecipes
10 | true
11 | true
12 | enable
13 |
14 |
15 | RefreshingRecipes
16 |
17 |
18 | com.companyname.refreshingrecipes
19 | a5c676cf-69f8-43fd-b842-fde4ca544807
20 |
21 |
22 | 1.0
23 | 1
24 |
25 | 11.0
26 | 13.1
27 | 21.0
28 | 10.0.17763.0
29 | 10.0.17763.0
30 | 6.5
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | MSBuild:Compile
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part3-MVVM/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part3-MVVM/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part3-MVVM/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Images/smoothie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part3-MVVM/RefreshingRecipes/Resources/Images/smoothie.png
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #512BD4
8 | #DFD8F7
9 | #2B0B98
10 | White
11 | Black
12 | #E1E1E1
13 | #C8C8C8
14 | #ACACAC
15 | #919191
16 | #6E6E6E
17 | #404040
18 | #212121
19 | #141414
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | #F7B548
35 | #FFD590
36 | #FFE5B9
37 | #28C2D1
38 | #7BDDEF
39 | #C3F2F4
40 | #3E8EED
41 | #72ACF1
42 | #A7CBF6
43 | #3b65ff
44 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Views/RecipeListView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
19 |
20 |
21 |
25 |
31 |
36 |
37 |
38 |
39 |
40 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Part3-MVVM/RefreshingRecipes/Views/RecipeListView.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes.Views;
2 |
3 | public partial class RecipeListView : ContentPage
4 | {
5 | public RecipeListView()
6 | {
7 | InitializeComponent();
8 |
9 | ShareButton.Clicked += async (s, a) =>
10 | {
11 | await Share.Default.RequestAsync(new ShareTextRequest
12 | {
13 | Text = "Enjoy a refreshing Raspberry smoothie.",
14 | Title = "Raspberry smoothie recipe"
15 | });
16 | };
17 | }
18 | }
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.31611.283
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RefreshingRecipes", "RefreshingRecipes\RefreshingRecipes.csproj", "{435D3059-1CA1-4836-891C-5AC7943D652D}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Build.0 = Release|Any CPU
19 | {435D3059-1CA1-4836-891C-5AC7943D652D}.Release|Any CPU.Deploy.0 = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(SolutionProperties) = preSolution
22 | HideSolutionNode = FALSE
23 | EndGlobalSection
24 | GlobalSection(ExtensibilityGlobals) = postSolution
25 | SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26 | EndGlobalSection
27 | EndGlobal
28 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.Views;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | public partial class AppShell : Shell
6 | {
7 | public AppShell()
8 | {
9 | InitializeComponent();
10 |
11 | Routing.RegisterRoute(nameof(RecipeDetailView), typeof(RecipeDetailView));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes;
2 |
3 | public partial class MainPage : ContentPage
4 | {
5 | int count = 0;
6 |
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private void OnCounterClicked(object sender, EventArgs e)
13 | {
14 | count++;
15 |
16 | if (count == 1)
17 | CounterBtn.Text = $"Clicked {count} time";
18 | else
19 | CounterBtn.Text = $"Clicked {count} times";
20 |
21 | SemanticScreenReader.Announce(CounterBtn.Text);
22 | }
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 | using RefreshingRecipes.Services;
3 | using RefreshingRecipes.ViewModels;
4 | using RefreshingRecipes.Views;
5 |
6 | namespace RefreshingRecipes;
7 |
8 | public static class MauiProgram
9 | {
10 | public static MauiApp CreateMauiApp()
11 | {
12 | var builder = MauiApp.CreateBuilder();
13 | builder
14 | .UseMauiApp()
15 | .ConfigureFonts(fonts =>
16 | {
17 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
18 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
19 | fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
20 | });
21 |
22 | builder.Services.AddSingleton();
23 |
24 | builder.Services.AddSingleton();
25 | builder.Services.AddTransient();
26 |
27 | builder.Services.AddTransient();
28 | builder.Services.AddTransient();
29 |
30 | #if DEBUG
31 | builder.Logging.AddDebug();
32 | #endif
33 |
34 | return builder.Build();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Models/Recipe.cs:
--------------------------------------------------------------------------------
1 | namespace RefreshingRecipes.Models
2 | {
3 | public class Recipe
4 | {
5 | public int RecipeId { get; set; }
6 | public string RecipeName { get; set; }
7 | public string RecipePhotoUrl { get; set; }
8 | public string RecipeInstructions { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UIRequiredDeviceCapabilities
11 |
12 | arm64
13 |
14 | UISupportedInterfaceOrientations
15 |
16 | UIInterfaceOrientationPortrait
17 | UIInterfaceOrientationLandscapeLeft
18 | UIInterfaceOrientationLandscapeRight
19 |
20 | UISupportedInterfaceOrientations~ipad
21 |
22 | UIInterfaceOrientationPortrait
23 | UIInterfaceOrientationPortraitUpsideDown
24 | UIInterfaceOrientationLandscapeLeft
25 | UIInterfaceOrientationLandscapeRight
26 |
27 | XSAppIconAssets
28 | Assets.xcassets/appicon.appiconset
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace RefreshingRecipes;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace RefreshingRecipes.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | $placeholder$
15 | User Name
16 | $placeholder$.png
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace RefreshingRecipes;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace RefreshingRecipes;
5 |
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/RefreshingRecipes.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net7.0-android;net7.0-ios;net7.0-maccatalyst
5 | $(TargetFrameworks);net7.0-windows10.0.19041.0
6 |
7 |
8 | Exe
9 | RefreshingRecipes
10 | true
11 | true
12 | enable
13 |
14 |
15 | RefreshingRecipes
16 |
17 |
18 | com.companyname.refreshingrecipes
19 | a5c676cf-69f8-43fd-b842-fde4ca544807
20 |
21 |
22 | 1.0
23 | 1
24 |
25 | 11.0
26 | 13.1
27 | 21.0
28 | 10.0.17763.0
29 | 10.0.17763.0
30 | 6.5
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | RecipeDetailView.xaml
64 |
65 |
66 |
67 |
68 |
69 | MSBuild:Compile
70 |
71 |
72 | MSBuild:Compile
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part4-LocalStorage/RefreshingRecipes/Resources/Fonts/materialdesignicons-webfont.ttf
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Images/smoothie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Part4-LocalStorage/RefreshingRecipes/Resources/Images/smoothie.png
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | #512BD4
8 | #DFD8F7
9 | #2B0B98
10 | White
11 | Black
12 | #E1E1E1
13 | #C8C8C8
14 | #ACACAC
15 | #919191
16 | #6E6E6E
17 | #404040
18 | #212121
19 | #141414
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | #F7B548
35 | #FFD590
36 | #FFE5B9
37 | #28C2D1
38 | #7BDDEF
39 | #C3F2F4
40 | #3E8EED
41 | #72ACF1
42 | #A7CBF6
43 | #3b65ff
44 | #4b05ad
45 | #2b0b98
46 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Services/IRecipeService.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.Models;
2 |
3 | namespace RefreshingRecipes.Services
4 | {
5 | public interface IRecipeService
6 | {
7 | Task> GetRecipes();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Services/RecipeService.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Http.Json;
2 |
3 | using RefreshingRecipes.Models;
4 |
5 | namespace RefreshingRecipes.Services
6 | {
7 | public class RecipeService : IRecipeService
8 | {
9 | HttpClient httpClient;
10 |
11 | public RecipeService()
12 | {
13 | this.httpClient = new HttpClient();
14 | }
15 |
16 | public async Task> GetRecipes()
17 | {
18 | var response = await httpClient.GetAsync("https://gist.githubusercontent.com/icebeam7/a6c1c7523e67272e294204aff0b115cc/raw/84d3d9c1b25d924630b15d901fa38dbbd13f20fc/recipes.json");
19 |
20 | if (response.IsSuccessStatusCode)
21 | return await response.Content.ReadFromJsonAsync>();
22 |
23 | return default;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/ViewModels/BaseViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 |
3 | namespace RefreshingRecipes.ViewModels
4 | {
5 | public partial class BaseViewModel : ObservableObject
6 | {
7 | [ObservableProperty]
8 | [NotifyPropertyChangedFor(nameof(IsNotBusy))]
9 | bool isBusy;
10 |
11 | [ObservableProperty]
12 | string title;
13 |
14 | public bool IsNotBusy => !IsBusy;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/ViewModels/RecipeCollectionViewModel.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | using RefreshingRecipes.Views;
4 | using RefreshingRecipes.Models;
5 | using RefreshingRecipes.Services;
6 |
7 | using CommunityToolkit.Mvvm.Input;
8 | using CommunityToolkit.Mvvm.ComponentModel;
9 |
10 | namespace RefreshingRecipes.ViewModels
11 | {
12 | public partial class RecipeCollectionViewModel : BaseViewModel
13 | {
14 | public ObservableCollection Recipes { get; } = new();
15 |
16 | IRecipeService recipeService;
17 |
18 | [ObservableProperty]
19 | Recipe selectedRecipe;
20 |
21 | public RecipeCollectionViewModel(IRecipeService recipeService)
22 | {
23 | Title = "Recipe List";
24 | this.recipeService = recipeService;
25 | }
26 |
27 | [RelayCommand]
28 | async Task GetRecipesAsync()
29 | {
30 | if (IsBusy)
31 | return;
32 |
33 | try
34 | {
35 | IsBusy = true;
36 | var recipes = (await recipeService.GetRecipes()).ToList();
37 |
38 | if (Recipes.Count != 0)
39 | Recipes.Clear();
40 |
41 | foreach (var recipe in recipes)
42 | Recipes.Add(recipe);
43 | }
44 | catch (Exception ex)
45 | {
46 | await Shell.Current.DisplayAlert("Error!", ex.Message, "OK");
47 | }
48 | finally
49 | {
50 | IsBusy = false;
51 | }
52 | }
53 |
54 | [RelayCommand]
55 | async Task GoToDetails()
56 | {
57 | if (SelectedRecipe == null)
58 | return;
59 |
60 | var data = new Dictionary
61 | {
62 | {"Recipe", SelectedRecipe }
63 | };
64 |
65 | await Shell.Current.GoToAsync(nameof(RecipeDetailView), true, data);
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/ViewModels/RecipeDetailViewModel.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Mvvm.ComponentModel;
2 | using RefreshingRecipes.Models;
3 |
4 | namespace RefreshingRecipes.ViewModels
5 | {
6 | [QueryProperty(nameof(Recipe), "Recipe")]
7 | public partial class RecipeDetailViewModel : BaseViewModel
8 | {
9 | public RecipeDetailViewModel()
10 | {
11 |
12 | }
13 |
14 | [ObservableProperty]
15 | Recipe recipe;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Views/RecipeCollectionView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
30 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
76 |
77 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Views/RecipeCollectionView.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.ViewModels;
2 |
3 | namespace RefreshingRecipes.Views;
4 |
5 | public partial class RecipeCollectionView : ContentPage
6 | {
7 | public RecipeCollectionView(RecipeCollectionViewModel vm)
8 | {
9 | InitializeComponent();
10 |
11 | BindingContext = vm;
12 | }
13 | }
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Views/RecipeDetailView.xaml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
19 |
22 |
23 |
24 |
28 |
34 |
39 |
40 |
41 |
42 |
43 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Part4-LocalStorage/RefreshingRecipes/Views/RecipeDetailView.xaml.cs:
--------------------------------------------------------------------------------
1 | using RefreshingRecipes.ViewModels;
2 |
3 | namespace RefreshingRecipes.Views;
4 |
5 | public partial class RecipeDetailView : ContentPage
6 | {
7 | public RecipeDetailView(RecipeDetailViewModel vm)
8 | {
9 | InitializeComponent();
10 |
11 | BindingContext = vm;
12 |
13 | ShareButton.Clicked += async (s, a) =>
14 | {
15 | await Share.Default.RequestAsync(new ShareTextRequest
16 | {
17 | Text = vm.Recipe.RecipeInstructions,
18 | Title = vm.Recipe.RecipeName
19 | });
20 | };
21 | }
22 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # .NET MAUI Summer Coding Adventure
2 | Join us on an exciting Summer Coding Adventure as we dive into the enchanting world of .NET MAUI app development! We will build a .NET MAUI application that will display a list of refreshing recipes that you can prepare and enjoy during warm weather. We will start by building a basic app that presents a couple of recipes and that you can share with your friends. We will then improve the UI design. We will also see how to obtain data from a RESTful endpoint and add our own recipes to the app, which will be stored locally in the device.
3 |
4 | ## Languages
5 | This workshop is available in the following languages:
6 |
7 | * English - default README files
8 | - [Spanish](./Translations/es/README.md)
9 |
10 | ## Agenda
11 | * [Part 1](/Part1-GettingStarted/README.md) - Getting Started
12 | * [Part 2](/Part2-UIDesign/README.md) - UI Design
13 | * [Part 3](/Part3-MVVM/README.md) - MVVM
14 | * [Part 4](/Part4-LocalStorage/README.md) - Storing Local Data
15 |
16 | ## Cloud Skills Challenge
17 | Join our [.NET MAUI Cloud Skills Challenge](https://aka.ms/Summer.NETMAUI-CSC1).
18 |
19 | ## Microsoft Reactor Series related videos
20 | * [From Mobile to Desktop: Building Versatile Apps with .NET MAUI](https://developer.microsoft.com/en-us/reactor/events/20263/)
21 | * [Exploring UI Design in .NET MAUI](https://developer.microsoft.com/en-us/reactor/events/20264/)
22 | * [Efficient Data Binding with MVVM in .NET MAUI](https://developer.microsoft.com/en-us/reactor/events/20265/)
23 | * [Local Data Persistence Made Easy in .NET MAUI](https://developer.microsoft.com/en-us/reactor/events/20266/)
24 |
25 | ## More links and resources
26 | * [.NET MAUI website](https://dot.net/maui)
27 | * [.NET MAUI documentation](https://docs.microsoft.com/dotnet/maui)
28 | * [.NET MAUI on GitHub](https://github.com/dotnet/maui)
--------------------------------------------------------------------------------
/Resources/smoothie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/icebeam7/SummerCoding/49d9a25490784428e8809369356938463579cd08/Resources/smoothie.png
--------------------------------------------------------------------------------
/Translations/README.md:
--------------------------------------------------------------------------------
1 | In this folder, you can find translations of this repository in their appropriately-named folders.
2 |
3 | - [Español](./es/README.md)
--------------------------------------------------------------------------------
/Translations/es/README.md:
--------------------------------------------------------------------------------
1 | # Aventura de Codificación de Verano con .NET MAUI
2 | ¡Únase a nosotros en una emocionante aventura de codificación de verano mientras nos sumergimos en el encantador mundo del desarrollo de aplicaciones .NET MAUI! Construiremos una aplicación .NET MAUI que mostrará una lista de recetas refrescantes que puede preparar y disfrutar durante el clima cálido. Comenzaremos creando una aplicación básica que presenta un par de recetas y que puedes compartir con tus amigos. Luego mejoraremos el diseño de la interfaz de usuario. También veremos cómo obtener datos de un endpoint RESTful y agregar nuestras propias recetas a la aplicación, que se almacenarán localmente en el dispositivo.
3 |
4 | ## Idiomas
5 | Este taller está disponible en los siguientes idiomas:
6 |
7 | * Inglés - Archivo README original
8 | - [Español](/Translations/es/README.md)
9 |
10 | ## Agenda
11 | * [Parte 1](/Part1-GettingStarted/README-es.md) - Primeros Pasos
12 | * [Parte 2](/Part2-UIDesign/README-es.md) - Diseño de Interfaz de Usuario
13 | * [Parte 3](/Part3-MVVM/README-es.md) - MVVM
14 | * [Parte 4](/Part4-LocalStorage/README-es.md) - Almacenamiento de Datos Locales
15 |
16 | ## Desafío de habilidades en la Nube
17 | Únase a nuestro [desafío de habilidades en la nube de .NET MAUI](https://aka.ms/Summer.NETMAUI-CSC1).
18 |
19 | ## Vídeos relacionados con la serie Microsoft Reactor
20 | * [De móvil a escritorio: creación de aplicaciones versátiles con .NET MAUI](https://developer.microsoft.com/es-es/reactor/events/20267/)
21 | * [Explorando el diseño de la interfaz de usuario en .NET MAUI](https://developer.microsoft.com/es-es/reactor/events/20268/)
22 | * [Enlace de datos eficiente con MVVM en .NET MAUI](https://developer.microsoft.com/es-es/reactor/events/20269/)
23 | * [Persistencia de datos locales simplificada en .NET MAUI](https://developer.microsoft.com/es-es/reactor/events/20270/)
24 |
25 | ## Más enlaces y recursos
26 | * [Sitio Web de .NET MAUI](https://dot.net/maui)
27 | * [Documentación de .NET MAUI](https://docs.microsoft.com/dotnet/maui)
28 | * [GitHub de .NET MAUI](https://github.com/dotnet/maui)
--------------------------------------------------------------------------------