logger)
12 | {
13 | _logger = logger;
14 | }
15 |
16 | public IActionResult Index()
17 | {
18 | return View();
19 | }
20 |
21 | public IActionResult Privacy()
22 | {
23 | return View();
24 | }
25 |
26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
27 | public IActionResult Error()
28 | {
29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/HeroesMvc/HeroesMvc.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/HeroesMvc/Models/ErrorViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace HeroesMvc.Models
2 | {
3 | public class ErrorViewModel
4 | {
5 | public string? RequestId { get; set; }
6 |
7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/HeroesMvc/Program.cs:
--------------------------------------------------------------------------------
1 | var builder = WebApplication.CreateBuilder(args);
2 |
3 | // Add services to the container.
4 | builder.Services.AddControllersWithViews();
5 |
6 | var app = builder.Build();
7 |
8 | // Configure the HTTP request pipeline.
9 | if (!app.Environment.IsDevelopment())
10 | {
11 | app.UseExceptionHandler("/Home/Error");
12 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
13 | app.UseHsts();
14 | }
15 |
16 | app.UseHttpsRedirection();
17 | app.UseRouting();
18 |
19 | app.UseAuthorization();
20 |
21 | app.MapStaticAssets();
22 |
23 | app.MapControllerRoute(
24 | name: "default",
25 | pattern: "{controller=Home}/{action=Index}/{id?}")
26 | .WithStaticAssets();
27 |
28 |
29 | app.Run();
30 |
--------------------------------------------------------------------------------
/HeroesMvc/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "profiles": {
4 | "http": {
5 | "commandName": "Project",
6 | "dotnetRunMessages": true,
7 | "launchBrowser": true,
8 | "applicationUrl": "http://localhost:5102",
9 | "environmentVariables": {
10 | "ASPNETCORE_ENVIRONMENT": "Development"
11 | }
12 | },
13 | "https": {
14 | "commandName": "Project",
15 | "dotnetRunMessages": true,
16 | "launchBrowser": true,
17 | "applicationUrl": "https://localhost:7173;http://localhost:5102",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/Home/Index.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Home Page";
3 | }
4 |
5 |
9 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/Home/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | ViewData["Title"] = "Privacy Policy";
3 | }
4 | @ViewData["Title"]
5 |
6 | Use this page to detail your site's privacy policy.
7 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/Shared/Error.cshtml:
--------------------------------------------------------------------------------
1 | @model ErrorViewModel
2 | @{
3 | ViewData["Title"] = "Error";
4 | }
5 |
6 | Error.
7 | An error occurred while processing your request.
8 |
9 | @if (Model.ShowRequestId)
10 | {
11 |
12 | Request ID: @Model.RequestId
13 |
14 | }
15 |
16 | Development Mode
17 |
18 | Swapping to Development environment will display more detailed information about the error that occurred.
19 |
20 |
21 | The Development environment shouldn't be enabled for deployed applications.
22 | It can result in displaying sensitive information from exceptions to end users.
23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
24 | and restarting the app.
25 |
26 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using HeroesMvc
2 | @using HeroesMvc.Models
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/HeroesMvc/Views/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/HeroesMvc/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/HeroesMvc/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/HeroesMvc/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | html {
2 | font-size: 14px;
3 | }
4 |
5 | @media (min-width: 768px) {
6 | html {
7 | font-size: 16px;
8 | }
9 | }
10 |
11 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
12 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
13 | }
14 |
15 | html {
16 | position: relative;
17 | min-height: 100%;
18 | }
19 |
20 | body {
21 | margin-bottom: 60px;
22 | }
23 |
24 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
25 | color: var(--bs-secondary-color);
26 | text-align: end;
27 | }
28 |
29 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
30 | text-align: start;
31 | }
--------------------------------------------------------------------------------
/HeroesMvc/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/HeroesMvc/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/HeroesMvc/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/HeroesRazor/HeroesRazor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | enable
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Dashboard.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model HeroesRazor.Pages.DashboardModel
3 | @{
4 |
5 | }
6 |
7 | Dashboard
8 | Top Heroes
9 |
10 | @if (Model.Heroes == null)
11 | {
12 | Loading Heroes...
13 | }
14 | else
15 | {
16 |
23 | }
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Dashboard.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using DemoWebApi.Controllers.Client;
4 |
5 |
6 | namespace HeroesRazor.Pages
7 | {
8 | public class DashboardModel : PageModel
9 | {
10 | public Hero[] Heroes { get; set; }
11 |
12 | public DashboardModel(IHttpClientFactory httpClientFactory)
13 | {
14 | heroesApi = new DemoWebApi.Controllers.Client.Heroes(httpClientFactory.CreateClient("heroesApi"), new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web));
15 | }
16 |
17 | readonly DemoWebApi.Controllers.Client.Heroes heroesApi;
18 |
19 | public async Task OnGet()
20 | {
21 | Heroes = await heroesApi.GetAsyncHeroesAsync();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Dashboard.cshtml.css:
--------------------------------------------------------------------------------
1 | /* DashboardComponent's private CSS styles */
2 |
3 | h2 {
4 | text-align: center;
5 | }
6 |
7 | .heroes-menu {
8 | padding: 0;
9 | margin: auto;
10 | max-width: 1000px;
11 | /* flexbox */
12 | display: -webkit-box;
13 | display: -moz-box;
14 | display: -ms-flexbox;
15 | display: -webkit-flex;
16 | display: flex;
17 | flex-direction: row;
18 | flex-wrap: wrap;
19 | justify-content: space-around;
20 | align-content: flex-start;
21 | align-items: flex-start;
22 | }
23 |
24 | a {
25 | background-color: #3f525c;
26 | border-radius: 2px;
27 | padding: 1rem;
28 | font-size: 1.2rem;
29 | text-decoration: none;
30 | display: inline-block;
31 | color: #fff;
32 | text-align: center;
33 | width: 100%;
34 | min-width: 70px;
35 | margin: .5rem auto;
36 | box-sizing: border-box;
37 | /* flexbox */
38 | order: 0;
39 | flex: 0 1 auto;
40 | align-self: auto;
41 | }
42 |
43 | @media (min-width: 600px) {
44 | a {
45 | width: 18%;
46 | box-sizing: content-box;
47 | }
48 | }
49 |
50 | a:hover {
51 | background-color: black;
52 | }
53 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Error.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model ErrorModel
3 | @{
4 | ViewData["Title"] = "Error";
5 | }
6 |
7 | Error.
8 | An error occurred while processing your request.
9 |
10 | @if (Model.ShowRequestId)
11 | {
12 |
13 | Request ID: @Model.RequestId
14 |
15 | }
16 |
17 | Development Mode
18 |
19 | Swapping to the Development environment displays detailed information about the error that occurred.
20 |
21 |
22 | The Development environment shouldn't be enabled for deployed applications.
23 | It can result in displaying sensitive information from exceptions to end users.
24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development
25 | and restarting the app.
26 |
27 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Error.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 | using System.Diagnostics;
4 |
5 | namespace HeroesRazor.Pages
6 | {
7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
8 | [IgnoreAntiforgeryToken]
9 | public class ErrorModel : PageModel
10 | {
11 | public string? RequestId { get; set; }
12 |
13 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
14 |
15 | private readonly ILogger _logger;
16 |
17 | public ErrorModel(ILogger logger)
18 | {
19 | _logger = logger;
20 | }
21 |
22 | public void OnGet()
23 | {
24 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
25 | }
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/HeroDetail.cshtml:
--------------------------------------------------------------------------------
1 | @page "/detail/{id:long}"
2 | @model HeroesRazor.Pages.HeroDetailModel
3 | @{
4 | }
5 |
6 | Heroes
7 | Heroes Dashboard
8 |
9 | @if (Model.Hero == null)
10 | {
11 | Loading Hero...
12 | }
13 | else
14 | {
15 |
16 |
@Model.Hero.Name Details
17 |
id: @Model.Id
18 |
19 | Hero name:
20 |
21 |
22 |
23 |
go back
24 |
Save
25 |
26 | }
--------------------------------------------------------------------------------
/HeroesRazor/Pages/HeroDetail.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc.RazorPages;
2 |
3 | namespace HeroesRazor.Pages
4 | {
5 | public class HeroDetailModel : PageModel
6 | {
7 | public HeroDetailModel(IHttpClientFactory httpClientFactory)
8 | {
9 | heroesApi = new DemoWebApi.Controllers.Client.Heroes(httpClientFactory.CreateClient("heroesApi"), new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web));
10 | }
11 |
12 | //[Parameter]
13 | public long Id { get; set; }
14 | public DemoWebApi.Controllers.Client.Hero? Hero { get; private set; }
15 | readonly DemoWebApi.Controllers.Client.Heroes heroesApi;
16 |
17 | public async Task OnGet(long id)
18 | {
19 | Id= id;
20 | Hero = await heroesApi.GetHeroAsync(id);
21 | }
22 |
23 | public async Task Save()
24 | {
25 | await heroesApi.PutAsync(Hero);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/HeroDetail.cshtml.css:
--------------------------------------------------------------------------------
1 | /* HeroDetailComponent's private CSS styles */
2 | label {
3 | color: #435960;
4 | font-weight: bold;
5 | }
6 |
7 | input {
8 | font-size: 1em;
9 | padding: .5rem;
10 | }
11 |
12 | button {
13 | margin-top: 20px;
14 | margin-right: .5rem;
15 | background-color: #eee;
16 | padding: 1rem;
17 | border-radius: 4px;
18 | font-size: 1rem;
19 | }
20 |
21 | button:hover {
22 | background-color: #cfd8dc;
23 | }
24 |
25 | button:disabled {
26 | background-color: #eee;
27 | color: #ccc;
28 | cursor: auto;
29 | }
30 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/HeroDetail.razor.css:
--------------------------------------------------------------------------------
1 | /* HeroDetailComponent's private CSS styles */
2 | label {
3 | color: #435960;
4 | font-weight: bold;
5 | }
6 |
7 | input {
8 | font-size: 1em;
9 | padding: .5rem;
10 | }
11 |
12 | button {
13 | margin-top: 20px;
14 | margin-right: .5rem;
15 | background-color: #eee;
16 | padding: 1rem;
17 | border-radius: 4px;
18 | font-size: 1rem;
19 | }
20 |
21 | button:hover {
22 | background-color: #cfd8dc;
23 | }
24 |
25 | button:disabled {
26 | background-color: #eee;
27 | color: #ccc;
28 | cursor: auto;
29 | }
30 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Heroes.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model HeroesRazor.Pages.HeroesModel
3 | @{
4 | }
5 |
6 | List
7 | My Heroes
8 |
9 | @if (@Model.heroes == null)
10 | {
11 | Loading Heroes...
12 | }
13 | else
14 | {
15 |
16 | Hero name:
17 |
18 |
19 |
20 | Add hero
21 |
22 |
23 |
24 |
25 | @foreach (var hero in @Model.heroes)
26 | {
27 | string href = $"/detail/{hero.Id}";
28 |
29 |
30 | @hero.Id @hero.Name
31 |
32 | x
33 |
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Index.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model IndexModel
3 | @{
4 | ViewData["Title"] = "Home page";
5 | }
6 |
7 |
11 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Index.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 |
4 | namespace HeroesRazor.Pages
5 | {
6 | public class IndexModel : PageModel
7 | {
8 | private readonly ILogger _logger;
9 |
10 | public IndexModel(ILogger logger)
11 | {
12 | _logger = logger;
13 | }
14 |
15 | public void OnGet()
16 | {
17 |
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Privacy.cshtml:
--------------------------------------------------------------------------------
1 | @page
2 | @model PrivacyModel
3 | @{
4 | ViewData["Title"] = "Privacy Policy";
5 | }
6 | @ViewData["Title"]
7 |
8 | Use this page to detail your site's privacy policy.
9 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Privacy.cshtml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Mvc;
2 | using Microsoft.AspNetCore.Mvc.RazorPages;
3 |
4 | namespace HeroesRazor.Pages
5 | {
6 | public class PrivacyModel : PageModel
7 | {
8 | private readonly ILogger _logger;
9 |
10 | public PrivacyModel(ILogger logger)
11 | {
12 | _logger = logger;
13 | }
14 |
15 | public void OnGet()
16 | {
17 | }
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/Shared/_ValidationScriptsPartial.cshtml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using HeroesRazor
2 | @namespace HeroesRazor.Pages
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/HeroesRazor/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/HeroesRazor/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "profiles": {
4 | "http": {
5 | "commandName": "Project",
6 | "dotnetRunMessages": true,
7 | "launchBrowser": true,
8 | "applicationUrl": "http://localhost:5151",
9 | "environmentVariables": {
10 | "ASPNETCORE_ENVIRONMENT": "Development"
11 | }
12 | },
13 | "https": {
14 | "commandName": "Project",
15 | "dotnetRunMessages": true,
16 | "launchBrowser": true,
17 | "applicationUrl": "https://localhost:7282;http://localhost:5151",
18 | "environmentVariables": {
19 | "ASPNETCORE_ENVIRONMENT": "Development"
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/HeroesRazor/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "DetailedErrors": true,
3 | "Logging": {
4 | "LogLevel": {
5 | "Default": "Information",
6 | "Microsoft.AspNetCore": "Warning"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/HeroesRazor/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft.AspNetCore": "Warning"
6 | }
7 | },
8 | "AllowedHosts": "*"
9 | }
10 |
--------------------------------------------------------------------------------
/HeroesRazor/wwwroot/css/site.css:
--------------------------------------------------------------------------------
1 | html {
2 | font-size: 14px;
3 | }
4 |
5 | @media (min-width: 768px) {
6 | html {
7 | font-size: 16px;
8 | }
9 | }
10 |
11 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
12 | box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
13 | }
14 |
15 | html {
16 | position: relative;
17 | min-height: 100%;
18 | }
19 |
20 | body {
21 | margin-bottom: 60px;
22 | }
23 |
24 | .form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
25 | color: var(--bs-secondary-color);
26 | text-align: end;
27 | }
28 |
29 | .form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
30 | text-align: start;
31 | }
--------------------------------------------------------------------------------
/HeroesRazor/wwwroot/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/HeroesRazor/wwwroot/favicon.ico
--------------------------------------------------------------------------------
/HeroesRazor/wwwroot/js/site.js:
--------------------------------------------------------------------------------
1 | // Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
2 | // for details on configuring this project to bundle and minify static web assets.
3 |
4 | // Write your JavaScript code.
5 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Assets/AboutAndroidAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with your package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace MauiHeroes.Droid
6 | {
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/MainAndroidApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace MauiHeroes.Droid
5 | {
6 | [Application]
7 | public class MainAndroidApplication : MauiApplication
8 | {
9 | public MainAndroidApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | Console.WriteLine("MainAndroidApplication created");
13 | }
14 |
15 | protected override MauiApp CreateMauiApp() => MauiAndroidProgram.CreateMauiApp();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/MauiAndroidProgram.cs:
--------------------------------------------------------------------------------
1 | namespace MauiHeroes.Droid
2 | {
3 | public static class MauiAndroidProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 |
9 | builder
10 | .UseSharedMauiApp();
11 |
12 | return builder.Build();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/MauiHeroes.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0-android
5 | 23.0
6 | Exe
7 | enable
8 | enable
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-hdpi/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-hdpi/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-mdpi/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-mdpi/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xhdpi/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xhdpi/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxhdpi/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxhdpi/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxxhdpi/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/drawable-xxxhdpi/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-anydpi-v26/appicon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-anydpi-v26/appicon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_background.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-hdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_background.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-mdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_background.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_background.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_background.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/mipmap-xxxhdpi/appicon_foreground.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Droid/Resources/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MauiHeroes
3 |
4 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace MauiHeroes.Mac
4 | {
5 | [Register(nameof(AppDelegate))]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon128.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon16.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon256.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon32.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon512.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Assets.xcassets/AppIcon.appiconset/Icon64.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Main.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace MauiHeroes.Mac
5 | {
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/MauiHeroes.Mac.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0-maccatalyst
5 | 13.1
6 | Exe
7 | enable
8 | enable
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | namespace MauiHeroes.Mac
2 | {
3 | public static class MauiProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 |
9 | builder
10 | .UseSharedMauiApp();
11 |
12 | return builder.Build();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/AboutMacCatalystResources.txt:
--------------------------------------------------------------------------------
1 | This folder can contain all the Mac Catalyst-specific resources that your app may use.
2 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@2x.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.Mac/Resources/dotnet_bot_devices@3x.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace MauiHeroes.WinUI
7 | {
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/AboutWinUIAssets.txt:
--------------------------------------------------------------------------------
1 | This folder can contain all the Windows-specific assets that your app may use.
2 |
3 | Accessing items here can be done using the `ms-appx` uri sceme;
4 |
5 | For example, if there is a file:
6 |
7 | \Assets\my_image.png
8 |
9 | This can be accessed with the uri:
10 |
11 | ms-appx:///Assets/my_image.png
12 |
13 | The files in the root ofthe Assets folder are meant to only be accessible from
14 | the Windows-specific files - such as the Package.appxmanifest. When using an
15 | asset for the manifest, you would refer to it with the `Asset\` prefix.
16 |
17 | For images that are meant to be accessed from cross-platform code, like XAML
18 | files, images should be placed into the `Assets\Images` folder as those are
19 | packaged differently to ensure the path matches that for the other platforms.
20 |
21 | For more information, see the Assets\ImagesAboutWinUIImages.txt file.
22 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/AboutWinUIImages.txt:
--------------------------------------------------------------------------------
1 | This folder can contain all the Windows-specific images that your app may use.
2 |
3 | The images in the `Images` sub folder are easily accessible in cross-platform
4 | code because they are packaged in the root of the application making them
5 | have a similar path to the other platforms.
6 |
7 | For example, if there is a file:
8 |
9 | /Assets/Images/my_image.png
10 |
11 | This can be accessed with the same code as the other platforms in shared code:
12 |
13 |
14 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-100.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-125.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-150.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Images/dotnet_bot_devices.scale-400.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | namespace MauiHeroes.WinUI
2 | {
3 | public static class MauiProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 |
9 | builder
10 | .UseSharedMauiApp();
11 |
12 | return builder.Build();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | ARM64
9 | win10-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win10-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/PublishProfiles/win10-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win10-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": true
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.WinUI/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | PerMonitorV2
18 |
19 |
20 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace MauiHeroes.iOS
4 | {
5 | [Register(nameof(AppDelegate))]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace MauiHeroes.iOS
5 | {
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | namespace MauiHeroes.iOS
2 | {
3 | public static class MauiProgram
4 | {
5 | public static MauiApp CreateMauiApp()
6 | {
7 | var builder = MauiApp.CreateBuilder();
8 |
9 | builder
10 | .UseSharedMauiApp();
11 |
12 | return builder.Build();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/AboutiOSResources.txt:
--------------------------------------------------------------------------------
1 | This folder can contain all the iOS-specific resources that your app may use.
2 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@2x.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes.iOS/Resources/dotnet_bot_devices@3x.png
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui.Controls.Xaml;
3 | using Microsoft.Maui.Controls;
4 | using Microsoft.Maui;
5 |
6 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
7 | namespace Fonlow.Heroes
8 | {
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | InitializeComponent();
14 |
15 | MainPage = new NavigationPage(new Views.MainTabbedPage());
16 | }
17 |
18 | protected override void OnStart()
19 | {
20 | // Handle when your app starts
21 | }
22 |
23 | protected override void OnSleep()
24 | {
25 | // Handle when your app sleeps
26 | }
27 |
28 | protected override void OnResume()
29 | {
30 | // Handle when your app resumes
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/MauiProgramExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace MauiHeroes
4 | {
5 | public static class MauiProgramExtensions
6 | {
7 | public static MauiAppBuilder UseSharedMauiApp(this MauiAppBuilder builder)
8 | {
9 | builder
10 | .UseMauiApp()
11 | .ConfigureFonts(fonts =>
12 | {
13 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
14 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
15 | });
16 |
17 | #if DEBUG
18 | builder.Logging.AddDebug();
19 | #endif
20 |
21 | return builder;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/MauiMulti/MauiHeroes/MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/MauiMulti/MauiHeroes/MauiHeroes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with your package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/ReactHeroes/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/ReactHeroes/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | moduleFileExtensions: [
3 | 'js',
4 | 'jsx',
5 | 'json',
6 | 'vue',
7 | 'ts',
8 | 'tsx'
9 | ],
10 |
11 | transform: {
12 | '^.+\\.vue$': 'vue-jest',
13 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
14 | '^.+\\.tsx?$': 'ts-jest'
15 | },
16 |
17 | testEnvironmentOptions: {
18 | url: 'http://localhost:4201',
19 | customExportConditions: ["node", "node-addons"],
20 | },
21 | moduleNameMapper: {
22 | '^@/(.*)$': '/src/$1'
23 | },
24 | snapshotSerializers: [
25 | 'jest-serializer-vue'
26 | ],
27 | testMatch: [
28 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
29 | ],
30 | "compilerOptions": {
31 | "types": ["vitest/globals"]
32 | },
33 |
34 | watchPlugins: [
35 | 'jest-watch-typeahead/filename',
36 | 'jest-watch-typeahead/testname'
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/ReactHeroes/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/favicon.ico
--------------------------------------------------------------------------------
/ReactHeroes/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/logo192.png
--------------------------------------------------------------------------------
/ReactHeroes/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/ReactHeroes/public/logo512.png
--------------------------------------------------------------------------------
/ReactHeroes/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/ReactHeroes/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/ReactHeroes/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | height: 40vmin;
7 | pointer-events: none;
8 | }
9 |
10 | @media (prefers-reduced-motion: no-preference) {
11 | .App-logo {
12 | animation: App-logo-spin infinite 20s linear;
13 | }
14 | }
15 |
16 | .App-header {
17 | background-color: #282c34;
18 | min-height: 100vh;
19 | display: flex;
20 | flex-direction: column;
21 | align-items: center;
22 | justify-content: center;
23 | font-size: calc(10px + 2vmin);
24 | color: white;
25 | }
26 |
27 | .App-link {
28 | color: #61dafb;
29 | }
30 |
31 | @keyframes App-logo-spin {
32 | from {
33 | transform: rotate(0deg);
34 | }
35 | to {
36 | transform: rotate(360deg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/ReactHeroes/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { BrowserRouter, useRoutes } from 'react-router-dom';
2 | import './App.css';
3 | import Dashboard from './Dashboard';
4 | import Demo from './Demo';
5 | import HeroDetail from './HeroDetail';
6 | import Heroes from './Heroes';
7 | import Home from './Home';
8 |
9 | function AppRouteMap() {
10 | return useRoutes([
11 | { path: 'demo', element: },
12 | { path: '/', element: },
13 | {
14 | element: ,
15 | children: [
16 | { path: 'dashboard', element: },
17 | { path: 'heroes', element: },
18 | { path: 'detail/:id', element: }
19 | ]
20 | }
21 | ]);
22 |
23 | }
24 |
25 | export default function App() {
26 | return (
27 |
28 |
29 |
30 | );
31 | }
32 |
--------------------------------------------------------------------------------
/ReactHeroes/src/Demo.tsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import logo from './logo.svg';
3 | import './App.css';
4 |
5 | export default class Demo extends Component {
6 | render(): React.ReactNode {
7 | return (
8 |
24 | );
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ReactHeroes/src/HeroDetail.css:
--------------------------------------------------------------------------------
1 | /* HeroDetailComponent's private CSS styles */
2 | label {
3 | color: #435960;
4 | font-weight: bold;
5 | }
6 | input {
7 | font-size: 1em;
8 | padding: .5rem;
9 | }
10 | button {
11 | margin-top: 20px;
12 | margin-right: .5rem;
13 | background-color: #eee;
14 | padding: 1rem;
15 | border-radius: 4px;
16 | font-size: 1rem;
17 | }
18 | button:hover {
19 | background-color: #cfd8dc;
20 | }
21 | button:disabled {
22 | background-color: #eee;
23 | color: #ccc;
24 | cursor: auto;
25 | }
26 |
--------------------------------------------------------------------------------
/ReactHeroes/src/HeroesApi.tsx:
--------------------------------------------------------------------------------
1 | import { DemoWebApi_Controllers_Client } from './clientapi/WebApiCoreAxiosClientAuto';
2 |
3 | export let HeroesApi = heroesApi();
4 | function heroesApi() {
5 | const apiBaseUri = 'http://localhost:5000/';
6 | const service = new DemoWebApi_Controllers_Client.Heroes(apiBaseUri);
7 | return service;
8 |
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/ReactHeroes/src/Home.tsx:
--------------------------------------------------------------------------------
1 | import { Link, Outlet } from 'react-router-dom';
2 | import './HeroDetail.css';
3 |
4 | export default function Home() {
5 |
6 | return (
7 | <>
8 | React Heroes!
9 |
10 | Dashboard
11 | Heroes
12 |
13 |
14 |
15 | >
16 | );
17 |
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/ReactHeroes/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5 | sans-serif;
6 | -webkit-font-smoothing: antialiased;
7 | -moz-osx-font-smoothing: grayscale;
8 | }
9 |
10 | code {
11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12 | monospace;
13 | }
14 |
--------------------------------------------------------------------------------
/ReactHeroes/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import './index.css';
4 | import App from './App';
5 | import reportWebVitals from './reportWebVitals';
6 |
7 | const root = ReactDOM.createRoot(
8 | document.getElementById('root') as HTMLElement
9 | );
10 | root.render(
11 |
12 |
13 |
14 | );
15 |
16 | // If you want to start measuring performance in your app, pass a function
17 | // to log results (for example: reportWebVitals(console.log))
18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19 | reportWebVitals();
20 |
--------------------------------------------------------------------------------
/ReactHeroes/src/react-app-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/ReactHeroes/src/reportWebVitals.ts:
--------------------------------------------------------------------------------
1 | import { ReportHandler } from 'web-vitals';
2 |
3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4 | if (onPerfEntry && onPerfEntry instanceof Function) {
5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6 | getCLS(onPerfEntry);
7 | getFID(onPerfEntry);
8 | getFCP(onPerfEntry);
9 | getLCP(onPerfEntry);
10 | getTTFB(onPerfEntry);
11 | });
12 | }
13 | };
14 |
15 | export default reportWebVitals;
16 |
--------------------------------------------------------------------------------
/ReactHeroes/src/setupTests.ts:
--------------------------------------------------------------------------------
1 | // jest-dom adds custom jest matchers for asserting on DOM nodes.
2 | // allows you to do things like:
3 | // expect(element).toHaveTextContent(/react/i)
4 | // learn more: https://github.com/testing-library/jest-dom
5 | import '@testing-library/jest-dom';
6 |
--------------------------------------------------------------------------------
/ReactHeroes/startApp.bat:
--------------------------------------------------------------------------------
1 | ::Run `npm run build` for prod build first. https://create-react-app.dev/docs/production-build
2 | ::Launch local Web API
3 | ::Then use in Web browser
4 |
5 | dotnet-serve -d build\ -p 5400
6 |
--------------------------------------------------------------------------------
/ReactHeroes/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2022",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "es2022"
8 | ],
9 | "allowJs": true,
10 | "skipLibCheck": true,
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true,
13 | "strict": true,
14 | "forceConsistentCasingInFileNames": true,
15 | "noFallthroughCasesInSwitch": true,
16 | "module": "es2022",
17 | "moduleResolution": "node",
18 | "resolveJsonModule": true,
19 | "isolatedModules": true,
20 | "noEmit": true,
21 | "jsx": "react-jsx"
22 | },
23 | "include": [
24 | "src"
25 | ]
26 | }
27 |
--------------------------------------------------------------------------------
/StartCoreMvc.ps1:
--------------------------------------------------------------------------------
1 | #Launch WebApi Website and POST a request for generating client APIs
2 | cd $PSScriptRoot
3 | $path = "$PSScriptRoot/Core3MVC"
4 | $procArgs = @{
5 | FilePath = "dotnet.exe"
6 | ArgumentList = "run --project $path/Core3MVC.csproj --no-build"
7 | WorkingDirectory = $path
8 | PassThru = $true
9 | }
10 | $process = Start-Process @procArgs
11 |
12 | Invoke-RestMethod http://localhost:5000/api/values -Method GET
13 |
14 |
--------------------------------------------------------------------------------
/StartCoreWebApi.ps1:
--------------------------------------------------------------------------------
1 | #Launch WebApi Website and POST a request for generating client APIs
2 | cd $PSScriptRoot
3 | $path = "$PSScriptRoot\Core3WebApi"
4 | $procArgs = @{
5 | FilePath = "$path/bin/Debug/net9.0/Core3WebApi.exe"
6 | WorkingDirectory = $path
7 | PassThru = $true
8 | }
9 | $process = Start-Process @procArgs
10 |
11 | Invoke-RestMethod http://localhost:5000/api/DateTypes/ForDateTimeOffset -Method GET
12 | Invoke-RestMethod http://localhost:5000/api/DateTypes/GetDateOnlyMin -Method GET
13 | Invoke-RestMethod http://localhost:5000/WeatherForecast -Method GET
14 |
15 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/DateTypesFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class DateTypesFixture : BasicHttpClient
6 | {
7 | public DateTypesFixture()
8 | {
9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions()
10 | {
11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
12 | PropertyNameCaseInsensitive = true,
13 | };
14 |
15 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); for .NET 6, no need in .NET 7, 8,
16 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter());
17 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
18 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
19 | Api = new DemoWebApi.Controllers.Client.DateTypes(HttpClient, jsonSerializerSettings);
20 | }
21 |
22 | public DemoWebApi.Controllers.Client.DateTypes Api { get; private set; }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/DotNetHostCollection.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class TestConstants
6 | {
7 | public const string LaunchWebApiAndInit = "LaunchWebApi";
8 | }
9 |
10 | [CollectionDefinition(TestConstants.LaunchWebApiAndInit)]
11 | public class DotNetHostCollection : ICollectionFixture
12 | {
13 | // This class has no code, and is never created. Its purpose is simply
14 | // to be the place to apply [CollectionDefinition] and all the
15 | // ICollectionFixture<> interfaces.
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/README.md:
--------------------------------------------------------------------------------
1 | For testing the runtime behavior of .NET Core Client API codes utilizing System.Text.Json rather than Newtonsoft.Json.
2 |
3 | The primary test endpoint is DemoTextJsonWeb. And DemoCoreWeb that uses Newtonsoft.Json should be used as well from time to time.
4 |
5 | **Hints:**
6 |
7 | * When testing with DemoCoreWeb, just launch DemoCoreWeb first, then the auto launch of DemoTextJsonWeb will fail, and the test suite will actually talk to DemoCoreWeb.
8 |
9 |
10 | **Remarks:**
11 |
12 | * As of .NET 3, 5, 6, 7 and 8, System.Text.Json has been approaching total replacement of Newtonsoft.Json, covering more and more CLR strongly typed data models.
13 | * However, as of .NET 8, there are still around 6 test cases failed revealing that what System.Text.Json is not yet capable of, when talking to DemoTextJsonWeb. Please read the doc documents of failed cases for details.
14 | * When talking to DemoCoreWeb, 4 cases failed.
15 | * Class TextJsonNegativeCases documents the behaviors of system.text.json.JsonSerilizer, related to the failed integration test cases.
16 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/SpecialTypesFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class SpecialTypesFixture : BasicHttpClient
6 | {
7 | public SpecialTypesFixture()
8 | {
9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
11 | Api = new DemoCoreWeb.Controllers.Client.SpecialTypes(HttpClient);
12 | }
13 |
14 | public DemoCoreWeb.Controllers.Client.SpecialTypes Api { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/StringDataFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class StringDataFixture : BasicHttpClient
6 | {
7 | public StringDataFixture()
8 | {
9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
11 | Api = new DemoWebApi.Controllers.Client.StringData(HttpClient);
12 | }
13 |
14 | public DemoWebApi.Controllers.Client.StringData Api { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/SuperDemoFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class SuperDemoFixture : BasicHttpClient
6 | {
7 | public SuperDemoFixture()
8 | {
9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions()
10 | {
11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault,
12 | PropertyNameCaseInsensitive = true,
13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString
14 | };
15 |
16 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
17 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
18 | Api = new DemoWebApi.Controllers.Client.SuperDemo(HttpClient, jsonSerializerSettings);
19 | }
20 |
21 | public DemoWebApi.Controllers.Client.SuperDemo Api { get; private set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/TextDataFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class TextDataFixture : BasicHttpClient
6 | {
7 | public TextDataFixture()
8 | {
9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
11 | Api = new DemoWebApi.Controllers.Client.TextData(HttpClient);
12 | }
13 |
14 | public DemoWebApi.Controllers.Client.TextData Api { get; private set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/ValuesFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class ValuesFixture : BasicHttpClient
6 | {
7 | public ValuesFixture()
8 | {
9 | //httpClient.DefaultRequestHeaders
10 | // .Accept
11 | // .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));//.net core has different behavior as described at https://github.com/zijianhuang/webapiclientgen/issues/26
12 |
13 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
14 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
15 | Api = new DemoWebApi.Controllers.Client.Values(HttpClient);
16 | }
17 |
18 | public DemoWebApi.Controllers.Client.Values Api { get; private set; }
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/WeatherForecastFixture.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Testing;
2 |
3 | namespace IntegrationTests
4 | {
5 | public class WeatherForecastFixture : BasicHttpClient
6 | {
7 | public WeatherForecastFixture()
8 | {
9 | //httpClient.DefaultRequestHeaders
10 | // .Accept
11 | // .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));//.net core has different behavior as described at https://github.com/zijianhuang/webapiclientgen/issues/26
12 |
13 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"];
14 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl);
15 | Api = new WebApplication1.Controllers.Client.WeatherForecast(HttpClient);
16 | }
17 |
18 | public WebApplication1.Controllers.Client.WeatherForecast Api { get; private set; }
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/WeatherForecastIntegration.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Threading.Tasks;
3 | using Xunit;
4 | namespace IntegrationTests
5 | {
6 | [Collection(TestConstants.LaunchWebApiAndInit)]
7 | public partial class WeatherForecastApiIntegration : IClassFixture
8 | {
9 | public WeatherForecastApiIntegration(WeatherForecastFixture fixture)
10 | {
11 | api = fixture.Api;
12 | }
13 |
14 | readonly WebApplication1.Controllers.Client.WeatherForecast api;
15 |
16 | [Fact]
17 | public void TestGet()
18 | {
19 | //var task = authorizedClient.GetStringAsync(new Uri(baseUri, "api/WeatherForecast"));
20 | //var text = task.Result;
21 | //var array = JArray.Parse(text);
22 | var array = api.Get();
23 | Assert.NotEmpty(array);
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Tests/IntegrationTestsTextJson/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Testing": {
3 | "ServiceCommands": {
4 | "LaunchWebApi": {
5 | "CommandPath": "../../../../../Core3WebApi/bin/{BuildConfiguration}/net9.0/Core3WebApi{ExecutableExt}",
6 | "BaseUrl": "http://localhost:5000/",
7 | "Delay": 5
8 | }
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/fetchapi/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function(config) {
2 | config.set({
3 | frameworks: ["jasmine", "karma-typescript"],
4 | files: [
5 | { pattern: "node_modules/reflect-metadata/Reflect.js", include: true },
6 | "src/**/*.ts" // *.tsx for React Jsx
7 | ],
8 | preprocessors: {
9 | "**/*.ts": "karma-typescript" // *.tsx for React Jsx
10 | },
11 | reporters: ["kjhtml", "karma-typescript"],
12 | client: {
13 | clearContext: false // leave Jasmine Spec Runner output visible in browser
14 | },
15 | browsers: ["Chrome"]
16 | });
17 | };
--------------------------------------------------------------------------------
/fetchapi/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "devDependencies": {
3 | "@types/jasmine": "^5.1.0",
4 | "jasmine": "^5.1.0",
5 | "karma": "^6.4.2",
6 | "karma-chrome-launcher": "^3.2.0",
7 | "karma-jasmine": "^5.1.0",
8 | "karma-jasmine-html-reporter": "^2.1.0",
9 | "karma-typescript": "^5.5.4",
10 | "reflect-metadata": "^0.1.13"
11 | },
12 | "dependencies": {
13 | "moment": "^2.29.4",
14 | "typescript": "^5.2.2"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/fetchapi/readme.txt:
--------------------------------------------------------------------------------
1 | To test, run:
2 | 0: Npm install
3 | 0.1: npm install -g karma-cli
4 | 1: start .net core web api
5 | 2: karma start ./karma.conf.js
6 |
--------------------------------------------------------------------------------
/fetchapi/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "sourceMap": true,
5 | "declaration": false,
6 | "moduleResolution": "node",
7 | "emitDecoratorMetadata": true,
8 | "experimentalDecorators": true,
9 | "target": "es2015",
10 | "typeRoots": [
11 | "node_modules/@types"
12 | ],
13 | "lib": [
14 | "es2015",
15 | "dom"
16 | ],
17 | "skipLibCheck": true
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.ViewModels/Fonlow.MauiHeroes.ViewModels.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/Dashboard.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Maui.Controls.Xaml;
7 | using Fonlow.Heroes.VM;
8 | using Microsoft.Maui.Controls;
9 | using Microsoft.Maui;
10 |
11 | namespace Fonlow.Heroes.Views
12 | {
13 | [XamlCompilation(XamlCompilationOptions.Compile)]
14 | public partial class Dashboard : ContentView
15 | {
16 | public Dashboard ()
17 | {
18 | InitializeComponent ();
19 |
20 | }
21 |
22 | HeroesVM Model
23 | {
24 | get
25 | {
26 | return BindingContext as HeroesVM;
27 | }
28 | }
29 |
30 |
31 | async void HeroesListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
32 | {
33 | await Navigation.PushAsync(new HeroDetailPage(Model.Selected.Id));
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/HeroDetailPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/HeroDetailPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using DemoWebApi.Controllers.Client;
2 | using Fonlow.Heroes.VM;
3 |
4 | namespace Fonlow.Heroes.Views
5 | {
6 | [XamlCompilation(XamlCompilationOptions.Compile)]
7 | public partial class HeroDetailPage : ContentPage
8 | {
9 | public HeroDetailPage(long heroId)
10 | {
11 | InitializeComponent();
12 | BindingContext = ClientApiSingleton.Instance.HeroesApi.GetHero(heroId);
13 | }
14 |
15 | Hero Model
16 | {
17 | get
18 | {
19 | return BindingContext as Hero;
20 | }
21 | }
22 |
23 | private async void Save_Clicked(object sender, EventArgs e)
24 | {
25 | await ClientApiSingleton.Instance.HeroesApi.PutAsync(Model);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using Microsoft.Maui.Controls;
7 | using Microsoft.Maui;
8 | using Fonlow.Heroes.VM;
9 |
10 | namespace Fonlow.Heroes.Views
11 | {
12 | public partial class MainPage : ContentPage
13 | {
14 | public MainPage()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | protected override void OnAppearing()
20 | {
21 | LoadHeroes();
22 | base.OnAppearing();
23 | }
24 |
25 | void LoadHeroes()
26 | {
27 | var heroesVM = new VM.HeroesVM();
28 |
29 | heroesVM.Load(ClientApiSingleton.Instance.HeroesApi.GetHeroes());
30 | BindingContext = heroesVM;
31 | }
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/MainTabbedPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes.Views/MainTabbedPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Fonlow.Heroes.VM;
2 |
3 | namespace Fonlow.Heroes.Views
4 | {
5 | [XamlCompilation(XamlCompilationOptions.Compile)]
6 | public partial class MainTabbedPage : TabbedPage
7 | {
8 | public MainTabbedPage ()
9 | {
10 | InitializeComponent();
11 | }
12 |
13 | protected override void OnAppearing()
14 | {
15 | LoadHeroes();
16 | base.OnAppearing();
17 | }
18 |
19 | void LoadHeroes()
20 | {
21 | var heroesVM = new VM.HeroesVM();
22 |
23 | heroesVM.Load(ClientApiSingleton.Instance.HeroesApi.GetHeroes());
24 | BindingContext = heroesVM;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui.Controls.Xaml;
3 | using Microsoft.Maui.Controls;
4 | using Microsoft.Maui;
5 |
6 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
7 | namespace Fonlow.Heroes
8 | {
9 | public partial class App : Application
10 | {
11 | public App()
12 | {
13 | InitializeComponent();
14 |
15 | MainPage = new NavigationPage(new Views.MainTabbedPage());
16 | }
17 |
18 | protected override void OnStart()
19 | {
20 | // Handle when your app starts
21 | }
22 |
23 | protected override void OnSleep()
24 | {
25 | // Handle when your app sleeps
26 | }
27 |
28 | protected override void OnResume()
29 | {
30 | // Handle when your app resumes
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace Fonlow.MauiHeroes
4 | {
5 | public static class MauiProgram
6 | {
7 | public static MauiApp CreateMauiApp()
8 | {
9 | var builder = MauiApp.CreateBuilder();
10 | builder
11 | .UseMauiApp()
12 | .ConfigureFonts(fonts =>
13 | {
14 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16 | });
17 |
18 | #if DEBUG
19 | builder.Logging.AddDebug();
20 | #endif
21 | return builder.Build();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace Fonlow.MauiHeroes
6 | {
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace Fonlow.MauiHeroes
5 | {
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace Fonlow.MauiHeroes
4 | {
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | com.apple.security.app-sandbox
8 |
9 |
10 | com.apple.security.network.client
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace Fonlow.MauiHeroes
5 | {
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Maui;
2 | using Microsoft.Maui.Hosting;
3 | using System;
4 |
5 | namespace Fonlow.MauiHeroes
6 | {
7 | internal class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | maui-application-title-placeholder
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace Fonlow.MauiHeroes.WinUI
7 | {
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace Fonlow.MauiHeroes
4 | {
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace Fonlow.MauiHeroes
5 | {
6 | public class Program
7 | {
8 | // This is the main entry point of the application.
9 | static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/mobile/Fonlow.MauiHeroes/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/mobile/Fonlow.MauiHeroes/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Resources/Images/dotnet_bot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/mobile/Fonlow.MauiHeroes/Resources/Images/dotnet_bot.png
--------------------------------------------------------------------------------
/mobile/Fonlow.MauiHeroes/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with your package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
--------------------------------------------------------------------------------
/vueTS/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 |
--------------------------------------------------------------------------------
/vueTS/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/vueTS/README.md:
--------------------------------------------------------------------------------
1 | # my-api-demo
2 |
3 | To demo how generated client APIs could be compiled and run together with Vue TS codes.
4 |
5 | 0: npm install -g @vue/cli
6 | 0.1: npm i
7 | 1: start Web API
8 | 2: npm test
9 |
10 | ## Project setup
11 | ```
12 | npm install
13 | ```
14 |
15 | ### Compiles and hot-reloads for development
16 | ```
17 | npm run serve
18 | ```
19 |
20 | ### Compiles and minifies for production
21 | ```
22 | npm run build
23 | ```
24 |
25 | ### Run your tests
26 | ```
27 | npm run test
28 | ```
29 |
30 | ### Lints and fixes files
31 | ```
32 | npm run lint
33 | ```
34 |
35 | ### Run your unit tests
36 | ```
37 | npm run test:unit
38 | ```
39 |
40 | ### Customize configuration
41 | See [Configuration Reference](https://cli.vuejs.org/config/).
42 |
--------------------------------------------------------------------------------
/vueTS/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | moduleFileExtensions: [
3 | 'js',
4 | 'jsx',
5 | 'json',
6 | 'vue',
7 | 'ts',
8 | 'tsx'
9 | ],
10 |
11 | transform: {
12 | '^.+\\.vue$': 'vue-jest',
13 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
14 | '^.+\\.tsx?$': 'ts-jest'
15 | },
16 |
17 | testEnvironmentOptions: {
18 | url: 'http://localhost:4201',
19 | customExportConditions: ["node", "node-addons"],
20 | },
21 | moduleNameMapper: {
22 | '^@/(.*)$': '/src/$1'
23 | },
24 | snapshotSerializers: [
25 | 'jest-serializer-vue'
26 | ],
27 | testMatch: [
28 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
29 | ],
30 | "compilerOptions": {
31 | "types": ["vitest/globals"]
32 | },
33 |
34 | watchPlugins: [
35 | 'jest-watch-typeahead/filename',
36 | 'jest-watch-typeahead/testname'
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/vueTS/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "my-api-demo",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint",
9 | "test:unit": "vue-cli-service test:unit",
10 | "test": "vitest"
11 | },
12 | "dependencies": {
13 | "@vitejs/plugin-vue": "^4.4.0",
14 | "@vue/compat": "3.3.4",
15 | "axios": "^1.5.1",
16 | "jest": "^29.7.0",
17 | "vue": "^3.3.4"
18 | },
19 | "devDependencies": {
20 | "@testing-library/vue": "^7.0.0",
21 | "@types/jest": "^29.5.5",
22 | "@vue/cli-plugin-typescript": "~5.0.8",
23 | "@vue/cli-plugin-unit-jest": "~5.0.8",
24 | "@vue/cli-service": "~5.0.8",
25 | "@vue/compiler-sfc": "3.3.4",
26 | "@vue/test-utils": "2.4.1",
27 | "@vue/vue3-jest": "29.2.6",
28 | "happy-dom": "^12.9.1",
29 | "ts-jest": "^29.1.1",
30 | "typescript": "~5.2.2",
31 | "vitest": "^0.34.6"
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/vueTS/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | autoprefixer: {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/vueTS/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/vueTS/public/favicon.ico
--------------------------------------------------------------------------------
/vueTS/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | my-api-demo
9 |
10 |
11 |
12 | We're sorry but my-api-demo doesn't work properly without JavaScript enabled. Please enable it to continue.
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/vueTS/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
19 |
20 |
30 |
--------------------------------------------------------------------------------
/vueTS/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zijianhuang/DemoCoreWeb/61b54e0a6d0531ce74b9068f175bf39216e7dd8e/vueTS/src/assets/logo.png
--------------------------------------------------------------------------------
/vueTS/src/main.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import App from './App.vue';
3 | import store from './store';
4 |
5 | Vue.config.productionTip = false;
6 |
7 | new Vue({
8 | store,
9 | render: (h) => h(App),
10 | }).$mount('#app');
11 |
--------------------------------------------------------------------------------
/vueTS/src/shims-tsx.d.ts:
--------------------------------------------------------------------------------
1 | import Vue, { VNode } from 'vue';
2 |
3 | declare global {
4 | namespace JSX {
5 | // tslint:disable no-empty-interface
6 | interface Element extends VNode {}
7 | // tslint:disable no-empty-interface
8 | interface ElementClass extends Vue {}
9 | interface IntrinsicElements {
10 | [elem: string]: any;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/vueTS/src/shims-vue.d.ts:
--------------------------------------------------------------------------------
1 | declare module '*.vue' {
2 | import Vue from 'vue';
3 | export default Vue;
4 | }
5 |
--------------------------------------------------------------------------------
/vueTS/src/store.ts:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 |
4 | Vue.use(Vuex);
5 |
6 | export default new Vuex.Store({
7 | state: {
8 |
9 | },
10 | mutations: {
11 |
12 | },
13 | actions: {
14 |
15 | },
16 | });
17 |
--------------------------------------------------------------------------------
/vueTS/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "esnext",
5 | "strict": true,
6 | "jsx": "preserve",
7 | "importHelpers": true,
8 | "moduleResolution": "node",
9 | "experimentalDecorators": true,
10 | "esModuleInterop": true,
11 | "allowSyntheticDefaultImports": true,
12 | "noImplicitAny": false,
13 | "strictNullChecks": false,
14 | "sourceMap": true,
15 | "baseUrl": ".",
16 | "types": [
17 | "webpack-env",
18 | "jest"
19 | ],
20 | "paths": {
21 | "@/*": [
22 | "src/*"
23 | ]
24 | },
25 | "lib": [
26 | "esnext",
27 | "dom",
28 | "dom.iterable",
29 | "scripthost"
30 | ]
31 | },
32 | "include": [
33 | "src/**/*.ts",
34 | "src/**/*.tsx",
35 | "src/**/*.vue",
36 | "tests/**/*.ts",
37 | "tests/**/*.tsx"
38 | ],
39 | "exclude": [
40 | "node_modules"
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/vueTS/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "defaultSeverity": "warning",
3 | "extends": [
4 | "tslint:recommended"
5 | ],
6 | "linterOptions": {
7 | "exclude": [
8 | "node_modules/**"
9 | ]
10 | },
11 | "rules": {
12 | "quotemark": [true, "single"],
13 | "indent": [true, "spaces", 2],
14 | "interface-name": false,
15 | "ordered-imports": false,
16 | "object-literal-sort-keys": false,
17 | "no-consecutive-blank-lines": false
18 | }
19 | }
20 |
--------------------------------------------------------------------------------