diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f5945cf --- /dev/null +++ b/.gitignore @@ -0,0 +1,234 @@ +.DS_Store +node_modules +.tmp +npm-debug.log + + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ + +# We have custom build targets in here so include it. +# build/ +bld/ +[Bb]in/ +[Oo]bj/ +packages/ + +# Visual Studo 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +*.nuget.targets +# The packages folder can be ignored because of Package Restore +**/packages/*. +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.[Cc]ache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +# *.pfx +*.publishsettings +node_modules/ +bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +project.lock.json + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk \ No newline at end of file diff --git a/Beispieldateien/Data/Category.cs b/Beispieldateien/Data/Category.cs new file mode 100644 index 0000000..2d13767 --- /dev/null +++ b/Beispieldateien/Data/Category.cs @@ -0,0 +1,9 @@ +namespace ElVegetarianoFurio.Menu +{ + public class Category + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/Beispieldateien/Data/Dish.cs b/Beispieldateien/Data/Dish.cs new file mode 100644 index 0000000..ce1d48d --- /dev/null +++ b/Beispieldateien/Data/Dish.cs @@ -0,0 +1,11 @@ +namespace ElVegetarianoFurio.Menu +{ + public class Dish + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public decimal Price { get; set; } + public int CategoryId { get; set; } + } +} \ No newline at end of file diff --git a/Beispieldateien/Data/DummyDataService.cs b/Beispieldateien/Data/DummyDataService.cs new file mode 100644 index 0000000..3e87a00 --- /dev/null +++ b/Beispieldateien/Data/DummyDataService.cs @@ -0,0 +1,219 @@ +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio.Data; +public class DummyDataService : IDataService +{ + private readonly List _categories; + private readonly List _dishes; + + public DummyDataService() + { + _categories + = new List + { + new Category { Id = 1, Name = "Ensaladas", Description = "Salate" }, + new Category { Id = 2, Name = "Cremas y sopas", Description = "Suppen" }, + new Category { Id = 3, Name = "Tapas", Description = "Kleine Portionen" }, + new Category { Id = 4, Name = "Platos principales", Description = "Hauptgerichte" }, + new Category { Id = 5, Name = "Postres", Description = "Desserts" }, + new Category { Id = 6, Name = "Bebidas", Description = "Getränke" } + }; + + _dishes = new List + { + new Dish + { + Id = 1, + Name = "Ensalada de Casa", + Description = "Salat nach Art des Hauses. Gemischter Salat, Mais, Paprika, Käse, Zwiebeln", + Price = 3.49m, + CategoryId = 1 + }, + new Dish + { + Id = 2, + Name = "Ensalada furia", + Description = "Gemischter Salat mit Chillis, Paprika, Radieschen und Zwiebeln (scharf!)", + Price = 3.99m, + CategoryId = 1 + }, + new Dish + { + Id = 3, + Name = "Sopa de Tomate", + Description = "Tomatensuppe", + Price = 3.29m, + CategoryId = 2 + }, + new Dish + { + Id = 4, + Name = "Crema de verduras", + Description = "Gemüsecremesuppe", + Price = 4.39m, + CategoryId = 2 + }, + new Dish + { + Id = 5, + Name = "Tortilla de patatas", + Description = "Spanisches Omlett aus Eiern und Kartoffeln", + Price = 4.99m, + CategoryId = 3 + }, + new Dish + { + Id = 6, + Name = "Patatas bravas", + Description = "Gebratene Kartoffelstücke in pikanter Sauce", + Price = 3.99m, + CategoryId = 3 + }, + new Dish + { + Id = 7, + Name = "Pimientos al grill", + Description = "Gegrillte Paprika", + Price = 2.99m, + CategoryId = 3 + }, + new Dish + { + Id = 8, + Name = "Pan con alioli", + Description = "Ailoli mit Brot", + Price = 2.29m, + CategoryId = 3 + }, + new Dish + { + Id = 9, + Name = "Pan con tomate y ajo", + Description = "Brot mit Tomate und Knoblauch", + Price = 2.29m, + CategoryId = 3 + }, + new Dish + { + Id = 10, + Name = "Tortilla Chips", + Description = "Tortilla Chips mit Salsa Dip, Guacamole oder Alioli", + Price = 1.29m, + CategoryId = 3 + }, + new Dish + { + Id = 11, + Name = "Chilli sin carne", + Description = "Vegetarisches Chilli, serviert mit Reis", + Price = 5.39m, + CategoryId = 4 + }, + new Dish + { + Id = 12, + Name = "Enchiladas de verduras", + Description = "Überbackene Maistortillas gefüllt mit Gemüse", + Price = 4.99m, + CategoryId = 4 + }, + new Dish + { + Id = 13, + Name = "Burritos de verduras", + Description = "Weizentortillas gefüllt mit Gemüse", + Price = 4.99m, + CategoryId = 4 + }, + new Dish + { + Id = 14, + Name = "Arroz con verduras", + Description = "Reis-/Gemüsepfanne", + Price = 4.49m, + CategoryId = 4 + }, + new Dish + { + Id = 15, + Name = "Empanadas de espinacas y maíz", + Description = "Teigtaschen gefüllt mit Spinat und Mais", + Price = 4.49m, + CategoryId = 4 + }, + new Dish + { + Id = 16, + Name = "Crema Catalana", + Description = "Katalanische Creme", + Price = 2.49m, + CategoryId = 5 + }, + new Dish + { + Id = 17, + Name = "Ensalada de frutas", + Description = "Obstsalat mit frischen Früchten", + Price = 2.99m, + CategoryId = 5 + }, + new Dish + { + Id = 18, + Name = "Churros", + Description = "Spritzgebäck mit Zucker", + Price = 1.99m, + CategoryId = 5 + }, + new Dish + { + Id = 19, + Name = "Agua mineral", + Description = "Mineralwasser", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 20, + Name = "Zumo de manzana", + Description = "Apfelsaft", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 21, + Name = "Limonada", + Description = "Zitronenlimonade", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 22, + Name = "Café", + Description = "Kaffee", + Price = 1.59m, + CategoryId = 6 + } + }; + } + + public Task> GetCategoriesAsync() + { + return Task.FromResult(_categories); + } + + public Task> GetDishesAsync(int? categoryId = null) + { + return categoryId.HasValue + ? Task.FromResult(_dishes.Where(d => d.CategoryId == categoryId).ToList()) + : Task.FromResult(_dishes); + } + + public Task GetDishAsync(int id) + { + return Task.FromResult(_dishes.SingleOrDefault(d => d.Id == id)); + } +} \ No newline at end of file diff --git a/Beispieldateien/Data/IDataService.cs b/Beispieldateien/Data/IDataService.cs new file mode 100644 index 0000000..ea070e4 --- /dev/null +++ b/Beispieldateien/Data/IDataService.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio.Data; + +public interface IDataService +{ + Task> GetCategoriesAsync(); + Task> GetDishesAsync(int? categoryId = null); + Task GetDishAsync(int id); +} \ No newline at end of file diff --git a/Beispieldateien/Data/JsonDataService.cs b/Beispieldateien/Data/JsonDataService.cs new file mode 100644 index 0000000..98338a2 --- /dev/null +++ b/Beispieldateien/Data/JsonDataService.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using ElVegetarianoFurio.Menu; +using Newtonsoft.Json; + +namespace ElVegetarianoFurio.Data +{ + public class JsonDataService : IDataService + { + private RestaurantData _data; + private async Task GetRestaurantData() + { + if (_data != null) + { + return _data; + } + //var assembly = IntrospectionExtensions.GetTypeInfo(GetType()).Assembly; + var assembly = GetType().Assembly; + + var stream = assembly.GetManifestResourceStream("ElVegetarianoFurio.Data.db.json"); + + string json; + + using (var reader = new StreamReader(stream)) + { + json = await reader.ReadToEndAsync(); + } + + _data = JsonConvert.DeserializeObject(json); + return _data; + } + + public async Task> GetCategoriesAsync() + { + var data = await GetRestaurantData(); + return data.Categories; + } + + public async Task> GetDishesAsync(int? categoryId = null) + { + var dishes = (await GetRestaurantData()).Dishes; + + if (categoryId.HasValue) + { + dishes = dishes.Where(d => d.CategoryId == categoryId).ToList(); + } + + return dishes; + } + + public async Task GetDishAsync(int id) + { + var dishes = (await GetRestaurantData()).Dishes; + return dishes.SingleOrDefault(d => d.Id == id); + } + + private class RestaurantData + { + public List Categories { get; set; } + public List Dishes { get; set; } + } + } +} \ No newline at end of file diff --git a/Beispieldateien/Data/db.json b/Beispieldateien/Data/db.json new file mode 100644 index 0000000..9d44e4c --- /dev/null +++ b/Beispieldateien/Data/db.json @@ -0,0 +1,190 @@ +{ + "categories": [ + { + "id": 1, + "name": "Ensaladas", + "description": "Salate" + }, + { + "id": 2, + "name": "Cremas y sopas", + "description": "Suppen" + }, + { + "id": 3, + "name": "Tapas", + "description": "Kleine Portionen" + }, + { + "id": 4, + "name": "Platos principales", + "description": "Hauptgerichte" + }, + { + "id": 5, + "name": "Postres", + "description": "Desserts" + }, + { + "id": 6, + "name": "Bebidas", + "description": "Getränke" + } + ], + "dishes": [ + { + "id": 1, + "name": "Ensalada de Casa", + "description": "Salat nach Art des Hauses. Gemischter Salat, Mais, Paprika, Käse, Zwiebeln", + "price": 3.49, + "categoryId": 1 + }, + { + "id": 2, + "name": "Ensalada furia", + "description": "Gemischter Salat mit Chillis, Paprika, Radieschen und Zwiebeln (scharf!)", + "price": 3.99, + "categoryId": 1 + }, + { + "id": 3, + "name": "Sopa de Tomate", + "description": "Tomatensuppe", + "price": 3.29, + "categoryId": 2 + }, + { + "id": 4, + "name": "Crema de verduras", + "description": "Gemüsecremesuppe", + "price": 4.39, + "categoryId": 2 + }, + { + "id": 5, + "name": "Tortilla de patatas", + "description": "Spanisches Omlett aus Eiern und Kartoffeln", + "price": 4.99, + "categoryId": 3 + }, + { + "id": 6, + "name": "Patatas bravas", + "description": "Gebratene Kartoffelstücke in pikanter Sauce", + "price": 3.99, + "categoryId": 3 + }, + { + "id": 7, + "name": "Pimientos al grill", + "description": "Gegrillte Paprika", + "price": 2.99, + "categoryId": 3 + }, + { + "id": 8, + "name": "Pan con alioli", + "description": "Ailoli mit Brot", + "price": 2.29, + "categoryId": 3 + }, + { + "id": 9, + "name": "Pan con tomate y ajo", + "description": "Brot mit Tomate und Knoblauch", + "price": 2.29, + "categoryId": 3 + }, + { + "id": 10, + "name": "Tortilla Chips", + "description": "Tortilla Chips mit Salsa Dip, Guacamole oder Alioli", + "price": 1.29, + "categoryId": 3 + }, + { + "id": 11, + "name": "Chilli sin carne", + "description": "Vegetarisches Chilli, serviert mit Reis", + "price": 5.39, + "categoryId": 4 + }, + { + "id": 12, + "name": "Enchiladas de verduras", + "description": "Überbackene Maistortillas gefüllt mit Gemüse", + "price": 4.99, + "categoryId": 4 + }, + { + "id": 13, + "name": "Burritos de verduras", + "description": "Weizentortillas gefüllt mit Gemüse", + "price": 4.99, + "categoryId": 4 + }, + { + "id": 14, + "name": "Arroz con verduras", + "description": "Reis-/Gemüsepfanne", + "price": 4.49, + "categoryId": 4 + }, + { + "id": 15, + "name": "Empanadas de espinacas y maíz", + "description": "Teigtaschen gefüllt mit Spinat und Mais", + "price": 4.49, + "categoryId": 4 + }, + { + "id": 16, + "name": "Crema Catalana", + "description": "Katalanische Creme", + "price": 2.49, + "categoryId": 5 + }, + { + "id": 17, + "name": "Ensalada de frutas", + "description": "Obstsalat mit frischen Früchten", + "price": 2.99, + "categoryId": 5 + }, + { + "id": 18, + "name": "Churros", + "description": "Spritzgebäck mit Zucker", + "price": 1.99, + "categoryId": 5 + }, + { + "id": 19, + "name": "Agua mineral", + "description": "Mineralwasser", + "price": 1.59, + "categoryId": 6 + }, + { + "id": 20, + "name": "Zumo de manzana", + "description": "Apfelsaft", + "price": 1.59, + "categoryId": 6 + }, + { + "id": 21, + "name": "Limonada", + "description": "Zitronenlimonade", + "price": 1.59, + "categoryId": 6 + }, + { + "id": 22, + "name": "Café", + "description": "Kaffee", + "price": 1.59, + "categoryId": 6 + } + ] +} \ No newline at end of file diff --git a/Beispieldateien/Fonts/FaSolid.cs b/Beispieldateien/Fonts/FaSolid.cs new file mode 100644 index 0000000..0abcd8d --- /dev/null +++ b/Beispieldateien/Fonts/FaSolid.cs @@ -0,0 +1,19 @@ +namespace ElVegetarianoFurio.Fonts +{ + // Generated by IconFont2Code: https://andreinitescu.github.io/IconFont2Code + // If you change the class to 'public' in order to use it outside its assembly + // you should also change the fields from 'const' to 'public static readonly' + static class FaSolid + { + public const string Home = "\uf015"; + public const string Utensils = "\uf2e7"; + public const string Carrot = "\uf787"; + public const string UtensilSpoon = "\uf2e5"; + public const string PepperHot = "\uf816"; + public const string IceCream = "\uf810"; + public const string GlassCheers = "\uf79f"; + public const string UserCircle = "\uf2bd"; + public const string MapMarkedAlt = "\uf5a0"; + public const string Phone = "\uf095"; + } +} \ No newline at end of file diff --git a/Beispieldateien/Fonts/Font Awesome 5 Free-Solid-900.otf b/Beispieldateien/Fonts/Font Awesome 5 Free-Solid-900.otf new file mode 100644 index 0000000..8fb28d5 Binary files /dev/null and b/Beispieldateien/Fonts/Font Awesome 5 Free-Solid-900.otf differ diff --git a/Beispieldateien/Fonts/License Font Awesome.txt b/Beispieldateien/Fonts/License Font Awesome.txt new file mode 100644 index 0000000..f31bef9 --- /dev/null +++ b/Beispieldateien/Fonts/License Font Awesome.txt @@ -0,0 +1,34 @@ +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** diff --git a/Beispieldateien/Fonts/License Shadows.txt b/Beispieldateien/Fonts/License Shadows.txt new file mode 100644 index 0000000..06117d9 --- /dev/null +++ b/Beispieldateien/Fonts/License Shadows.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010, Kimberly Geswein (kimberlygeswein.com) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/Beispieldateien/Fonts/License Sofia.txt b/Beispieldateien/Fonts/License Sofia.txt new file mode 100644 index 0000000..4270e3e --- /dev/null +++ b/Beispieldateien/Fonts/License Sofia.txt @@ -0,0 +1,94 @@ +Copyright (c) 2011 by LatinoType Limitada (luciano@latinotype.com), +with Reserved Font Names "Sofia" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/Beispieldateien/Fonts/ShadowsIntoLight-Regular.ttf b/Beispieldateien/Fonts/ShadowsIntoLight-Regular.ttf new file mode 100644 index 0000000..b7bc796 Binary files /dev/null and b/Beispieldateien/Fonts/ShadowsIntoLight-Regular.ttf differ diff --git a/Beispieldateien/Fonts/Sofia-Regular.ttf b/Beispieldateien/Fonts/Sofia-Regular.ttf new file mode 100644 index 0000000..aaee088 Binary files /dev/null and b/Beispieldateien/Fonts/Sofia-Regular.ttf differ diff --git a/Beispieldateien/Images/Categories/category1.jpg b/Beispieldateien/Images/Categories/category1.jpg new file mode 100644 index 0000000..5287632 Binary files /dev/null and b/Beispieldateien/Images/Categories/category1.jpg differ diff --git a/Beispieldateien/Images/Categories/category2.jpg b/Beispieldateien/Images/Categories/category2.jpg new file mode 100644 index 0000000..d2e1756 Binary files /dev/null and b/Beispieldateien/Images/Categories/category2.jpg differ diff --git a/Beispieldateien/Images/Categories/category3.jpg b/Beispieldateien/Images/Categories/category3.jpg new file mode 100644 index 0000000..ad87a41 Binary files /dev/null and b/Beispieldateien/Images/Categories/category3.jpg differ diff --git a/Beispieldateien/Images/Categories/category4.jpg b/Beispieldateien/Images/Categories/category4.jpg new file mode 100644 index 0000000..4daa8f9 Binary files /dev/null and b/Beispieldateien/Images/Categories/category4.jpg differ diff --git a/Beispieldateien/Images/Categories/category5.jpg b/Beispieldateien/Images/Categories/category5.jpg new file mode 100644 index 0000000..cc079b2 Binary files /dev/null and b/Beispieldateien/Images/Categories/category5.jpg differ diff --git a/Beispieldateien/Images/Categories/category6.jpg b/Beispieldateien/Images/Categories/category6.jpg new file mode 100644 index 0000000..c6c5c3b Binary files /dev/null and b/Beispieldateien/Images/Categories/category6.jpg differ diff --git a/Beispieldateien/Images/Categories/credits.txt b/Beispieldateien/Images/Categories/credits.txt new file mode 100644 index 0000000..11003bc --- /dev/null +++ b/Beispieldateien/Images/Categories/credits.txt @@ -0,0 +1,23 @@ +category1.jpg +https://unsplash.com/photos/IGfIGP5ONV0 +Unsplash / Anna Pelzer + +category2.jpg +https://unsplash.com/photos/OMcrCX6wDpU +Unsplash / Jade Aucamp + +category3.jpg +https://pixabay.com/de/photos/creme-k%C3%A4se-tomate-sousse-chips-1503526/ +Pixybay / hamomdomingues + +category4.jpg +https://www.pexels.com/photo/blur-bowl-close-up-cook-461326/ +Pexels / Pixabay + +category5.jpg +https://pixabay.com/de/photos/eisbecher-speiseeis-eiscreme-2194070/ +Pixybay / silviarita + +category6.jpg +https://mavl.io/photo/7331/summer-drink +Mavl / picjumbo.com \ No newline at end of file diff --git a/Beispieldateien/Images/Categories/license.md b/Beispieldateien/Images/Categories/license.md new file mode 100644 index 0000000..1831ed6 --- /dev/null +++ b/Beispieldateien/Images/Categories/license.md @@ -0,0 +1,45 @@ +All pictures are taken from the following sources: + +- Mavl +- Pexels +- Pixabay +- Unsplash + +The licenses of those plattforms are: + +## Mavl +https://mavl.io/license +Creative Commons Zero enables artists, photographers, authors, scientists, educators, and other creators and owners of copyright- or database-protected content to waive those interests in their works and thereby place them as completely as possible in the public domain, so that others may freely build upon, enhance and reuse the works for any purposes without restriction under copyright or database law. + +In contrast to CC’s licenses that allow copyright holders to choose from a range of permissions while retaining their copyright, CC0 empowers yet another choice altogether – the choice to opt out of copyright and database protection, and the exclusive rights automatically granted to creators – the “no rights reserved” alternative to our licenses. + +## Pexels +https://www.pexels.com/photo-license/ + +- All photos on Pexels are free to use. +- Attribution is not required. Giving credit to the photographer or Pexels is not necessary but always appreciated. +- You can modify the photos. Be creative and edit the photos as you like. +entifiable people may not appear in a bad light or in a way that is offensive. +- Don't sell unaltered copies of a photo, e.g. don't sell it as a stock photo, poster, print or on a physical product without adding any value. +- Don't imply endorsement of your product by people or brands on the image. +- Don't redistribute or sell the photos on other stock photo or wallpaper platforms. + +## Pixabay +https://pixabay.com/de/service/terms/#license +Bilder und Videos auf Pixabay werden unter der Pixabay Lizenz mit den folgenden Bedingungen zur Verfügung gestellt. Durch die Pixabay Lizenz erhältst Du ein unwiderrufliches, weltweites, nicht exklusives und gebührenfreies Recht, die Bilder und Videos für kommerzielle und nicht kommerzielle Zwecke zu verwenden, herunterzuladen, zu kopieren und zu verändern. Eine Nennung des Bildautors bzw. von Pixabay ist nicht erforderlich, wir wissen jedoch eine freiwillige Quellenangabe zu schätzen. + +Die Pixabay-Lizenz gestattet nicht: + + den Verkauf oder Vertrieb von Bildern oder Videos in digitaler Form, insbesondere als Stockfotos oder digitale Wallpaper; + den Verkauf oder Vertrieb von Bildern oder Videos z.B. als Poster, Digitaldrucke oder physische Produkte, ohne zusätzliche Elemente hinzuzufügen oder anderweitig einen Mehrwert zu schaffen; + die Darstellung von identifizierbaren Personen auf beleidigende, pornografische, obszöne, unmoralische, diffamierende oder verleumderische Weise; oder + die Suggestion, dass abgebildete Personen, Marken, Organisationen, etc. bestimmte Produkte oder Dienstleistungen befürworten oder billigen, es sei denn es wurde eine Genehmigung dazu erteilt. + +Beachte bitte, dass alle Inhalte auf Pixabay zwar für kommerzielle und nicht-kommerzielle Zwecke frei verwendbar sind, gezeigte Elemente in den Bildern und Videos, wie identifizierbare Personen, Logos und Marken, jedoch zusätzlichen Urheberrechten, Eigentumsrechten, Personenrechten, Markenrechten usw. unterliegen können. Die Zustimmung eines Dritten oder die Lizenz dieser Rechte können insbesondere für kommerzielle Anwendungen erforderlich sein. Pixabay garantiert nicht, dass solche Zustimmungen oder Lizenzen eingeholt wurden, und lehnt ausdrücklich jegliche Haftung in dieser Hinsicht ab. + +## Unsplash +https://unsplash.com/license +All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible. + +More precisely, Unsplash grants you an irrevocable, nonexclusive, worldwide copyright license to download, copy, modify, distribute, perform, and use photos from Unsplash for free, including for commercial purposes, without permission from or attributing the photographer or Unsplash. This license does not include the right to compile photos from Unsplash to replicate a similar or competing service. + diff --git a/Beispieldateien/Images/Dishes/credits.txt b/Beispieldateien/Images/Dishes/credits.txt new file mode 100644 index 0000000..68521e7 --- /dev/null +++ b/Beispieldateien/Images/Dishes/credits.txt @@ -0,0 +1,87 @@ +dish1.jpg +https://unsplash.com/photos/MlPD-AzZYMg +Unsplash / Louis Hansel + +dish2.jpg +https://unsplash.com/photos/AiHJiRCwB3w +Unsplash / Yoav Aziz + +dish3.jpg +https://www.pexels.com/photo/appetizer-bowl-bread-breakfast-539451/ +Pexels / Foodie Factor + +dish4.jpg +https://pixabay.com/de/photos/erbsensuppe-suppe-vorspeise-2786133/ +Pixabay / Ritae + +dish5.jpg +https://pxhere.com/en/photo/758610 +pxhere + +dish6.jpg +https://unsplash.com/photos/vzIgmhbEN9w +Unsplash / Nacho Carretero Molero + +dish7.jpg +https://pxhere.com/de/photo/459409 +pxhere + +dish8.jpg +https://pxhere.com/es/photo/607309 +pxhere + +dish9.jpg +https://pxhere.com/es/photo/529102 +pxhere + +dish10.jpg +https://www.rawpixel.com/image/448047/free-photo-image-dip-mexican-cuisine-appetite +rawpixel / Jakub Kapusnak + +dish11.jpg +https://pixabay.com/de/photos/tjena-k%C3%BCche-chili-con-carne-reis-3175645/ +pixabay / TJENA + +dish12.jpg +https://unsplash.com/photos/xsfX3AqLDKo +Unsplash / Alexandra Golovac + +dish13.jpg +https://pixabay.com/de/photos/burrito-tortilla-lebensmittel-4126116/ +pixabay / nevena1313 + +dish14.jpg +https://pixnio.com/food-and-drink/rice-food-dinner-lunch-dish-meal-vegetable-meat-delicious +pixnio + +dish15.jpg +https://pixabay.com/de/photos/empanadas-empanaditas-partei-macht-3410288/ +pixybay / Emersontc + +dish16.jpg +https://pxhere.com/en/photo/863645 +pxhere + + +dish17.jpg +https://pixnio.com/flora-plants/fruits/fruit-salad-diet-food-nutrition-delicious-kiwi-sweet +pixnio + +dish18.jpg +https://pixabay.com/de/photos/churros-backen-cookies-dessert-2188871/ +pixabay / Daria-Yakovleva + +dish19.jpg +https://pxhere.com/en/photo/1274085 + +dish20.jpg +https://pxhere.com/en/photo/1582781 +pxhere / rawpixel.com + +dish21.jpg +https://unsplash.com/photos/p5EiqkBYIEE +Unsplash / Francesca Hotchin + +dish22.jpg +https://pxhere.com/en/photo/655302 +pxhere \ No newline at end of file diff --git a/Beispieldateien/Images/Dishes/dish1.jpg b/Beispieldateien/Images/Dishes/dish1.jpg new file mode 100644 index 0000000..b4a8e6b Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish1.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish10.jpg b/Beispieldateien/Images/Dishes/dish10.jpg new file mode 100644 index 0000000..af6ca2f Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish10.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish11.jpg b/Beispieldateien/Images/Dishes/dish11.jpg new file mode 100644 index 0000000..be404cc Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish11.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish12.jpg b/Beispieldateien/Images/Dishes/dish12.jpg new file mode 100644 index 0000000..83e883b Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish12.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish13.jpg b/Beispieldateien/Images/Dishes/dish13.jpg new file mode 100644 index 0000000..60a51f3 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish13.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish14.jpg b/Beispieldateien/Images/Dishes/dish14.jpg new file mode 100644 index 0000000..f833169 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish14.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish15.jpg b/Beispieldateien/Images/Dishes/dish15.jpg new file mode 100644 index 0000000..a2a3be6 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish15.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish16.jpg b/Beispieldateien/Images/Dishes/dish16.jpg new file mode 100644 index 0000000..b2f1d29 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish16.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish17.jpg b/Beispieldateien/Images/Dishes/dish17.jpg new file mode 100644 index 0000000..a94addb Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish17.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish18.jpg b/Beispieldateien/Images/Dishes/dish18.jpg new file mode 100644 index 0000000..e1b4bed Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish18.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish19.jpg b/Beispieldateien/Images/Dishes/dish19.jpg new file mode 100644 index 0000000..eb5d8ab Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish19.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish2.jpg b/Beispieldateien/Images/Dishes/dish2.jpg new file mode 100644 index 0000000..0106493 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish2.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish20.jpg b/Beispieldateien/Images/Dishes/dish20.jpg new file mode 100644 index 0000000..72cbf4f Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish20.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish21.jpg b/Beispieldateien/Images/Dishes/dish21.jpg new file mode 100644 index 0000000..6cfcda0 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish21.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish22.jpg b/Beispieldateien/Images/Dishes/dish22.jpg new file mode 100644 index 0000000..5101c63 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish22.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish3.jpg b/Beispieldateien/Images/Dishes/dish3.jpg new file mode 100644 index 0000000..33ed103 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish3.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish4.jpg b/Beispieldateien/Images/Dishes/dish4.jpg new file mode 100644 index 0000000..96b9fb1 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish4.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish5.jpg b/Beispieldateien/Images/Dishes/dish5.jpg new file mode 100644 index 0000000..e1d88a6 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish5.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish6.jpg b/Beispieldateien/Images/Dishes/dish6.jpg new file mode 100644 index 0000000..fcd2757 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish6.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish7.jpg b/Beispieldateien/Images/Dishes/dish7.jpg new file mode 100644 index 0000000..9eb85e9 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish7.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish8.jpg b/Beispieldateien/Images/Dishes/dish8.jpg new file mode 100644 index 0000000..b6b9d0b Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish8.jpg differ diff --git a/Beispieldateien/Images/Dishes/dish9.jpg b/Beispieldateien/Images/Dishes/dish9.jpg new file mode 100644 index 0000000..f5f56a0 Binary files /dev/null and b/Beispieldateien/Images/Dishes/dish9.jpg differ diff --git a/Beispieldateien/Images/Dishes/license.md b/Beispieldateien/Images/Dishes/license.md new file mode 100644 index 0000000..dfa107d --- /dev/null +++ b/Beispieldateien/Images/Dishes/license.md @@ -0,0 +1,59 @@ +All pictures are taken from the following sources: + +- Pexels +- Pixabay +- Pixnio +- Pxhere +- Rawpixl +- Unsplash + +The licenses of those plattforms are: + +## Pexels +https://www.pexels.com/photo-license/ + +- All photos on Pexels are free to use. +- Attribution is not required. Giving credit to the photographer or Pexels is not necessary but always appreciated. +- You can modify the photos. Be creative and edit the photos as you like. +entifiable people may not appear in a bad light or in a way that is offensive. +- Don't sell unaltered copies of a photo, e.g. don't sell it as a stock photo, poster, print or on a physical product without adding any value. +- Don't imply endorsement of your product by people or brands on the image. +- Don't redistribute or sell the photos on other stock photo or wallpaper platforms. + +## Pixabay +https://pixabay.com/de/service/terms/#license +ilder und Videos auf Pixabay werden unter der Pixabay Lizenz mit den folgenden Bedingungen zur Verfügung gestellt. Durch die Pixabay Lizenz erhältst Du ein unwiderrufliches, weltweites, nicht exklusives und gebührenfreies Recht, die Bilder und Videos für kommerzielle und nicht kommerzielle Zwecke zu verwenden, herunterzuladen, zu kopieren und zu verändern. Eine Nennung des Bildautors bzw. von Pixabay ist nicht erforderlich, wir wissen jedoch eine freiwillige Quellenangabe zu schätzen. + +Die Pixabay-Lizenz gestattet nicht: + + den Verkauf oder Vertrieb von Bildern oder Videos in digitaler Form, insbesondere als Stockfotos oder digitale Wallpaper; + den Verkauf oder Vertrieb von Bildern oder Videos z.B. als Poster, Digitaldrucke oder physische Produkte, ohne zusätzliche Elemente hinzuzufügen oder anderweitig einen Mehrwert zu schaffen; + die Darstellung von identifizierbaren Personen auf beleidigende, pornografische, obszöne, unmoralische, diffamierende oder verleumderische Weise; oder + die Suggestion, dass abgebildete Personen, Marken, Organisationen, etc. bestimmte Produkte oder Dienstleistungen befürworten oder billigen, es sei denn es wurde eine Genehmigung dazu erteilt. + +Beachte bitte, dass alle Inhalte auf Pixabay zwar für kommerzielle und nicht-kommerzielle Zwecke frei verwendbar sind, gezeigte Elemente in den Bildern und Videos, wie identifizierbare Personen, Logos und Marken, jedoch zusätzlichen Urheberrechten, Eigentumsrechten, Personenrechten, Markenrechten usw. unterliegen können. Die Zustimmung eines Dritten oder die Lizenz dieser Rechte können insbesondere für kommerzielle Anwendungen erforderlich sein. Pixabay garantiert nicht, dass solche Zustimmungen oder Lizenzen eingeholt wurden, und lehnt ausdrücklich jegliche Haftung in dieser Hinsicht ab. + +## Pixnio +https://pixnio.com/de/ +https://pixnio.com/public-domain-definition +Hochwertige urheberrechts-freundliche Bilder, urheberrechtsfreie Bilder und Bilder ohne Beschränkung für deren Verwendung. Explizit in der Public Domain platzierte Bilder, keine Rechte vorbehalten. Public Domain Bilder können für beliebige Zwecke genutzt werden, nutzen Sie diese frei für persönliche oder kommerzielle Nutzung. + +## Pxhere +https://pxhere.com/de/license + + It's hard to understand complex licenses that is why all photos on PxHere are licensed under the Creative Commons Zero (CC0) license. This means the pictures are completely free to be used for any legal purpose. + The pictures are free for personal and even for commercial use. + You can modify, copy and distribute the photos. + All without asking for permission or setting a link to the source. So, attribution is not required. + The only restriction is that identifiable people may not appear in a bad light or in a way that they may find offensive, unless they give their consent. + The CC0 license was released by the non-profit organization Creative Commons (CC). Get more information about Creative Commons images and the license on the official license page. + +## Rawpixl +https://www.rawpixel.com/services/image-licenses + +## Unsplash +https://unsplash.com/license +All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible. + +More precisely, Unsplash grants you an irrevocable, nonexclusive, worldwide copyright license to download, copy, modify, distribute, perform, and use photos from Unsplash for free, including for commercial purposes, without permission from or attributing the photographer or Unsplash. This license does not include the right to compile photos from Unsplash to replicate a similar or competing service. + diff --git a/Beispieldateien/Images/category1.jpg b/Beispieldateien/Images/category1.jpg new file mode 100644 index 0000000..5287632 Binary files /dev/null and b/Beispieldateien/Images/category1.jpg differ diff --git a/Beispieldateien/Images/category2.jpg b/Beispieldateien/Images/category2.jpg new file mode 100644 index 0000000..d2e1756 Binary files /dev/null and b/Beispieldateien/Images/category2.jpg differ diff --git a/Beispieldateien/Images/category3.jpg b/Beispieldateien/Images/category3.jpg new file mode 100644 index 0000000..ad87a41 Binary files /dev/null and b/Beispieldateien/Images/category3.jpg differ diff --git a/Beispieldateien/Images/category4.jpg b/Beispieldateien/Images/category4.jpg new file mode 100644 index 0000000..4daa8f9 Binary files /dev/null and b/Beispieldateien/Images/category4.jpg differ diff --git a/Beispieldateien/Images/category5.jpg b/Beispieldateien/Images/category5.jpg new file mode 100644 index 0000000..cc079b2 Binary files /dev/null and b/Beispieldateien/Images/category5.jpg differ diff --git a/Beispieldateien/Images/category6.jpg b/Beispieldateien/Images/category6.jpg new file mode 100644 index 0000000..c6c5c3b Binary files /dev/null and b/Beispieldateien/Images/category6.jpg differ diff --git a/Beispieldateien/Images/credits.txt b/Beispieldateien/Images/credits.txt new file mode 100644 index 0000000..572cad7 --- /dev/null +++ b/Beispieldateien/Images/credits.txt @@ -0,0 +1,111 @@ +category1.jpg +https://unsplash.com/photos/IGfIGP5ONV0 +Unsplash / Anna Pelzer + +category2.jpg +https://unsplash.com/photos/OMcrCX6wDpU +Unsplash / Jade Aucamp + +category3.jpg +https://pixabay.com/de/photos/creme-k%C3%A4se-tomate-sousse-chips-1503526/ +Pixybay / hamomdomingues + +category4.jpg +https://www.pexels.com/photo/blur-bowl-close-up-cook-461326/ +Pexels / Pixabay + +category5.jpg +https://pixabay.com/de/photos/eisbecher-speiseeis-eiscreme-2194070/ +Pixybay / silviarita + +category6.jpg +https://mavl.io/photo/7331/summer-drink +Mavl / picjumbo.com + +dish1.jpg +https://unsplash.com/photos/MlPD-AzZYMg +Unsplash / Louis Hansel + +dish2.jpg +https://unsplash.com/photos/AiHJiRCwB3w +Unsplash / Yoav Aziz + +dish3.jpg +https://www.pexels.com/photo/appetizer-bowl-bread-breakfast-539451/ +Pexels / Foodie Factor + +dish4.jpg +https://pixabay.com/de/photos/erbsensuppe-suppe-vorspeise-2786133/ +Pixabay / Ritae + +dish5.jpg +https://pxhere.com/en/photo/758610 +pxhere + +dish6.jpg +https://unsplash.com/photos/vzIgmhbEN9w +Unsplash / Nacho Carretero Molero + +dish7.jpg +https://pxhere.com/de/photo/459409 +pxhere + +dish8.jpg +https://pxhere.com/es/photo/607309 +pxhere + +dish9.jpg +https://pxhere.com/es/photo/529102 +pxhere + +dish10.jpg +https://www.rawpixel.com/image/448047/free-photo-image-dip-mexican-cuisine-appetite +rawpixel / Jakub Kapusnak + +dish11.jpg +https://pixabay.com/de/photos/tjena-k%C3%BCche-chili-con-carne-reis-3175645/ +pixabay / TJENA + +dish12.jpg +https://unsplash.com/photos/xsfX3AqLDKo +Unsplash / Alexandra Golovac + +dish13.jpg +https://pixabay.com/de/photos/burrito-tortilla-lebensmittel-4126116/ +pixabay / nevena1313 + +dish14.jpg +https://pixnio.com/food-and-drink/rice-food-dinner-lunch-dish-meal-vegetable-meat-delicious +pixnio + +dish15.jpg +https://pixabay.com/de/photos/empanadas-empanaditas-partei-macht-3410288/ +pixybay / Emersontc + +dish16.jpg +https://pxhere.com/en/photo/863645 +pxhere + + +dish17.jpg +https://pixnio.com/flora-plants/fruits/fruit-salad-diet-food-nutrition-delicious-kiwi-sweet +pixnio + +dish18.jpg +https://pixabay.com/de/photos/churros-backen-cookies-dessert-2188871/ +pixabay / Daria-Yakovleva + +dish19.jpg +https://pxhere.com/en/photo/1274085 + +dish20.jpg +https://pxhere.com/en/photo/1582781 +pxhere / rawpixel.com + +dish21.jpg +https://unsplash.com/photos/p5EiqkBYIEE +Unsplash / Francesca Hotchin + +dish22.jpg +https://pxhere.com/en/photo/655302 +pxhere \ No newline at end of file diff --git a/Beispieldateien/Images/dish1.jpg b/Beispieldateien/Images/dish1.jpg new file mode 100644 index 0000000..b4a8e6b Binary files /dev/null and b/Beispieldateien/Images/dish1.jpg differ diff --git a/Beispieldateien/Images/dish10.jpg b/Beispieldateien/Images/dish10.jpg new file mode 100644 index 0000000..af6ca2f Binary files /dev/null and b/Beispieldateien/Images/dish10.jpg differ diff --git a/Beispieldateien/Images/dish11.jpg b/Beispieldateien/Images/dish11.jpg new file mode 100644 index 0000000..be404cc Binary files /dev/null and b/Beispieldateien/Images/dish11.jpg differ diff --git a/Beispieldateien/Images/dish12.jpg b/Beispieldateien/Images/dish12.jpg new file mode 100644 index 0000000..83e883b Binary files /dev/null and b/Beispieldateien/Images/dish12.jpg differ diff --git a/Beispieldateien/Images/dish13.jpg b/Beispieldateien/Images/dish13.jpg new file mode 100644 index 0000000..60a51f3 Binary files /dev/null and b/Beispieldateien/Images/dish13.jpg differ diff --git a/Beispieldateien/Images/dish14.jpg b/Beispieldateien/Images/dish14.jpg new file mode 100644 index 0000000..f833169 Binary files /dev/null and b/Beispieldateien/Images/dish14.jpg differ diff --git a/Beispieldateien/Images/dish15.jpg b/Beispieldateien/Images/dish15.jpg new file mode 100644 index 0000000..a2a3be6 Binary files /dev/null and b/Beispieldateien/Images/dish15.jpg differ diff --git a/Beispieldateien/Images/dish16.jpg b/Beispieldateien/Images/dish16.jpg new file mode 100644 index 0000000..b2f1d29 Binary files /dev/null and b/Beispieldateien/Images/dish16.jpg differ diff --git a/Beispieldateien/Images/dish17.jpg b/Beispieldateien/Images/dish17.jpg new file mode 100644 index 0000000..a94addb Binary files /dev/null and b/Beispieldateien/Images/dish17.jpg differ diff --git a/Beispieldateien/Images/dish18.jpg b/Beispieldateien/Images/dish18.jpg new file mode 100644 index 0000000..e1b4bed Binary files /dev/null and b/Beispieldateien/Images/dish18.jpg differ diff --git a/Beispieldateien/Images/dish19.jpg b/Beispieldateien/Images/dish19.jpg new file mode 100644 index 0000000..eb5d8ab Binary files /dev/null and b/Beispieldateien/Images/dish19.jpg differ diff --git a/Beispieldateien/Images/dish2.jpg b/Beispieldateien/Images/dish2.jpg new file mode 100644 index 0000000..0106493 Binary files /dev/null and b/Beispieldateien/Images/dish2.jpg differ diff --git a/Beispieldateien/Images/dish20.jpg b/Beispieldateien/Images/dish20.jpg new file mode 100644 index 0000000..72cbf4f Binary files /dev/null and b/Beispieldateien/Images/dish20.jpg differ diff --git a/Beispieldateien/Images/dish21.jpg b/Beispieldateien/Images/dish21.jpg new file mode 100644 index 0000000..6cfcda0 Binary files /dev/null and b/Beispieldateien/Images/dish21.jpg differ diff --git a/Beispieldateien/Images/dish22.jpg b/Beispieldateien/Images/dish22.jpg new file mode 100644 index 0000000..5101c63 Binary files /dev/null and b/Beispieldateien/Images/dish22.jpg differ diff --git a/Beispieldateien/Images/dish3.jpg b/Beispieldateien/Images/dish3.jpg new file mode 100644 index 0000000..33ed103 Binary files /dev/null and b/Beispieldateien/Images/dish3.jpg differ diff --git a/Beispieldateien/Images/dish4.jpg b/Beispieldateien/Images/dish4.jpg new file mode 100644 index 0000000..96b9fb1 Binary files /dev/null and b/Beispieldateien/Images/dish4.jpg differ diff --git a/Beispieldateien/Images/dish5.jpg b/Beispieldateien/Images/dish5.jpg new file mode 100644 index 0000000..e1d88a6 Binary files /dev/null and b/Beispieldateien/Images/dish5.jpg differ diff --git a/Beispieldateien/Images/dish6.jpg b/Beispieldateien/Images/dish6.jpg new file mode 100644 index 0000000..fcd2757 Binary files /dev/null and b/Beispieldateien/Images/dish6.jpg differ diff --git a/Beispieldateien/Images/dish7.jpg b/Beispieldateien/Images/dish7.jpg new file mode 100644 index 0000000..9eb85e9 Binary files /dev/null and b/Beispieldateien/Images/dish7.jpg differ diff --git a/Beispieldateien/Images/dish8.jpg b/Beispieldateien/Images/dish8.jpg new file mode 100644 index 0000000..b6b9d0b Binary files /dev/null and b/Beispieldateien/Images/dish8.jpg differ diff --git a/Beispieldateien/Images/dish9.jpg b/Beispieldateien/Images/dish9.jpg new file mode 100644 index 0000000..f5f56a0 Binary files /dev/null and b/Beispieldateien/Images/dish9.jpg differ diff --git a/Beispieldateien/Images/license.md b/Beispieldateien/Images/license.md new file mode 100644 index 0000000..dfa107d --- /dev/null +++ b/Beispieldateien/Images/license.md @@ -0,0 +1,59 @@ +All pictures are taken from the following sources: + +- Pexels +- Pixabay +- Pixnio +- Pxhere +- Rawpixl +- Unsplash + +The licenses of those plattforms are: + +## Pexels +https://www.pexels.com/photo-license/ + +- All photos on Pexels are free to use. +- Attribution is not required. Giving credit to the photographer or Pexels is not necessary but always appreciated. +- You can modify the photos. Be creative and edit the photos as you like. +entifiable people may not appear in a bad light or in a way that is offensive. +- Don't sell unaltered copies of a photo, e.g. don't sell it as a stock photo, poster, print or on a physical product without adding any value. +- Don't imply endorsement of your product by people or brands on the image. +- Don't redistribute or sell the photos on other stock photo or wallpaper platforms. + +## Pixabay +https://pixabay.com/de/service/terms/#license +ilder und Videos auf Pixabay werden unter der Pixabay Lizenz mit den folgenden Bedingungen zur Verfügung gestellt. Durch die Pixabay Lizenz erhältst Du ein unwiderrufliches, weltweites, nicht exklusives und gebührenfreies Recht, die Bilder und Videos für kommerzielle und nicht kommerzielle Zwecke zu verwenden, herunterzuladen, zu kopieren und zu verändern. Eine Nennung des Bildautors bzw. von Pixabay ist nicht erforderlich, wir wissen jedoch eine freiwillige Quellenangabe zu schätzen. + +Die Pixabay-Lizenz gestattet nicht: + + den Verkauf oder Vertrieb von Bildern oder Videos in digitaler Form, insbesondere als Stockfotos oder digitale Wallpaper; + den Verkauf oder Vertrieb von Bildern oder Videos z.B. als Poster, Digitaldrucke oder physische Produkte, ohne zusätzliche Elemente hinzuzufügen oder anderweitig einen Mehrwert zu schaffen; + die Darstellung von identifizierbaren Personen auf beleidigende, pornografische, obszöne, unmoralische, diffamierende oder verleumderische Weise; oder + die Suggestion, dass abgebildete Personen, Marken, Organisationen, etc. bestimmte Produkte oder Dienstleistungen befürworten oder billigen, es sei denn es wurde eine Genehmigung dazu erteilt. + +Beachte bitte, dass alle Inhalte auf Pixabay zwar für kommerzielle und nicht-kommerzielle Zwecke frei verwendbar sind, gezeigte Elemente in den Bildern und Videos, wie identifizierbare Personen, Logos und Marken, jedoch zusätzlichen Urheberrechten, Eigentumsrechten, Personenrechten, Markenrechten usw. unterliegen können. Die Zustimmung eines Dritten oder die Lizenz dieser Rechte können insbesondere für kommerzielle Anwendungen erforderlich sein. Pixabay garantiert nicht, dass solche Zustimmungen oder Lizenzen eingeholt wurden, und lehnt ausdrücklich jegliche Haftung in dieser Hinsicht ab. + +## Pixnio +https://pixnio.com/de/ +https://pixnio.com/public-domain-definition +Hochwertige urheberrechts-freundliche Bilder, urheberrechtsfreie Bilder und Bilder ohne Beschränkung für deren Verwendung. Explizit in der Public Domain platzierte Bilder, keine Rechte vorbehalten. Public Domain Bilder können für beliebige Zwecke genutzt werden, nutzen Sie diese frei für persönliche oder kommerzielle Nutzung. + +## Pxhere +https://pxhere.com/de/license + + It's hard to understand complex licenses that is why all photos on PxHere are licensed under the Creative Commons Zero (CC0) license. This means the pictures are completely free to be used for any legal purpose. + The pictures are free for personal and even for commercial use. + You can modify, copy and distribute the photos. + All without asking for permission or setting a link to the source. So, attribution is not required. + The only restriction is that identifiable people may not appear in a bad light or in a way that they may find offensive, unless they give their consent. + The CC0 license was released by the non-profit organization Creative Commons (CC). Get more information about Creative Commons images and the license on the official license page. + +## Rawpixl +https://www.rawpixel.com/services/image-licenses + +## Unsplash +https://unsplash.com/license +All photos published on Unsplash can be used for free. You can use them for commercial and noncommercial purposes. You do not need to ask permission from or provide credit to the photographer or Unsplash, although it is appreciated when possible. + +More precisely, Unsplash grants you an irrevocable, nonexclusive, worldwide copyright license to download, copy, modify, distribute, perform, and use photos from Unsplash for free, including for commercial purposes, without permission from or attributing the photographer or Unsplash. This license does not include the right to compile photos from Unsplash to replicate a similar or competing service. + diff --git a/Kap02/Restschuldrechner/Restschuldrechner.sln b/Kap02/Restschuldrechner/Restschuldrechner.sln new file mode 100644 index 0000000..b3abaa3 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Restschuldrechner", "Restschuldrechner\Restschuldrechner.csproj", "{915BC78D-E944-48A9-9D9F-82E6D520D5DF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Release|Any CPU.Build.0 = Release|Any CPU + {915BC78D-E944-48A9-9D9F-82E6D520D5DF}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/Kap02/Restschuldrechner/Restschuldrechner/App.xaml b/Kap02/Restschuldrechner/Restschuldrechner/App.xaml new file mode 100644 index 0000000..f14aba4 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/App.xaml.cs b/Kap02/Restschuldrechner/Restschuldrechner/App.xaml.cs new file mode 100644 index 0000000..4a6a672 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/App.xaml.cs @@ -0,0 +1,11 @@ +namespace Restschuldrechner; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml b/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml new file mode 100644 index 0000000..f11feab --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml.cs b/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml.cs new file mode 100644 index 0000000..160147d --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace Restschuldrechner; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/DoubleConverter.cs b/Kap02/Restschuldrechner/Restschuldrechner/DoubleConverter.cs new file mode 100644 index 0000000..9bab4df --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/DoubleConverter.cs @@ -0,0 +1,27 @@ + +namespace Restschuldrechner +{ + public class DoubleConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (value is double) + { + return value.ToString(); + } + + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) + { + if (double.TryParse(value as string, out double dbl)) + { + return dbl; + } + + return value; + } + + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml b/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml new file mode 100644 index 0000000..4230c34 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml.cs b/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml.cs new file mode 100644 index 0000000..5013f87 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/MainPage.xaml.cs @@ -0,0 +1,45 @@ +namespace Restschuldrechner; + +public partial class MainPage : ContentPage +{ + public MainPage() + { + InitializeComponent(); + this.BindingContext = new RestschuldViewModel(); + } + + private double _width; + private double _height; + protected override void OnSizeAllocated(double width, double height) + { + base.OnSizeAllocated(width, height); + if (width != _width || height != _height) // Prüfen, ob sich die Größe geändert hat + { + _width = width; + _height = height; + + if (width > height) // Breite > Höhe = Querformat + { + OuterLayout.Orientation = StackOrientation.Horizontal; + + // Breite der Kindelemente proportional anpassen + foreach (View view in OuterLayout.Children) + { + view.WidthRequest = width / OuterLayout.Children.Count; + } + } + else + { + OuterLayout.Orientation = StackOrientation.Vertical; + + // Im Hochformat haben die Kindelemente die gleiche Breite wie das OuterLayout + foreach (View view in OuterLayout.Children) + { + view.WidthRequest = OuterLayout.Width; + } + } + } + } + +} + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/MauiProgram.cs b/Kap02/Restschuldrechner/Restschuldrechner/MauiProgram.cs new file mode 100644 index 0000000..3ca49bc --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/MauiProgram.cs @@ -0,0 +1,18 @@ +namespace Restschuldrechner; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + + return builder.Build(); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/AndroidManifest.xml b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..e9937ad --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainActivity.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..e3ff80d --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace Restschuldrechner; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainApplication.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..da876bf --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace Restschuldrechner; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/Resources/values/colors.xml b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/AppDelegate.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..f10202b --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace Restschuldrechner; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Info.plist b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..c96dd0a --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,30 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Program.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..3b600c3 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace Restschuldrechner; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/Main.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..a12a4a0 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/Main.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace Restschuldrechner; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/tizen-manifest.xml b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..bcfb01c --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + appicon.xhigh.png + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml new file mode 100644 index 0000000..9b6f9fa --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..2b20cf0 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/App.xaml.cs @@ -0,0 +1,24 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace Restschuldrechner.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/Package.appxmanifest b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..2bcb11e --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,43 @@ + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/app.manifest b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/app.manifest new file mode 100644 index 0000000..c60f0f0 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/AppDelegate.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..f10202b --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace Restschuldrechner; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Info.plist b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Info.plist new file mode 100644 index 0000000..0004a4f --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Program.cs b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Program.cs new file mode 100644 index 0000000..3b600c3 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace Restschuldrechner; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Properties/launchSettings.json b/Kap02/Restschuldrechner/Restschuldrechner/Properties/launchSettings.json new file mode 100644 index 0000000..edf8aad --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appicon.svg b/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..9d63b65 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appiconfg.svg b/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Regular.ttf b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..2c94413 Binary files /dev/null and b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Semibold.ttf b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..3c54fa7 Binary files /dev/null and b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Images/dotnet_bot.svg b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Images/dotnet_bot.svg new file mode 100644 index 0000000..abfaff2 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Images/dotnet_bot.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Raw/AboutAssets.txt b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..15d6244 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Splash/splash.svg b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Splash/splash.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Colors.xaml b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..245758b --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Colors.xaml @@ -0,0 +1,44 @@ + + + + + #512BD4 + #DFD8F7 + #2B0B98 + White + Black + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + #F7B548 + #FFD590 + #FFE5B9 + #28C2D1 + #7BDDEF + #C3F2F4 + #3E8EED + #72ACF1 + #A7CBF6 + + \ No newline at end of file diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Styles.xaml b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..3b0fdc4 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Resources/Styles/Styles.xaml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap02/Restschuldrechner/Restschuldrechner/RestschuldViewModel.cs b/Kap02/Restschuldrechner/Restschuldrechner/RestschuldViewModel.cs new file mode 100644 index 0000000..3cc17c8 --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/RestschuldViewModel.cs @@ -0,0 +1,188 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace Restschuldrechner; + +public class RestschuldViewModel : INotifyPropertyChanged +{ + public event PropertyChangedEventHandler PropertyChanged; + + private double _kreditSumme = 150000; + private double _tilgungsSatz = 1.5f; + private int _zinsbindung = 15; + private double _zinsfuss = 1.5f; + + private double _zahlungen; + private double _rsk; + private double _tilgung; + private double _zinszahlungen; + private double _anteilRestschuld; + + + /// + /// Kreditsumme (S) + /// + public double KreditSumme + { + get => _kreditSumme; + set + { + if (_kreditSumme == value) { return; } + _kreditSumme = value; + OnPropertyChanged(); + Calculate(); + } + } + + /// + /// Zinsfuß (p) + /// + public double Zinsfuss + { + get => _zinsfuss; + set + { + if (_zinsfuss == value) { return; } + _zinsfuss = value; + OnPropertyChanged(); + Calculate(); + } + } + + + /// + /// Tilgungsssatz (t) + /// + public double TilgungsSatz + { + get => _tilgungsSatz; + set + { + if (_tilgungsSatz == value) { return; } + _tilgungsSatz = value; + OnPropertyChanged(); + Calculate(); + } + } + + /// + /// Zinsbindung in Jahren (k) + /// + public int Zinsbindung + { + get => _zinsbindung; + set + { + if (_zinsbindung == value) { return; } + _zinsbindung = value; + OnPropertyChanged(); + Calculate(); + } + } + + /// + /// Anteil der Restschuld an der Gesamtschuld + /// + public double AnteilRestschuld + { + get => _anteilRestschuld; + set + { + _anteilRestschuld = Math.Max(0, value); + OnPropertyChanged(); + } + } + + /// + /// Summe der Zinszahlungen während der Zinsbindung + /// + public double Zinszahlungen + { + get => _zinszahlungen; + set + { + _zinszahlungen = value; + OnPropertyChanged(); + } + } + + /// + /// Höhe der Tilgung während der Zinsbindung + /// + public double Tilgung + { + get => _tilgung; + set + { + _tilgung = value; + OnPropertyChanged(); + } + } + + /// + /// Restschuld am Ende der Laufzeit + /// + public double Restschuld + { + get => _rsk; + set + { + _rsk = value; + OnPropertyChanged(); + } + } + + /// + /// Gesamtzahlungen während der Laufzeit + /// + public double Zahlungen + { + get => _zahlungen; + set + { + _zahlungen = value; + OnPropertyChanged(); + } + } + + + private void Calculate() + { + // Zinssatz pro Jahr (i) + var i = Zinsfuss / 100; + + // Zinssatz pro Monat (im) + var im = i / 12; + + // Zinsfaktor pro Monat (qm) + var qm = im + 1; + + // Zinsbindung in Monaten + var km = Zinsbindung * 12; + + // jährliche Annuität (A) + var annuitaet = KreditSumme * (i + TilgungsSatz / 100); + + // monatliche Annuität (a) + var a = annuitaet / 12; + + // Gesamtzahlungen während der Laufzeit + Zahlungen = annuitaet * Zinsbindung; + + // Restschuld am Ende der Laufzeit / Jahr k (RSk) + Restschuld = KreditSumme - (Math.Pow(qm, km) - 1) / im * (a - im * KreditSumme); + + // Tilgung + Tilgung = KreditSumme - Restschuld; + Zinszahlungen = Zahlungen - Tilgung; + + AnteilRestschuld = 250d / KreditSumme * Restschuld; + + } + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + +} diff --git a/Kap02/Restschuldrechner/Restschuldrechner/Restschuldrechner.csproj b/Kap02/Restschuldrechner/Restschuldrechner/Restschuldrechner.csproj new file mode 100644 index 0000000..f1a4ede --- /dev/null +++ b/Kap02/Restschuldrechner/Restschuldrechner/Restschuldrechner.csproj @@ -0,0 +1,51 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + Restschuldrechner + true + true + enable + + + Restschuldrechner + + + com.companyname.restschuldrechner + 23CDEF64-C3C8-42D4-A4AB-0C91B5D26476 + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap03/AndroidApp1/AndroidApp1.sln b/Kap03/AndroidApp1/AndroidApp1.sln new file mode 100644 index 0000000..89d4f88 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32611.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidApp1", "AndroidApp1\AndroidApp1.csproj", "{71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Release|Any CPU.Build.0 = Release|Any CPU + {71E88FF6-72FF-431A-9CB4-7C35DA47B0FF}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {335F2F91-15C8-4642-8183-8220B323E9D6} + EndGlobalSection +EndGlobal diff --git a/Kap03/AndroidApp1/AndroidApp1/AndroidApp1.csproj b/Kap03/AndroidApp1/AndroidApp1/AndroidApp1.csproj new file mode 100644 index 0000000..9461092 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/AndroidApp1.csproj @@ -0,0 +1,15 @@ + + + net6.0-android + 21 + Exe + enable + enable + com.companyname.AndroidApp1 + 1 + 1.0 + + + + + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/AndroidManifest.xml b/Kap03/AndroidApp1/AndroidApp1/AndroidManifest.xml new file mode 100644 index 0000000..1811bb4 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Assets/readme.txt b/Kap03/AndroidApp1/AndroidApp1/Assets/readme.txt new file mode 100644 index 0000000..6de3577 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Assets/readme.txt @@ -0,0 +1 @@ +Demo Asset \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/MainActivity.cs b/Kap03/AndroidApp1/AndroidApp1/MainActivity.cs new file mode 100644 index 0000000..34b8563 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/MainActivity.cs @@ -0,0 +1,13 @@ +namespace AndroidApp1 +{ + [Activity(Label = "@string/app_name", MainLauncher = true)] + public class MainActivity : Activity + { + protected override void OnCreate(Bundle? savedInstanceState) + { + base.OnCreate(savedInstanceState); + // Set our view from the "main" layout resource + SetContentView(Resource.Layout.activity_main); + } + } +} \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/AboutResources.txt b/Kap03/AndroidApp1/AndroidApp1/Resources/AboutResources.txt new file mode 100644 index 0000000..219f425 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +Images, layout descriptions, binary blobs and string dictionaries can be included +in your application as resource files. Various Android APIs are designed to +operate on the resource IDs instead of dealing with images, strings or binary blobs +directly. + +For example, a sample Android app that contains a user interface layout (main.xml), +an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) +would keep its resources in the "Resources" directory of the application: + +Resources/ + drawable/ + icon.png + + layout/ + main.xml + + values/ + strings.xml + +In order to get the build system to recognize Android resources, set the build action to +"AndroidResource". The native Android APIs do not operate directly with filenames, but +instead operate on resource IDs. When you compile an Android application that uses resources, +the build system will package the resources for distribution and generate a class called "Resource" +(this is an Android convention) that contains the tokens for each one of the resources +included. For example, for the above Resources layout, this is what the Resource class would expose: + +public class Resource { + public class Drawable { + public const int icon = 0x123; + } + + public class Layout { + public const int main = 0x456; + } + + public class Strings { + public const int first_string = 0xabc; + public const int second_string = 0xbcd; + } +} + +You would then use Resource.Drawable.icon to reference the drawable/icon.png file, or +Resource.Layout.main to reference the layout/main.xml file, or Resource.Strings.first_string +to reference the first string in the dictionary file values/strings.xml. \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/layout/activity_main.xml b/Kap03/AndroidApp1/AndroidApp1/Resources/layout/activity_main.xml new file mode 100644 index 0000000..f949852 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/layout/activity_main.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher.xml b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher_round.xml b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..036d09b --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..2531cb3 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_foreground.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..7a859c2 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_round.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..b8d35b3 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-hdpi/ic_launcher_round.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..795ea7c Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_foreground.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..a12b157 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_round.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..8f56909 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-mdpi/ic_launcher_round.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..761cc91 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_foreground.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..e7d70a5 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_round.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..9737d79 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..9133e31 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_foreground.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..73ccaa6 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_round.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..c3ae5f5 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..d4fd714 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 0000000..f6584af Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_round.png b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..ef89bd5 Binary files /dev/null and b/Kap03/AndroidApp1/AndroidApp1/Resources/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/values/ic_launcher_background.xml b/Kap03/AndroidApp1/AndroidApp1/Resources/values/ic_launcher_background.xml new file mode 100644 index 0000000..6ec24e6 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #2C3E50 + \ No newline at end of file diff --git a/Kap03/AndroidApp1/AndroidApp1/Resources/values/strings.xml b/Kap03/AndroidApp1/AndroidApp1/Resources/values/strings.xml new file mode 100644 index 0000000..17f62c7 --- /dev/null +++ b/Kap03/AndroidApp1/AndroidApp1/Resources/values/strings.xml @@ -0,0 +1,4 @@ + + AndroidApp1 + Hello, Android! + diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1.sln b/Kap04/MacCatalystApp1/MacCatalystApp1.sln new file mode 100644 index 0000000..884f5a4 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32611.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MacCatalystApp1", "MacCatalystApp1\MacCatalystApp1.csproj", "{CD9596E8-FD7B-46D4-869C-83F49CA9C168}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CD9596E8-FD7B-46D4-869C-83F49CA9C168}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD9596E8-FD7B-46D4-869C-83F49CA9C168}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD9596E8-FD7B-46D4-869C-83F49CA9C168}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD9596E8-FD7B-46D4-869C-83F49CA9C168}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5A4ADACA-8446-4165-AA85-13984B3C26FA} + EndGlobalSection +EndGlobal diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/AppDelegate.cs b/Kap04/MacCatalystApp1/MacCatalystApp1/AppDelegate.cs new file mode 100644 index 0000000..62cd855 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/AppDelegate.cs @@ -0,0 +1,34 @@ +namespace MacCatalystApp1 +{ + [Register("AppDelegate")] + public class AppDelegate : UIApplicationDelegate + { + public override UIWindow? Window + { + get; + set; + } + + public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) + { + // create a new window instance based on the screen size + Window = new UIWindow(UIScreen.MainScreen.Bounds); + + // create a UIViewController with a single UILabel + var vc = new UIViewController(); + vc.View!.AddSubview(new UILabel(Window!.Frame) + { + BackgroundColor = UIColor.SystemBackground, + TextAlignment = UITextAlignment.Center, + Text = "Hello, Catalyst!", + AutoresizingMask = UIViewAutoresizing.All, + }); + Window.RootViewController = vc; + + // make the window visible + Window.MakeKeyAndVisible(); + + return true; + } + } +} \ No newline at end of file diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Contents.json b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2242b9a --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images": [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16", + "filename": "Icon16.png" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16", + "filename": "Icon32.png" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32", + "filename": "Icon32.png" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32", + "filename": "Icon64.png" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128", + "filename": "Icon128.png" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128", + "filename": "Icon256.png" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256", + "filename": "Icon256.png" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256", + "filename": "Icon512.png" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512", + "filename": "Icon512.png" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512", + "filename": "Icon1024.png" + } + ], + "info": { + "version": 1, + "author": "xcode" + }, +} diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png new file mode 100644 index 0000000..9174c98 Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon128.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon128.png new file mode 100644 index 0000000..9c87846 Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon128.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon16.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon16.png new file mode 100644 index 0000000..35c074e Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon16.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon256.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon256.png new file mode 100644 index 0000000..7195407 Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon256.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon32.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon32.png new file mode 100644 index 0000000..a488140 Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon32.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon512.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon512.png new file mode 100644 index 0000000..640e594 Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon512.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon64.png b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon64.png new file mode 100644 index 0000000..4027b6b Binary files /dev/null and b/Kap04/MacCatalystApp1/MacCatalystApp1/Assets.xcassets/AppIcon.appiconset/Icon64.png differ diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Entitlements.plist b/Kap04/MacCatalystApp1/MacCatalystApp1/Entitlements.plist new file mode 100644 index 0000000..36a8706 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Info.plist b/Kap04/MacCatalystApp1/MacCatalystApp1/Info.plist new file mode 100644 index 0000000..f7cfc04 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDisplayName + MacCatalystApp1 + CFBundleIdentifier + com.companyname.MacCatalystApp1 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + UIDeviceFamily + + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + + \ No newline at end of file diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj b/Kap04/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj new file mode 100644 index 0000000..83ff876 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/MacCatalystApp1.csproj @@ -0,0 +1,10 @@ + + + net6.0-maccatalyst + maccatalyst-x64 + Exe + enable + true + 14.2 + + diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Main.cs b/Kap04/MacCatalystApp1/MacCatalystApp1/Main.cs new file mode 100644 index 0000000..046584b --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/Main.cs @@ -0,0 +1,6 @@ +using MacCatalystApp1; + +// This is the main entry point of the application. +// If you want to use a different Application Delegate class from "AppDelegate" +// you can specify it here. +UIApplication.Main(args, null, typeof(AppDelegate)); diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/Resources/LaunchScreen.xib b/Kap04/MacCatalystApp1/MacCatalystApp1/Resources/LaunchScreen.xib new file mode 100644 index 0000000..8190201 --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/Resources/LaunchScreen.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap04/MacCatalystApp1/MacCatalystApp1/SceneDelegate.cs b/Kap04/MacCatalystApp1/MacCatalystApp1/SceneDelegate.cs new file mode 100644 index 0000000..c725bde --- /dev/null +++ b/Kap04/MacCatalystApp1/MacCatalystApp1/SceneDelegate.cs @@ -0,0 +1,56 @@ +namespace MacCatalystApp1 +{ + [Register("SceneDelegate")] + public class SceneDelegate : UIResponder, IUIWindowSceneDelegate + { + + [Export("window")] + public UIWindow? Window { get; set; } + + [Export("scene:willConnectToSession:options:")] + public void WillConnect(UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions) + { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead). + } + + [Export("sceneDidDisconnect:")] + public void DidDisconnect(UIScene scene) + { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead). + } + + [Export("sceneDidBecomeActive:")] + public void DidBecomeActive(UIScene scene) + { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + [Export("sceneWillResignActive:")] + public void WillResignActive(UIScene scene) + { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + [Export("sceneWillEnterForeground:")] + public void WillEnterForeground(UIScene scene) + { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + [Export("sceneDidEnterBackground:")] + public void DidEnterBackground(UIScene scene) + { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + } +} \ No newline at end of file diff --git a/Kap04/iOSApp1/iOSApp1.sln b/Kap04/iOSApp1/iOSApp1.sln new file mode 100644 index 0000000..bb81fe4 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32611.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOSApp1", "iOSApp1\iOSApp1.csproj", "{B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Release|Any CPU.Build.0 = Release|Any CPU + {B59F1F59-1ACF-403D-B9D1-AD95C0D67E8D}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {08EE4998-0AD2-4E50-BEED-B0C29B0CCED8} + EndGlobalSection +EndGlobal diff --git a/Kap04/iOSApp1/iOSApp1/AppDelegate.cs b/Kap04/iOSApp1/iOSApp1/AppDelegate.cs new file mode 100644 index 0000000..b3ce3a2 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/AppDelegate.cs @@ -0,0 +1,34 @@ +namespace iOSApp1 +{ + [Register("AppDelegate")] + public class AppDelegate : UIApplicationDelegate + { + public override UIWindow? Window + { + get; + set; + } + + public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) + { + // create a new window instance based on the screen size + Window = new UIWindow(UIScreen.MainScreen.Bounds); + + // create a UIViewController with a single UILabel + var vc = new UIViewController(); + vc.View!.AddSubview(new UILabel(Window!.Frame) + { + BackgroundColor = UIColor.SystemBackground, + TextAlignment = UITextAlignment.Center, + Text = "Hello, iOS!", + AutoresizingMask = UIViewAutoresizing.All, + }); + Window.RootViewController = vc; + + // make the window visible + Window.MakeKeyAndVisible(); + + return true; + } + } +} \ No newline at end of file diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Contents.json b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..98f4d03 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,117 @@ +{ + "images": [ + { + "scale": "2x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon40.png" + }, + { + "scale": "3x", + "size": "20x20", + "idiom": "iphone", + "filename": "Icon60.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon58.png" + }, + { + "scale": "3x", + "size": "29x29", + "idiom": "iphone", + "filename": "Icon87.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon80.png" + }, + { + "scale": "3x", + "size": "40x40", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "2x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon120.png" + }, + { + "scale": "3x", + "size": "60x60", + "idiom": "iphone", + "filename": "Icon180.png" + }, + { + "scale": "1x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon20.png" + }, + { + "scale": "2x", + "size": "20x20", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "1x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon29.png" + }, + { + "scale": "2x", + "size": "29x29", + "idiom": "ipad", + "filename": "Icon58.png" + }, + { + "scale": "1x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon40.png" + }, + { + "scale": "2x", + "size": "40x40", + "idiom": "ipad", + "filename": "Icon80.png" + }, + { + "scale": "1x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon76.png" + }, + { + "scale": "2x", + "size": "76x76", + "idiom": "ipad", + "filename": "Icon152.png" + }, + { + "scale": "2x", + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "Icon167.png" + }, + { + "scale": "1x", + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "Icon1024.png" + } + ], + "properties": {}, + "info": { + "version": 1, + "author": "xcode" + } +} \ No newline at end of file diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png new file mode 100644 index 0000000..9174c98 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon1024.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon120.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon120.png new file mode 100644 index 0000000..9c60a17 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon120.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon152.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon152.png new file mode 100644 index 0000000..448d6ef Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon152.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon167.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon167.png new file mode 100644 index 0000000..8524768 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon167.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon180.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon180.png new file mode 100644 index 0000000..60a6470 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon180.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon20.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon20.png new file mode 100644 index 0000000..45268a6 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon20.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon29.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon29.png new file mode 100644 index 0000000..6a6c77a Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon29.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon40.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon40.png new file mode 100644 index 0000000..cc7edcf Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon40.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon58.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon58.png new file mode 100644 index 0000000..1ad04f0 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon58.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon60.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon60.png new file mode 100644 index 0000000..2dd5262 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon60.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon76.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon76.png new file mode 100644 index 0000000..b058cae Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon76.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon80.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon80.png new file mode 100644 index 0000000..02e47a2 Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon80.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon87.png b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon87.png new file mode 100644 index 0000000..4954a4b Binary files /dev/null and b/Kap04/iOSApp1/iOSApp1/Assets.xcassets/AppIcon.appiconset/Icon87.png differ diff --git a/Kap04/iOSApp1/iOSApp1/Entitlements.plist b/Kap04/iOSApp1/iOSApp1/Entitlements.plist new file mode 100644 index 0000000..36a8706 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/Kap04/iOSApp1/iOSApp1/Info.plist b/Kap04/iOSApp1/iOSApp1/Info.plist new file mode 100644 index 0000000..c99894c --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDisplayName + iOSApp1 + CFBundleIdentifier + com.companyname.iOSApp1 + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + + diff --git a/Kap04/iOSApp1/iOSApp1/LaunchScreen.storyboard b/Kap04/iOSApp1/iOSApp1/LaunchScreen.storyboard new file mode 100644 index 0000000..2296c6b --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/LaunchScreen.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap04/iOSApp1/iOSApp1/Main.cs b/Kap04/iOSApp1/iOSApp1/Main.cs new file mode 100644 index 0000000..24e60b7 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/Main.cs @@ -0,0 +1,6 @@ +using iOSApp1; + +// This is the main entry point of the application. +// If you want to use a different Application Delegate class from "AppDelegate" +// you can specify it here. +UIApplication.Main(args, null, typeof(AppDelegate)); diff --git a/Kap04/iOSApp1/iOSApp1/Resources/LaunchScreen.xib b/Kap04/iOSApp1/iOSApp1/Resources/LaunchScreen.xib new file mode 100644 index 0000000..8190201 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/Resources/LaunchScreen.xib @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap04/iOSApp1/iOSApp1/SceneDelegate.cs b/Kap04/iOSApp1/iOSApp1/SceneDelegate.cs new file mode 100644 index 0000000..3ecdb93 --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/SceneDelegate.cs @@ -0,0 +1,56 @@ +namespace iOSApp1 +{ + [Register("SceneDelegate")] + public class SceneDelegate : UIResponder, IUIWindowSceneDelegate + { + + [Export("window")] + public UIWindow? Window { get; set; } + + [Export("scene:willConnectToSession:options:")] + public void WillConnect(UIScene scene, UISceneSession session, UISceneConnectionOptions connectionOptions) + { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see UIApplicationDelegate `GetConfiguration` instead). + } + + [Export("sceneDidDisconnect:")] + public void DidDisconnect(UIScene scene) + { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see UIApplicationDelegate `DidDiscardSceneSessions` instead). + } + + [Export("sceneDidBecomeActive:")] + public void DidBecomeActive(UIScene scene) + { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + [Export("sceneWillResignActive:")] + public void WillResignActive(UIScene scene) + { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + [Export("sceneWillEnterForeground:")] + public void WillEnterForeground(UIScene scene) + { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + [Export("sceneDidEnterBackground:")] + public void DidEnterBackground(UIScene scene) + { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + } +} \ No newline at end of file diff --git a/Kap04/iOSApp1/iOSApp1/iOSApp1.csproj b/Kap04/iOSApp1/iOSApp1/iOSApp1.csproj new file mode 100644 index 0000000..0b5f13a --- /dev/null +++ b/Kap04/iOSApp1/iOSApp1/iOSApp1.csproj @@ -0,0 +1,22 @@ + + + net6.0-ios + Exe + enable + true + 13.0 + automatic + Apple Development: André Krämer (GM64FQT723) + VS: WildCard Development + + + Apple Development: André Krämer (GM64FQT723) + VS: WildCard Development + + + False + + + False + + diff --git a/Kap05/App1/App1.sln b/Kap05/App1/App1.sln new file mode 100644 index 0000000..8d2ed2a --- /dev/null +++ b/Kap05/App1/App1.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32611.2 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App1", "App1\App1.csproj", "{020C3E57-78A9-421E-9FD6-45CF3BF39310}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|arm64 = Debug|arm64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|arm64 = Release|arm64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|Any CPU.ActiveCfg = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|Any CPU.Build.0 = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|Any CPU.Deploy.0 = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|arm64.ActiveCfg = Debug|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|arm64.Build.0 = Debug|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|arm64.Deploy.0 = Debug|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x64.ActiveCfg = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x64.Build.0 = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x64.Deploy.0 = Debug|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x86.ActiveCfg = Debug|x86 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x86.Build.0 = Debug|x86 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Debug|x86.Deploy.0 = Debug|x86 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|Any CPU.ActiveCfg = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|Any CPU.Build.0 = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|Any CPU.Deploy.0 = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|arm64.ActiveCfg = Release|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|arm64.Build.0 = Release|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|arm64.Deploy.0 = Release|arm64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x64.ActiveCfg = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x64.Build.0 = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x64.Deploy.0 = Release|x64 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x86.ActiveCfg = Release|x86 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x86.Build.0 = Release|x86 + {020C3E57-78A9-421E-9FD6-45CF3BF39310}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {86D86C17-ED14-43E1-94F2-837CC3A76BB6} + EndGlobalSection +EndGlobal diff --git a/Kap05/App1/App1/App.xaml b/Kap05/App1/App1/App.xaml new file mode 100644 index 0000000..c9404c7 --- /dev/null +++ b/Kap05/App1/App1/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/Kap05/App1/App1/App.xaml.cs b/Kap05/App1/App1/App.xaml.cs new file mode 100644 index 0000000..d27fa24 --- /dev/null +++ b/Kap05/App1/App1/App.xaml.cs @@ -0,0 +1,51 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using Microsoft.UI.Xaml.Shapes; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace App1 +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + m_window = new MainWindow(); + m_window.Activate(); + } + + private Window m_window; + } +} diff --git a/Kap05/App1/App1/App1.csproj b/Kap05/App1/App1/App1.csproj new file mode 100644 index 0000000..bd32a3f --- /dev/null +++ b/Kap05/App1/App1/App1.csproj @@ -0,0 +1,49 @@ + + + WinExe + net6.0-windows10.0.19041.0 + 10.0.17763.0 + App1 + app.manifest + x86;x64;arm64 + win10-x86;win10-x64;win10-arm64 + win10-$(Platform).pubxml + true + true + de + + + + + + + + + + + + + + + + + + + + + + + + + + true + + diff --git a/Kap05/App1/App1/Assets/LockScreenLogo.scale-200.png b/Kap05/App1/App1/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..7440f0d Binary files /dev/null and b/Kap05/App1/App1/Assets/LockScreenLogo.scale-200.png differ diff --git a/Kap05/App1/App1/Assets/SplashScreen.scale-200.png b/Kap05/App1/App1/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..32f486a Binary files /dev/null and b/Kap05/App1/App1/Assets/SplashScreen.scale-200.png differ diff --git a/Kap05/App1/App1/Assets/Square150x150Logo.scale-200.png b/Kap05/App1/App1/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..53ee377 Binary files /dev/null and b/Kap05/App1/App1/Assets/Square150x150Logo.scale-200.png differ diff --git a/Kap05/App1/App1/Assets/Square44x44Logo.scale-200.png b/Kap05/App1/App1/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..f713bba Binary files /dev/null and b/Kap05/App1/App1/Assets/Square44x44Logo.scale-200.png differ diff --git a/Kap05/App1/App1/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Kap05/App1/App1/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..dc9f5be Binary files /dev/null and b/Kap05/App1/App1/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/Kap05/App1/App1/Assets/StoreLogo.png b/Kap05/App1/App1/Assets/StoreLogo.png new file mode 100644 index 0000000..a4586f2 Binary files /dev/null and b/Kap05/App1/App1/Assets/StoreLogo.png differ diff --git a/Kap05/App1/App1/Assets/Wide310x150Logo.scale-200.png b/Kap05/App1/App1/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..8b4a5d0 Binary files /dev/null and b/Kap05/App1/App1/Assets/Wide310x150Logo.scale-200.png differ diff --git a/Kap05/App1/App1/MainWindow.xaml b/Kap05/App1/App1/MainWindow.xaml new file mode 100644 index 0000000..78c6eab --- /dev/null +++ b/Kap05/App1/App1/MainWindow.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/Kap05/App1/App1/MainWindow.xaml.cs b/Kap05/App1/App1/MainWindow.xaml.cs new file mode 100644 index 0000000..d69ad72 --- /dev/null +++ b/Kap05/App1/App1/MainWindow.xaml.cs @@ -0,0 +1,36 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace App1 +{ + /// + /// An empty window that can be used on its own or navigated to within a Frame. + /// + public sealed partial class MainWindow : Window + { + public MainWindow() + { + this.InitializeComponent(); + } + + private void myButton_Click(object sender, RoutedEventArgs e) + { + myButton.Content = "Clicked"; + } + } +} diff --git a/Kap05/App1/App1/Package.appxmanifest b/Kap05/App1/App1/Package.appxmanifest new file mode 100644 index 0000000..2b1f49a --- /dev/null +++ b/Kap05/App1/App1/Package.appxmanifest @@ -0,0 +1,48 @@ + + + + + + + + App1 + AndréKrämer + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap05/App1/App1/Properties/launchSettings.json b/Kap05/App1/App1/Properties/launchSettings.json new file mode 100644 index 0000000..c7779fb --- /dev/null +++ b/Kap05/App1/App1/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "App1 (Package)": { + "commandName": "MsixPackage" + }, + "App1 (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/Kap05/App1/App1/app.manifest b/Kap05/App1/App1/app.manifest new file mode 100644 index 0000000..ab25dab --- /dev/null +++ b/Kap05/App1/App1/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo.sln b/Kap06/Kapitel6Demo/Kapitel6Demo.sln new file mode 100644 index 0000000..e90faf6 --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kapitel6Demo", "Kapitel6Demo\Kapitel6Demo.csproj", "{39CDDBB3-CDDA-4906-9462-B8067933FC0A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Release|Any CPU.Build.0 = Release|Any CPU + {39CDDBB3-CDDA-4906-9462-B8067933FC0A}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml b/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml new file mode 100644 index 0000000..42776b8 --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml.cs b/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml.cs new file mode 100644 index 0000000..d2bd9de --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/App.xaml.cs @@ -0,0 +1,11 @@ +namespace Kapitel6Demo; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml b/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml new file mode 100644 index 0000000..be2e422 --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml.cs b/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml.cs new file mode 100644 index 0000000..0ba2b4a --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace Kapitel6Demo; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/Kapitel6Demo.csproj b/Kap06/Kapitel6Demo/Kapitel6Demo/Kapitel6Demo.csproj new file mode 100644 index 0000000..4a0530c --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/Kapitel6Demo.csproj @@ -0,0 +1,51 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + Kapitel6Demo + true + true + enable + + + Kapitel6Demo + + + com.companyname.kapitel6demo + EB5DA37B-14C4-432E-BD1B-F5651C859CD5 + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap06/Kapitel6Demo/Kapitel6Demo/MainPage.xaml b/Kap06/Kapitel6Demo/Kapitel6Demo/MainPage.xaml new file mode 100644 index 0000000..02d9900 --- /dev/null +++ b/Kap06/Kapitel6Demo/Kapitel6Demo/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ActivityProgressbarSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/ActivityProgressbarSamplePage.xaml.cs new file mode 100644 index 0000000..5ec6ab0 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ActivityProgressbarSamplePage.xaml.cs @@ -0,0 +1,33 @@ +namespace ViewsSample.Views; + +public partial class ActivityProgressbarSamplePage : ContentPage +{ + public ActivityProgressbarSamplePage() + { + InitializeComponent(); + } + + private void ActivityOn_Clicked(object sender, EventArgs e) + { + ActivityIndicator1.IsRunning = true; + } + + private void ActivityOff_Clicked(object sender, EventArgs e) + { + ActivityIndicator1.IsRunning = false; + } + + private void Button0_Clicked(object sender, EventArgs e) + { + ProgressBar1.Progress = 0; + } + + private void Button33_Clicked(object sender, EventArgs e) + { + ProgressBar1.Progress = 0.33; + } + private void Button67_Clicked(object sender, EventArgs e) + { + ProgressBar1.Progress = 0.67; + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml new file mode 100644 index 0000000..7661bbf --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml.cs new file mode 100644 index 0000000..4da8e62 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/BorderSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class BorderSamplePage : ContentPage +{ + public BorderSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml new file mode 100644 index 0000000..387dcd9 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml.cs new file mode 100644 index 0000000..150a5df --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ButtonSamplePage.xaml.cs @@ -0,0 +1,14 @@ +namespace ViewsSample.Views; + +public partial class ButtonSamplePage : ContentPage +{ + public ButtonSamplePage() + { + InitializeComponent(); + } + + private void Button_OnClicked(object sender, EventArgs e) + { + (sender as Button).Text = "geklickt"; + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml new file mode 100644 index 0000000..54fc07b --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml.cs new file mode 100644 index 0000000..2f9284f --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/CheckBoxSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class CheckBoxSamplePage : ContentPage +{ + public CheckBoxSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml new file mode 100644 index 0000000..bfb4a4a --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml @@ -0,0 +1,16 @@ + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml.cs new file mode 100644 index 0000000..698d0d4 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/DatePickerTimePickerSamplePage.xaml.cs @@ -0,0 +1,25 @@ +using System.ComponentModel; + +namespace ViewsSample.Views; + +public partial class DatePickerTimePickerSamplePage : ContentPage +{ + public DatePickerTimePickerSamplePage() + { + InitializeComponent(); + } + + private void DatePicker_OnDateSelected(object sender, DateChangedEventArgs e) + { + ResultDateLabel.Text = e.NewDate.ToShortDateString(); + } + + private void TimePicker_Changed(object sender, PropertyChangedEventArgs e) + { + if (e.PropertyName == "Time") // prüfen, ob die Uhrzeit verändert wurde + { + var timepicker = (TimePicker)sender; + ResultTimeLabel.Text = timepicker.Time.ToString("g"); + } + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml new file mode 100644 index 0000000..1bbd935 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml @@ -0,0 +1,32 @@ + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml.cs new file mode 100644 index 0000000..df6e82a --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/LabelSamplePage.xaml.cs @@ -0,0 +1,10 @@ +namespace ViewsSample.Views; + +public partial class LabelSamplePage : ContentPage +{ + public LabelSamplePage() + { + InitializeComponent(); + MeinLabel.Text = "Hallo"; + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml new file mode 100644 index 0000000..d2ccdb9 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml.cs new file mode 100644 index 0000000..2c5291e --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/MvvmSamplePage.xaml.cs @@ -0,0 +1,12 @@ +using ViewsSample.ViewModels; + +namespace ViewsSample.Views; + +public partial class MvvmSamplePage : ContentPage +{ + public MvvmSamplePage() + { + InitializeComponent(); + BindingContext = new MvvmSampleViewModel(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml new file mode 100644 index 0000000..3f02202 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml @@ -0,0 +1,22 @@ + + + + + + + Option 1 + Option 2 + Option 3 + Option 4 + Option 5 + Option 6 + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml.cs new file mode 100644 index 0000000..185f5fd --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/PickerSamplePage.xaml.cs @@ -0,0 +1,19 @@ +namespace ViewsSample.Views; +public partial class PickerSamplePage : ContentPage +{ + public PickerSamplePage() + { + InitializeComponent(); + } + + private void Picker_OnSelectedIndexChanged(object sender, EventArgs e) + { + var picker = (Picker)sender; + var index = picker.SelectedIndex; + + if (index != -1) + { + ResultLabel.Text = picker.Items[index]; + } + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml new file mode 100644 index 0000000..1a2c9e2 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml.cs new file mode 100644 index 0000000..73e9f9f --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/RadioButtonSamplePage.xaml.cs @@ -0,0 +1,20 @@ +namespace ViewsSample.Views; +public partial class RadioButtonSamplePage : ContentPage +{ + public RadioButtonSamplePage() + { + InitializeComponent(); + } + + private void RadioButtonGroup1_OnCheckedChanged(object sender, CheckedChangedEventArgs e) + { + var value = (sender as RadioButton).Value; + Option1ResultLabel.Text = $"Sie haben {value} ausgewählt"; + } + + private void RadioButtonGroup2_OnCheckedChanged(object sender, CheckedChangedEventArgs e) + { + var value = (sender as RadioButton).Value; + Option2ResultLabel.Text = $"Sie haben {value} ausgewählt"; + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml new file mode 100644 index 0000000..1ed8645 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml.cs new file mode 100644 index 0000000..b525e76 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ShadowSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class ShadowSamplePage : ContentPage +{ + public ShadowSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml new file mode 100644 index 0000000..e063438 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml.cs new file mode 100644 index 0000000..19fd771 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/ShapesSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class ShapesSamplePage : ContentPage +{ + public ShapesSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml new file mode 100644 index 0000000..9400620 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml.cs new file mode 100644 index 0000000..c6378df --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/SwitchSamplePage.xaml.cs @@ -0,0 +1,33 @@ +namespace ViewsSample.Views; + +public partial class SwitchSamplePage : ContentPage +{ + public SwitchSamplePage() + { + InitializeComponent(); + } + + + private async void Switch_OnToggled(object sender, ToggledEventArgs e) + { + try + { + if (e.Value) + { + await Flashlight.TurnOnAsync(); + } + else + { + await Flashlight.TurnOffAsync(); + } + } + catch (FeatureNotSupportedException) + { + await DisplayAlert("Taschenlampe", $"Taschenlampe wird auf diesem Gerät nicht unterstützt. Wert: {e.Value}", "Ok"); + } + catch (PermissionException) + { + await DisplayAlert("Taschenlampe", $"Berechtigung für Taschenlampe fehlt. Wert: {e.Value}", "Ok"); + } + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml new file mode 100644 index 0000000..d26dfd2 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml.cs new file mode 100644 index 0000000..36008a5 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/TextSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class TextSamplePage : ContentPage +{ + public TextSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml b/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml new file mode 100644 index 0000000..c65f7fa --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + Demo + +

Darstellung von inline Html

+

Auch inline Html kann dargestellt werden.

+ + + ]]> +
+
+
+
+
+
+
\ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml.cs b/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml.cs new file mode 100644 index 0000000..64501c0 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/Views/WebViewSamplePage.xaml.cs @@ -0,0 +1,9 @@ +namespace ViewsSample.Views; + +public partial class WebViewSamplePage : ContentPage +{ + public WebViewSamplePage() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Kap09/ViewsSample/ViewsSample/ViewsSample.csproj b/Kap09/ViewsSample/ViewsSample/ViewsSample.csproj new file mode 100644 index 0000000..f551263 --- /dev/null +++ b/Kap09/ViewsSample/ViewsSample/ViewsSample.csproj @@ -0,0 +1,96 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + ViewsSample + true + true + enable + + + ViewsSample + + + com.companyname.viewssample + F140ED0F-A839-44F6-806F-3BD44994A864 + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio.sln b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio.sln new file mode 100644 index 0000000..e06707a --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElVegetarianoFurio", "ElVegetarianoFurio\ElVegetarianoFurio.csproj", "{7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.Build.0 = Release|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml new file mode 100644 index 0000000..51d42ae --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs new file mode 100644 index 0000000..22615be --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs @@ -0,0 +1,11 @@ +namespace ElVegetarianoFurio; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml new file mode 100644 index 0000000..ed744c5 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs new file mode 100644 index 0000000..7029710 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace ElVegetarianoFurio; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs new file mode 100644 index 0000000..03d0240 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs @@ -0,0 +1,69 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace ElVegetarianoFurio.Core; + +public abstract class BaseViewModel : INotifyPropertyChanged +{ + private bool _isBusy; + private string _title = string.Empty; + + public event PropertyChangedEventHandler PropertyChanged; + + + /// + /// IsBusy gibt an, ob gerade ein längerer Aufruf läuft. + /// Die Eigenschaft muss explizit durch den Entwickler gesetzt werden. + /// Sie kann genutzt werden, um in der View eine Ladeanimation anzuzeigen + /// + public bool IsBusy + { + get => _isBusy; + set => SetProperty(ref _isBusy, value); + } + + /// + /// Titel des ViewModels. Dient zur Anzeige der Überschrift in der View + /// + public string Title + { + get => _title; + set => SetProperty(ref _title, value); + } + + public virtual Task Initialize() + { + return Task.FromResult(default(object)); + } + + /// + /// Aktualisiert den Wert eines Felds und löst das Ereignis + /// aus, falls erforderlich. + /// + /// Datentyp des zu ändernden Felds + /// das zu ändernde Feld + /// neuer Wert + /// Name der Eigenschaft, die das Feld umschließt. + /// Methode, die Aufgerufen werden soll, falls + /// der Wert verändert wurde. + /// + protected bool SetProperty(ref T backingStore, T value, + [CallerMemberName] string propertyName = "", + Action onChanged = null) + { + if (EqualityComparer.Default.Equals(backingStore, value)) + { + return false; + } + + backingStore = value; + onChanged?.Invoke(); + OnPropertyChanged(propertyName); + return true; + } + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } +} diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs new file mode 100644 index 0000000..6632a7c --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs @@ -0,0 +1,13 @@ +namespace ElVegetarianoFurio.Core; + +public interface INavigationService +{ + Task GoToAsync(string location); + Task GoToAsync(string location, bool animate); + + Task GoToAsync(string location, Dictionary paramters); + + Task GoToAsync(string location, bool animate, Dictionary paramters); +} + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs new file mode 100644 index 0000000..b217d05 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs @@ -0,0 +1,26 @@ +namespace ElVegetarianoFurio.Core; + +public class NavigationService : INavigationService +{ + public async Task GoToAsync(string location) + { + await Shell.Current.GoToAsync(location); + } + + public async Task GoToAsync(string location, bool animate) + { + await Shell.Current.GoToAsync(location, animate); + } + + public async Task GoToAsync(string location, Dictionary paramters) + { + await Shell.Current.GoToAsync(location, paramters); + } + + public async Task GoToAsync(string location, bool animate, Dictionary paramters) + { + await Shell.Current.GoToAsync(location, animate, paramters); + } +} + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj new file mode 100644 index 0000000..3125553 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj @@ -0,0 +1,57 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + ElVegetarianoFurio + true + true + enable + + + ElVegetarianoFurio + + + com.companyname.elvegetarianofurio + FAE1F078-1007-4406-B7D9-C9E32D4CBB7F + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + + diff --git a/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml new file mode 100644 index 0000000..17c6256 --- /dev/null +++ b/Kap10/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Kap13/StylesSample/StylesSample/Views/ImplicitStylesSamplePage.xaml.cs b/Kap13/StylesSample/StylesSample/Views/ImplicitStylesSamplePage.xaml.cs new file mode 100644 index 0000000..6f0dca6 --- /dev/null +++ b/Kap13/StylesSample/StylesSample/Views/ImplicitStylesSamplePage.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Microsoft.Maui.Controls; + + +namespace StylesSample.Views +{ + + public partial class ImplicitStylesSamplePage : ContentPage + { + public ImplicitStylesSamplePage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Kap13/StylesSample/StylesSample/Views/StyleClassesSamplePage.xaml b/Kap13/StylesSample/StylesSample/Views/StyleClassesSamplePage.xaml new file mode 100644 index 0000000..44dcacb --- /dev/null +++ b/Kap13/StylesSample/StylesSample/Views/StyleClassesSamplePage.xaml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Kap14/WebserviceSample/WebserviceSample/Views/NewSpeakerPage.xaml.cs b/Kap14/WebserviceSample/WebserviceSample/Views/NewSpeakerPage.xaml.cs new file mode 100644 index 0000000..a04342a --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/Views/NewSpeakerPage.xaml.cs @@ -0,0 +1,15 @@ +using WebserviceSample.Models; +using WebserviceSample.ViewModels; + +namespace WebserviceSample.Views +{ + public partial class NewSpeakerPage : ContentPage + { + + public NewSpeakerPage(NewSpeakerViewModel viewModel) + { + InitializeComponent(); + BindingContext = viewModel; + } + } +} \ No newline at end of file diff --git a/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml new file mode 100644 index 0000000..06b7a16 --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file diff --git a/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml.cs b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml.cs new file mode 100644 index 0000000..a3195a0 --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakerDetailPage.xaml.cs @@ -0,0 +1,13 @@ +using WebserviceSample.ViewModels; + +namespace WebserviceSample.Views +{ + public partial class SpeakerDetailPage : ContentPage + { + public SpeakerDetailPage(SpeakerDetailViewModel viewModel) + { + InitializeComponent(); + BindingContext = viewModel; + } + } +} \ No newline at end of file diff --git a/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml new file mode 100644 index 0000000..886dceb --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml.cs b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml.cs new file mode 100644 index 0000000..f313616 --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/Views/SpeakersPage.xaml.cs @@ -0,0 +1,22 @@ +using WebserviceSample.ViewModels; +namespace WebserviceSample.Views +{ + public partial class SpeakersPage : ContentPage + { + readonly SpeakersViewModel _viewModel; + + public SpeakersPage(SpeakersViewModel viewModel) + { + InitializeComponent(); + + BindingContext = _viewModel = viewModel; + } + + protected override void OnNavigatedTo(NavigatedToEventArgs args) + { + _viewModel.Initialize(); + + base.OnNavigatedTo(args); + } + } +} \ No newline at end of file diff --git a/Kap14/WebserviceSample/WebserviceSample/WebserviceSample.csproj b/Kap14/WebserviceSample/WebserviceSample/WebserviceSample.csproj new file mode 100644 index 0000000..b0c43d2 --- /dev/null +++ b/Kap14/WebserviceSample/WebserviceSample/WebserviceSample.csproj @@ -0,0 +1,67 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + WebserviceSample + true + true + enable + + + WebserviceSample + + + com.companyname.webservicesample + 11A77C8E-2EB9-4E3C-AB35-0A7C8966BABD + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio.sln b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio.sln new file mode 100644 index 0000000..e06707a --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElVegetarianoFurio", "ElVegetarianoFurio\ElVegetarianoFurio.csproj", "{7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.Build.0 = Release|Any CPU + {7E9FC7EE-FEEF-4B94-8F1E-4179D817E356}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml new file mode 100644 index 0000000..6581a67 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs new file mode 100644 index 0000000..22615be --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/App.xaml.cs @@ -0,0 +1,11 @@ +namespace ElVegetarianoFurio; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml new file mode 100644 index 0000000..96e23db --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs new file mode 100644 index 0000000..a4439a1 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/AppShell.xaml.cs @@ -0,0 +1,13 @@ +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + Routing.RegisterRoute(nameof(CategoryPage), typeof(CategoryPage)); + Routing.RegisterRoute(nameof(DishPage), typeof(DishPage)); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs new file mode 100644 index 0000000..03d0240 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/BaseViewModel.cs @@ -0,0 +1,69 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace ElVegetarianoFurio.Core; + +public abstract class BaseViewModel : INotifyPropertyChanged +{ + private bool _isBusy; + private string _title = string.Empty; + + public event PropertyChangedEventHandler PropertyChanged; + + + /// + /// IsBusy gibt an, ob gerade ein längerer Aufruf läuft. + /// Die Eigenschaft muss explizit durch den Entwickler gesetzt werden. + /// Sie kann genutzt werden, um in der View eine Ladeanimation anzuzeigen + /// + public bool IsBusy + { + get => _isBusy; + set => SetProperty(ref _isBusy, value); + } + + /// + /// Titel des ViewModels. Dient zur Anzeige der Überschrift in der View + /// + public string Title + { + get => _title; + set => SetProperty(ref _title, value); + } + + public virtual Task Initialize() + { + return Task.FromResult(default(object)); + } + + /// + /// Aktualisiert den Wert eines Felds und löst das Ereignis + /// aus, falls erforderlich. + /// + /// Datentyp des zu ändernden Felds + /// das zu ändernde Feld + /// neuer Wert + /// Name der Eigenschaft, die das Feld umschließt. + /// Methode, die Aufgerufen werden soll, falls + /// der Wert verändert wurde. + /// + protected bool SetProperty(ref T backingStore, T value, + [CallerMemberName] string propertyName = "", + Action onChanged = null) + { + if (EqualityComparer.Default.Equals(backingStore, value)) + { + return false; + } + + backingStore = value; + onChanged?.Invoke(); + OnPropertyChanged(propertyName); + return true; + } + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/FaSolid.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/FaSolid.cs new file mode 100644 index 0000000..722c4c5 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/FaSolid.cs @@ -0,0 +1,19 @@ +namespace ElVegetarianoFurio.Core +{ + // Generated by IconFont2Code: https://andreinitescu.github.io/IconFont2Code + // If you change the class to 'public' in order to use it outside its assembly + // you should also change the fields from 'const' to 'public static readonly' + static class FaSolid + { + public const string Home = "\uf015"; + public const string Utensils = "\uf2e7"; + public const string Carrot = "\uf787"; + public const string UtensilSpoon = "\uf2e5"; + public const string PepperHot = "\uf816"; + public const string IceCream = "\uf810"; + public const string GlassCheers = "\uf79f"; + public const string UserCircle = "\uf2bd"; + public const string MapMarkedAlt = "\uf5a0"; + public const string Phone = "\uf095"; + } +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs new file mode 100644 index 0000000..6632a7c --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/INavigationService.cs @@ -0,0 +1,13 @@ +namespace ElVegetarianoFurio.Core; + +public interface INavigationService +{ + Task GoToAsync(string location); + Task GoToAsync(string location, bool animate); + + Task GoToAsync(string location, Dictionary paramters); + + Task GoToAsync(string location, bool animate, Dictionary paramters); +} + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs new file mode 100644 index 0000000..b217d05 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Core/NavigationService.cs @@ -0,0 +1,26 @@ +namespace ElVegetarianoFurio.Core; + +public class NavigationService : INavigationService +{ + public async Task GoToAsync(string location) + { + await Shell.Current.GoToAsync(location); + } + + public async Task GoToAsync(string location, bool animate) + { + await Shell.Current.GoToAsync(location, animate); + } + + public async Task GoToAsync(string location, Dictionary paramters) + { + await Shell.Current.GoToAsync(location, paramters); + } + + public async Task GoToAsync(string location, bool animate, Dictionary paramters) + { + await Shell.Current.GoToAsync(location, animate, paramters); + } +} + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/DummyDataService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/DummyDataService.cs new file mode 100644 index 0000000..3e87a00 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/DummyDataService.cs @@ -0,0 +1,219 @@ +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio.Data; +public class DummyDataService : IDataService +{ + private readonly List _categories; + private readonly List _dishes; + + public DummyDataService() + { + _categories + = new List + { + new Category { Id = 1, Name = "Ensaladas", Description = "Salate" }, + new Category { Id = 2, Name = "Cremas y sopas", Description = "Suppen" }, + new Category { Id = 3, Name = "Tapas", Description = "Kleine Portionen" }, + new Category { Id = 4, Name = "Platos principales", Description = "Hauptgerichte" }, + new Category { Id = 5, Name = "Postres", Description = "Desserts" }, + new Category { Id = 6, Name = "Bebidas", Description = "Getränke" } + }; + + _dishes = new List + { + new Dish + { + Id = 1, + Name = "Ensalada de Casa", + Description = "Salat nach Art des Hauses. Gemischter Salat, Mais, Paprika, Käse, Zwiebeln", + Price = 3.49m, + CategoryId = 1 + }, + new Dish + { + Id = 2, + Name = "Ensalada furia", + Description = "Gemischter Salat mit Chillis, Paprika, Radieschen und Zwiebeln (scharf!)", + Price = 3.99m, + CategoryId = 1 + }, + new Dish + { + Id = 3, + Name = "Sopa de Tomate", + Description = "Tomatensuppe", + Price = 3.29m, + CategoryId = 2 + }, + new Dish + { + Id = 4, + Name = "Crema de verduras", + Description = "Gemüsecremesuppe", + Price = 4.39m, + CategoryId = 2 + }, + new Dish + { + Id = 5, + Name = "Tortilla de patatas", + Description = "Spanisches Omlett aus Eiern und Kartoffeln", + Price = 4.99m, + CategoryId = 3 + }, + new Dish + { + Id = 6, + Name = "Patatas bravas", + Description = "Gebratene Kartoffelstücke in pikanter Sauce", + Price = 3.99m, + CategoryId = 3 + }, + new Dish + { + Id = 7, + Name = "Pimientos al grill", + Description = "Gegrillte Paprika", + Price = 2.99m, + CategoryId = 3 + }, + new Dish + { + Id = 8, + Name = "Pan con alioli", + Description = "Ailoli mit Brot", + Price = 2.29m, + CategoryId = 3 + }, + new Dish + { + Id = 9, + Name = "Pan con tomate y ajo", + Description = "Brot mit Tomate und Knoblauch", + Price = 2.29m, + CategoryId = 3 + }, + new Dish + { + Id = 10, + Name = "Tortilla Chips", + Description = "Tortilla Chips mit Salsa Dip, Guacamole oder Alioli", + Price = 1.29m, + CategoryId = 3 + }, + new Dish + { + Id = 11, + Name = "Chilli sin carne", + Description = "Vegetarisches Chilli, serviert mit Reis", + Price = 5.39m, + CategoryId = 4 + }, + new Dish + { + Id = 12, + Name = "Enchiladas de verduras", + Description = "Überbackene Maistortillas gefüllt mit Gemüse", + Price = 4.99m, + CategoryId = 4 + }, + new Dish + { + Id = 13, + Name = "Burritos de verduras", + Description = "Weizentortillas gefüllt mit Gemüse", + Price = 4.99m, + CategoryId = 4 + }, + new Dish + { + Id = 14, + Name = "Arroz con verduras", + Description = "Reis-/Gemüsepfanne", + Price = 4.49m, + CategoryId = 4 + }, + new Dish + { + Id = 15, + Name = "Empanadas de espinacas y maíz", + Description = "Teigtaschen gefüllt mit Spinat und Mais", + Price = 4.49m, + CategoryId = 4 + }, + new Dish + { + Id = 16, + Name = "Crema Catalana", + Description = "Katalanische Creme", + Price = 2.49m, + CategoryId = 5 + }, + new Dish + { + Id = 17, + Name = "Ensalada de frutas", + Description = "Obstsalat mit frischen Früchten", + Price = 2.99m, + CategoryId = 5 + }, + new Dish + { + Id = 18, + Name = "Churros", + Description = "Spritzgebäck mit Zucker", + Price = 1.99m, + CategoryId = 5 + }, + new Dish + { + Id = 19, + Name = "Agua mineral", + Description = "Mineralwasser", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 20, + Name = "Zumo de manzana", + Description = "Apfelsaft", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 21, + Name = "Limonada", + Description = "Zitronenlimonade", + Price = 1.59m, + CategoryId = 6 + }, + new Dish + { + Id = 22, + Name = "Café", + Description = "Kaffee", + Price = 1.59m, + CategoryId = 6 + } + }; + } + + public Task> GetCategoriesAsync() + { + return Task.FromResult(_categories); + } + + public Task> GetDishesAsync(int? categoryId = null) + { + return categoryId.HasValue + ? Task.FromResult(_dishes.Where(d => d.CategoryId == categoryId).ToList()) + : Task.FromResult(_dishes); + } + + public Task GetDishAsync(int id) + { + return Task.FromResult(_dishes.SingleOrDefault(d => d.Id == id)); + } +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/IDataService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/IDataService.cs new file mode 100644 index 0000000..ea070e4 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/IDataService.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio.Data; + +public interface IDataService +{ + Task> GetCategoriesAsync(); + Task> GetDishesAsync(int? categoryId = null); + Task GetDishAsync(int id); +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/WebApiDataService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/WebApiDataService.cs new file mode 100644 index 0000000..1f017e8 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Data/WebApiDataService.cs @@ -0,0 +1,72 @@ +using ElVegetarianoFurio.Menu; +using MonkeyCache.FileStore; +using System.Text.Json; + +namespace ElVegetarianoFurio.Data; + +public class WebApiDataService : IDataService +{ + private static readonly HttpClient _client = new HttpClient + { + BaseAddress = new Uri( + "https://my-json-server.typicode.com/AndreKraemer/vegi-data/") + }; + + private static JsonSerializerOptions _serializerOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + PropertyNamingPolicy = JsonNamingPolicy.CamelCase + }; + + + public Task> GetCategoriesAsync() + { + return GetCachedAsync>("categories", TimeSpan.FromDays(1)); + } + + public async Task> GetDishesAsync(int? categoryId = null) + { + var dishes = await GetCachedAsync>("dishes"); + return categoryId.HasValue ? + dishes.Where(d => d.CategoryId == categoryId.Value).ToList() : + dishes; + } + + public async Task GetDishAsync(int id) + { + return await GetCachedAsync($"dishes/{id}", TimeSpan.FromHours(1)); + } + + private async Task GetCachedAsync(string url, TimeSpan? cacheTime = null) + { + // Wenn keine Internetverbindung besteht, gecachte Daten zurückgeben, + // auch wenn diese bereits abgelaufen sind. + if (Connectivity.NetworkAccess != NetworkAccess.Internet) + { + return Barrel.Current.Get(url); + } + + // Falls Internetverbindung besteht und es nicht abgelaufene + // gecachte Daten gibt, diese zurückgeben + if (!Barrel.Current.IsExpired(url)) + { + return Barrel.Current.Get(url); + } + + // Daten vom Webservice abrufen + try + { + var json = await _client.GetStringAsync(url); + var result = JsonSerializer.Deserialize(json, _serializerOptions); + + // Daten mit einer Lebensdauer von 5 Minuten im Cache ablegen + Barrel.Current.Add(url, result, cacheTime ?? TimeSpan.FromMinutes(5)); + return result; + } + catch (HttpRequestException) + { + return default; // Im Fall einer Exception ein leeres Objekt zurückgeben + } + } + +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj new file mode 100644 index 0000000..abccb11 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/ElVegetarianoFurio.csproj @@ -0,0 +1,117 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + ElVegetarianoFurio + true + true + enable + + + ElVegetarianoFurio + + + com.companyname.elvegetarianofurio + FAE1F078-1007-4406-B7D9-C9E32D4CBB7F + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml new file mode 100644 index 0000000..42f26f4 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml @@ -0,0 +1,40 @@ + + + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml.cs new file mode 100644 index 0000000..078263d --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainPage.xaml.cs @@ -0,0 +1,19 @@ +namespace ElVegetarianoFurio; + +public partial class MainPage : ContentPage +{ + + private readonly MainViewModel _viewModel; + public MainPage(MainViewModel viewModel) + { + InitializeComponent(); + BindingContext = _viewModel = viewModel; + } + + protected override async void OnNavigatedTo(NavigatedToEventArgs args) + { + await _viewModel.Initialize(); + base.OnNavigatedTo(args); + } +} + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainViewModel.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainViewModel.cs new file mode 100644 index 0000000..8cfc143 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MainViewModel.cs @@ -0,0 +1,58 @@ +using ElVegetarianoFurio.Core; +using ElVegetarianoFurio.Data; +using System.Collections.ObjectModel; +using System.Windows.Input; +using ElVegetarianoFurio.Menu; + +namespace ElVegetarianoFurio; +public class MainViewModel : BaseViewModel +{ + private readonly IDataService _dataService; + private readonly INavigationService _navigationService; + + public ICommand LoadDataCommand { get; } + public ICommand NavigateToCategoryCommand { get; } + + public ObservableCollection Categories { get; } = + new ObservableCollection(); + + public MainViewModel(IDataService dataService, INavigationService navigationService) + { + _dataService = dataService; + _navigationService = navigationService; + LoadDataCommand = new Command(async () => await LoadData()); + NavigateToCategoryCommand = new Command(NavigateToCategory); + Title = "Start"; + } + + private async Task LoadData() + { + try + { + IsBusy = true; + Categories.Clear(); + var categories = await _dataService.GetCategoriesAsync(); + + foreach (var category in categories) + { + Categories.Add(category); + } + } + finally + { + IsBusy = false; + } + } + + private async void NavigateToCategory(Category category) + { + await _navigationService.GoToAsync($"{nameof(CategoryPage)}?CategoryId={category.Id}"); + } + + public override async Task Initialize() + { + await LoadData(); + await base.Initialize(); + } +} + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MauiProgram.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MauiProgram.cs new file mode 100644 index 0000000..6130085 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/MauiProgram.cs @@ -0,0 +1,39 @@ +using ElVegetarianoFurio.Core; +using ElVegetarianoFurio.Data; +using ElVegetarianoFurio.Menu; +using ElVegetarianoFurio.Profile; +using MonkeyCache.FileStore; + +namespace ElVegetarianoFurio; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + Barrel.ApplicationId = "ElVegetarianoFurio"; + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + fonts.AddFont("Font Awesome 5 Free-Solid-900.otf", "Fa-Solid"); + fonts.AddFont("ShadowsIntoLight-Regular.ttf", "Shadows"); + fonts.AddFont("Sofia-Regular.ttf", "Sofia"); + }); + + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + return builder.Build(); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Category.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Category.cs new file mode 100644 index 0000000..2d13767 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Category.cs @@ -0,0 +1,9 @@ +namespace ElVegetarianoFurio.Menu +{ + public class Category + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml new file mode 100644 index 0000000..b7dedd6 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml.cs new file mode 100644 index 0000000..ac2fcdc --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryPage.xaml.cs @@ -0,0 +1,56 @@ +namespace ElVegetarianoFurio.Menu; + +[QueryProperty(nameof(CategoryId), nameof(CategoryId))] +public partial class CategoryPage : ContentPage +{ + private readonly CategoryViewModel _viewModel; + + public CategoryPage(CategoryViewModel viewModel) + { + InitializeComponent(); + BindingContext = _viewModel = viewModel; + } + + public int CategoryId + { + get; + set; + } + + protected override async void OnNavigatedTo(NavigatedToEventArgs args) + { + _viewModel.CategoryId = CategoryId; + // Hack. CategoryId ist 0, wenn wir + // ber das Men der Shell zur Seite navigieren + if(CategoryId == 0) + { + _viewModel.CategoryId = GetCategoryIdFromRoute(); + } + await _viewModel.Initialize(); + base.OnNavigatedTo(args); + } + + + private int GetCategoryIdFromRoute() + { + // Hack: Die Shell kann derzeit deklarativ noch keine + // Routenparameter bei der Navigation an eine Seite + // weitergeben. Deshalb ermitteln wir hier die Route + // der aktuellen Seite und geben hart codiert die ID + // zurck. Die Lsung ist nich schn und sollte + // umgestellt werden, sobald die Shell bei der + // deklarativen Navigation Argumente bergeben kann + var route = Shell.Current.CurrentState.Location + .OriginalString.Split("/").LastOrDefault(); + return route switch + { + "ensaladas" => 1, + "sopas" => 2, + "tapas" => 3, + "principales" => 4, + "postres" => 5, + "bebidas" => 6, + _ => 0, + }; + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryViewModel.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryViewModel.cs new file mode 100644 index 0000000..736ab91 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/CategoryViewModel.cs @@ -0,0 +1,68 @@ +using ElVegetarianoFurio.Core; +using ElVegetarianoFurio.Data; +using System.Collections.ObjectModel; +using System.Windows.Input; + +namespace ElVegetarianoFurio.Menu; + +public class CategoryViewModel : BaseViewModel +{ + private readonly IDataService _dataService; + private readonly INavigationService _navigationService; + private Category _category; + private int _categoryId; + + public CategoryViewModel(IDataService dataService, + INavigationService navigationService) + { + _dataService = dataService; + _navigationService = navigationService; + LoadDataCommand = new Command(async () => await LoadDataAsync()); + NavigateToDishCommand = new Command(NavigateToDish); + } + + public ICommand LoadDataCommand { get; } + public ICommand NavigateToDishCommand { get; } + + public ObservableCollection Dishes { get; set; } + = new ObservableCollection(); + + public Category Category + { + get => _category; + set => SetProperty(ref _category, value); + } + + public int CategoryId + { + get => _categoryId; + set => SetProperty(ref _categoryId, value); + } + + private async Task LoadDataAsync() + { + Dishes.Clear(); + + Category = (await _dataService.GetCategoriesAsync()) + .First(c => c.Id == CategoryId); + var dishes = await _dataService.GetDishesAsync(CategoryId); + + foreach (var dish in dishes) + { + Dishes.Add(dish); + } + } + + private async void NavigateToDish(Dish dish) + { + await _navigationService.GoToAsync($"{nameof(DishPage)}?DishId={dish.Id}"); + } + + public override async Task Initialize() + { + await LoadDataAsync(); + await base.Initialize(); + } +} + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Dish.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Dish.cs new file mode 100644 index 0000000..ce1d48d --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/Dish.cs @@ -0,0 +1,11 @@ +namespace ElVegetarianoFurio.Menu +{ + public class Dish + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public decimal Price { get; set; } + public int CategoryId { get; set; } + } +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml new file mode 100644 index 0000000..cccccf2 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml.cs new file mode 100644 index 0000000..544f253 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishPage.xaml.cs @@ -0,0 +1,27 @@ +namespace ElVegetarianoFurio.Menu; + +[QueryProperty(nameof(DishId), nameof(DishId))] +public partial class DishPage : ContentPage +{ + private readonly DishViewModel _viewModel; + + public DishPage(DishViewModel viewModel) + { + InitializeComponent(); + BindingContext = _viewModel = viewModel; + } + + public int DishId + { + get; + set; + } + + protected override async void OnNavigatedTo(NavigatedToEventArgs args) + { + _viewModel.DishId = DishId; + await _viewModel.Initialize(); + base.OnNavigatedTo(args); + } + +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishViewModel.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishViewModel.cs new file mode 100644 index 0000000..f149c72 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Menu/DishViewModel.cs @@ -0,0 +1,35 @@ +using ElVegetarianoFurio.Core; +using ElVegetarianoFurio.Data; + +namespace ElVegetarianoFurio.Menu; + +public class DishViewModel : BaseViewModel +{ + private readonly IDataService _dataService; + private Dish _dish; + private int _dishId; + + public Dish Dish + { + get => _dish; + set => SetProperty(ref _dish, value); + } + + public DishViewModel(IDataService dataService) + { + _dataService = dataService; + } + + public int DishId + { + get => _dishId; + set => SetProperty(ref _dishId, value); + } + + public override async Task Initialize() + { + Dish = await _dataService.GetDishAsync(DishId); + await base.Initialize(); + } +} + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/AndroidManifest.xml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..e9937ad --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainActivity.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..d417720 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace ElVegetarianoFurio; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainApplication.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..cda2d65 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace ElVegetarianoFurio; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/Resources/values/colors.xml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/AppDelegate.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..9002b85 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ElVegetarianoFurio; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Info.plist b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..c96dd0a --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,30 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Program.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..1b22262 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ElVegetarianoFurio; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/Main.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..26cba44 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/Main.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace ElVegetarianoFurio; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/tizen-manifest.xml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..4fcf4ee --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml new file mode 100644 index 0000000..b690b8f --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..fd599d4 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/App.xaml.cs @@ -0,0 +1,24 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace ElVegetarianoFurio.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/Package.appxmanifest b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..2bcb11e --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,43 @@ + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/app.manifest b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/app.manifest new file mode 100644 index 0000000..ed272aa --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/AppDelegate.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..9002b85 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ElVegetarianoFurio; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Info.plist b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Info.plist new file mode 100644 index 0000000..0004a4f --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Program.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Program.cs new file mode 100644 index 0000000..1b22262 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ElVegetarianoFurio; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/IProfileService.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/IProfileService.cs new file mode 100644 index 0000000..079c1f0 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/IProfileService.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace ElVegetarianoFurio.Profile; + +public interface IProfileService +{ + Task GetAsync(); + Task SaveAsync(Profile profile); +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/Profile.cs b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/Profile.cs new file mode 100644 index 0000000..6567b6a --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/Profile.cs @@ -0,0 +1,14 @@ +namespace ElVegetarianoFurio.Profile; + +public class Profile +{ + public string FullName { get; set; } + + public string Street { get; set; } + + public string Zip { get; set; } + + public string City { get; set; } + + public string Phone { get; set; } +} \ No newline at end of file diff --git a/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/ProfilePage.xaml b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/ProfilePage.xaml new file mode 100644 index 0000000..0baa045 --- /dev/null +++ b/Kap15/ElVegetarianoFurio/ElVegetarianoFurio/Profile/ProfilePage.xaml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/Kap15/LocalDataSample/LocalDataSample/Views/ItemDetailPage.xaml.cs b/Kap15/LocalDataSample/LocalDataSample/Views/ItemDetailPage.xaml.cs new file mode 100644 index 0000000..6e8158f --- /dev/null +++ b/Kap15/LocalDataSample/LocalDataSample/Views/ItemDetailPage.xaml.cs @@ -0,0 +1,13 @@ +using LocalDataSample.ViewModels; + +namespace LocalDataSample.Views +{ + public partial class ItemDetailPage : ContentPage + { + public ItemDetailPage(ItemDetailViewModel viewModel) + { + InitializeComponent(); + BindingContext = viewModel; + } + } +} \ No newline at end of file diff --git a/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml b/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml new file mode 100644 index 0000000..6e49138 --- /dev/null +++ b/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml.cs b/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml.cs new file mode 100644 index 0000000..2643db1 --- /dev/null +++ b/Kap15/LocalDataSample/LocalDataSample/Views/ItemsPage.xaml.cs @@ -0,0 +1,22 @@ + +using LocalDataSample.ViewModels; + +namespace LocalDataSample.Views; + +public partial class ItemsPage : ContentPage +{ + readonly ItemsViewModel _viewModel; + + public ItemsPage(ItemsViewModel viewModel) + { + InitializeComponent(); + + BindingContext = _viewModel = viewModel; + } + + protected override void OnNavigatedTo(NavigatedToEventArgs args) + { + _viewModel.Initialize(); + base.OnNavigatedTo(args); + } +} \ No newline at end of file diff --git a/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml b/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml new file mode 100644 index 0000000..9defd58 --- /dev/null +++ b/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + diff --git a/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml.cs b/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml.cs new file mode 100644 index 0000000..68884ef --- /dev/null +++ b/Kap15/LocalDataSample/LocalDataSample/Views/NewItemPage.xaml.cs @@ -0,0 +1,13 @@ +using LocalDataSample.Models; +using LocalDataSample.ViewModels; + +namespace LocalDataSample.Views; + +public partial class NewItemPage : ContentPage +{ + public NewItemPage(NewItemViewModel viewModel) + { + InitializeComponent(); + BindingContext = viewModel; + } +} \ No newline at end of file diff --git a/Kap16/DeviceDemo/DeviceDemo.sln b/Kap16/DeviceDemo/DeviceDemo.sln new file mode 100644 index 0000000..fd00a26 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeviceDemo", "DeviceDemo\DeviceDemo.csproj", "{71A949F3-1710-4CCC-BA5A-590D89E018E5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Release|Any CPU.Build.0 = Release|Any CPU + {71A949F3-1710-4CCC-BA5A-590D89E018E5}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/Kap16/DeviceDemo/DeviceDemo/App.xaml b/Kap16/DeviceDemo/DeviceDemo/App.xaml new file mode 100644 index 0000000..b7292b9 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/Kap16/DeviceDemo/DeviceDemo/App.xaml.cs b/Kap16/DeviceDemo/DeviceDemo/App.xaml.cs new file mode 100644 index 0000000..9d2ac34 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/App.xaml.cs @@ -0,0 +1,11 @@ +namespace DeviceDemo; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml b/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml new file mode 100644 index 0000000..d2afc44 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml.cs b/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml.cs new file mode 100644 index 0000000..b7aaf83 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace DeviceDemo; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/Kap16/DeviceDemo/DeviceDemo/DeviceDemo.csproj b/Kap16/DeviceDemo/DeviceDemo/DeviceDemo.csproj new file mode 100644 index 0000000..32d3473 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/DeviceDemo.csproj @@ -0,0 +1,60 @@ + + + + net6.0-android;net6.0-ios;net6.0-maccatalyst + $(TargetFrameworks);net6.0-windows10.0.19041.0 + + + Exe + DeviceDemo + true + true + enable + + + DeviceDemo + + + com.companyname.devicedemo + FC57E26F-5E4C-45F9-AEC4-C61DDBB7ADBA + + + 1.0 + 1 + + 14.2 + 14.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/Kap16/DeviceDemo/DeviceDemo/MainPage.xaml b/Kap16/DeviceDemo/DeviceDemo/MainPage.xaml new file mode 100644 index 0000000..9a2dc37 --- /dev/null +++ b/Kap16/DeviceDemo/DeviceDemo/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + + +