├── .gitattributes
├── .gitignore
├── README.md
├── azure-pipelines.yml
└── src
├── Counter
├── CSharp-MVUX
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── .vsconfig
│ ├── Counter.Base
│ │ ├── AppHead.xaml
│ │ ├── AppHead.xaml.cs
│ │ ├── Counter.Base.csproj
│ │ ├── Icons
│ │ │ ├── icon.svg
│ │ │ └── icon_foreground.svg
│ │ ├── Splash
│ │ │ └── splash_screen.svg
│ │ └── base.props
│ ├── Counter.Mobile
│ │ ├── Android
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── Assets
│ │ │ │ └── AboutAssets.txt
│ │ │ ├── Main.Android.cs
│ │ │ ├── MainActivity.Android.cs
│ │ │ ├── Resources
│ │ │ │ ├── AboutResources.txt
│ │ │ │ └── values
│ │ │ │ │ ├── Strings.xml
│ │ │ │ │ └── Styles.xml
│ │ │ └── environment.conf
│ │ ├── Counter.Mobile.csproj
│ │ ├── MacCatalyst
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.maccatalyst.cs
│ │ │ └── Media.xcassets
│ │ │ │ └── LaunchImages.launchimage
│ │ │ │ └── Contents.json
│ │ └── iOS
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.iOS.cs
│ │ │ └── Media.xcassets
│ │ │ └── LaunchImages.launchimage
│ │ │ └── Contents.json
│ ├── Counter.Skia.Gtk
│ │ ├── Counter.Skia.Gtk.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Program.cs
│ │ └── app.manifest
│ ├── Counter.Wasm
│ │ ├── Counter.Wasm.csproj
│ │ ├── LinkerConfig.xml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── WasmCSS
│ │ │ └── Fonts.css
│ │ ├── WasmScripts
│ │ │ └── AppManifest.js
│ │ ├── manifest.webmanifest
│ │ └── wwwroot
│ │ │ ├── staticwebapp.config.json
│ │ │ └── web.config
│ ├── Counter.Windows
│ │ ├── Counter.Windows.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ ├── PublishProfiles
│ │ │ │ ├── win-arm64.pubxml
│ │ │ │ ├── win-x64.pubxml
│ │ │ │ └── win-x86.pubxml
│ │ │ └── launchsettings.json
│ │ ├── Resources.lang-en-us.resw
│ │ └── app.manifest
│ ├── Counter.sln
│ ├── Counter
│ │ ├── App.cs
│ │ ├── AppResources.cs
│ │ ├── Assets
│ │ │ ├── Icons
│ │ │ │ └── back.svg
│ │ │ ├── SharedAssets.md
│ │ │ └── logo.svg
│ │ ├── Counter.csproj
│ │ ├── GlobalUsings.cs
│ │ ├── MainModel.cs
│ │ ├── MainPage.cs
│ │ └── Strings
│ │ │ └── en
│ │ │ └── Resources.resw
│ ├── Directory.Build.props
│ ├── Directory.Build.targets
│ ├── Directory.Packages.props
│ └── solution-config.props.sample
├── CSharp-MVVM
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── .vsconfig
│ ├── Counter.Base
│ │ ├── AppHead.xaml
│ │ ├── AppHead.xaml.cs
│ │ ├── Counter.Base.csproj
│ │ ├── Icons
│ │ │ ├── icon.svg
│ │ │ └── icon_foreground.svg
│ │ ├── Splash
│ │ │ └── splash_screen.svg
│ │ └── base.props
│ ├── Counter.Mobile
│ │ ├── Android
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── Assets
│ │ │ │ └── AboutAssets.txt
│ │ │ ├── Main.Android.cs
│ │ │ ├── MainActivity.Android.cs
│ │ │ ├── Resources
│ │ │ │ ├── AboutResources.txt
│ │ │ │ └── values
│ │ │ │ │ ├── Strings.xml
│ │ │ │ │ └── Styles.xml
│ │ │ └── environment.conf
│ │ ├── Counter.Mobile.csproj
│ │ ├── MacCatalyst
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.maccatalyst.cs
│ │ │ └── Media.xcassets
│ │ │ │ └── LaunchImages.launchimage
│ │ │ │ └── Contents.json
│ │ └── iOS
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.iOS.cs
│ │ │ └── Media.xcassets
│ │ │ └── LaunchImages.launchimage
│ │ │ └── Contents.json
│ ├── Counter.Skia.Gtk
│ │ ├── Counter.Skia.Gtk.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Program.cs
│ │ └── app.manifest
│ ├── Counter.Wasm
│ │ ├── Counter.Wasm.csproj
│ │ ├── LinkerConfig.xml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── WasmCSS
│ │ │ └── Fonts.css
│ │ ├── WasmScripts
│ │ │ └── AppManifest.js
│ │ ├── manifest.webmanifest
│ │ └── wwwroot
│ │ │ ├── staticwebapp.config.json
│ │ │ └── web.config
│ ├── Counter.Windows
│ │ ├── Counter.Windows.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ ├── PublishProfiles
│ │ │ │ ├── win-arm64.pubxml
│ │ │ │ ├── win-x64.pubxml
│ │ │ │ └── win-x86.pubxml
│ │ │ └── launchsettings.json
│ │ ├── Resources.lang-en-us.resw
│ │ └── app.manifest
│ ├── Counter.sln
│ ├── Counter
│ │ ├── App.cs
│ │ ├── AppResources.cs
│ │ ├── Assets
│ │ │ ├── Icons
│ │ │ │ └── back.svg
│ │ │ ├── SharedAssets.md
│ │ │ └── logo.svg
│ │ ├── Counter.csproj
│ │ ├── GlobalUsings.cs
│ │ ├── MainPage.cs
│ │ ├── MainViewModel.cs
│ │ └── Strings
│ │ │ └── en
│ │ │ └── Resources.resw
│ ├── Directory.Build.props
│ ├── Directory.Build.targets
│ ├── Directory.Packages.props
│ └── solution-config.props.sample
├── XAML-MVUX
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ ├── settings.json
│ │ └── tasks.json
│ ├── .vsconfig
│ ├── Counter.Base
│ │ ├── AppHead.xaml
│ │ ├── AppHead.xaml.cs
│ │ ├── Counter.Base.csproj
│ │ ├── Icons
│ │ │ ├── icon.svg
│ │ │ └── icon_foreground.svg
│ │ ├── Splash
│ │ │ └── splash_screen.svg
│ │ └── base.props
│ ├── Counter.Mobile
│ │ ├── Android
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── Assets
│ │ │ │ └── AboutAssets.txt
│ │ │ ├── Main.Android.cs
│ │ │ ├── MainActivity.Android.cs
│ │ │ ├── Resources
│ │ │ │ ├── AboutResources.txt
│ │ │ │ └── values
│ │ │ │ │ ├── Strings.xml
│ │ │ │ │ └── Styles.xml
│ │ │ └── environment.conf
│ │ ├── Counter.Mobile.csproj
│ │ ├── MacCatalyst
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.maccatalyst.cs
│ │ │ └── Media.xcassets
│ │ │ │ └── LaunchImages.launchimage
│ │ │ │ └── Contents.json
│ │ └── iOS
│ │ │ ├── Entitlements.plist
│ │ │ ├── Info.plist
│ │ │ ├── Main.iOS.cs
│ │ │ └── Media.xcassets
│ │ │ └── LaunchImages.launchimage
│ │ │ └── Contents.json
│ ├── Counter.Skia.Gtk
│ │ ├── Counter.Skia.Gtk.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Program.cs
│ │ └── app.manifest
│ ├── Counter.Wasm
│ │ ├── Counter.Wasm.csproj
│ │ ├── LinkerConfig.xml
│ │ ├── Program.cs
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── WasmCSS
│ │ │ └── Fonts.css
│ │ ├── WasmScripts
│ │ │ └── AppManifest.js
│ │ ├── manifest.webmanifest
│ │ └── wwwroot
│ │ │ ├── staticwebapp.config.json
│ │ │ └── web.config
│ ├── Counter.Windows
│ │ ├── Counter.Windows.csproj
│ │ ├── Package.appxmanifest
│ │ ├── Properties
│ │ │ ├── PublishProfiles
│ │ │ │ ├── win-arm64.pubxml
│ │ │ │ ├── win-x64.pubxml
│ │ │ │ └── win-x86.pubxml
│ │ │ └── launchsettings.json
│ │ ├── Resources.lang-en-us.resw
│ │ └── app.manifest
│ ├── Counter.sln
│ ├── Counter
│ │ ├── App.cs
│ │ ├── AppResources.xaml
│ │ ├── Assets
│ │ │ ├── Icons
│ │ │ │ └── back.svg
│ │ │ ├── SharedAssets.md
│ │ │ └── logo.svg
│ │ ├── Counter.csproj
│ │ ├── GlobalUsings.cs
│ │ ├── MainModel.cs
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ └── Strings
│ │ │ └── en
│ │ │ └── Resources.resw
│ ├── Directory.Build.props
│ ├── Directory.Build.targets
│ ├── Directory.Packages.props
│ └── solution-config.props.sample
└── XAML-MVVM
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .vscode
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
│ ├── .vsconfig
│ ├── Counter.Base
│ ├── AppHead.xaml
│ ├── AppHead.xaml.cs
│ ├── Counter.Base.csproj
│ ├── Icons
│ │ ├── icon.svg
│ │ └── icon_foreground.svg
│ ├── Splash
│ │ └── splash_screen.svg
│ └── base.props
│ ├── Counter.Mobile
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── Assets
│ │ │ └── AboutAssets.txt
│ │ ├── Main.Android.cs
│ │ ├── MainActivity.Android.cs
│ │ ├── Resources
│ │ │ ├── AboutResources.txt
│ │ │ └── values
│ │ │ │ ├── Strings.xml
│ │ │ │ └── Styles.xml
│ │ └── environment.conf
│ ├── Counter.Mobile.csproj
│ ├── MacCatalyst
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.maccatalyst.cs
│ │ └── Media.xcassets
│ │ │ └── LaunchImages.launchimage
│ │ │ └── Contents.json
│ └── iOS
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.iOS.cs
│ │ └── Media.xcassets
│ │ └── LaunchImages.launchimage
│ │ └── Contents.json
│ ├── Counter.Skia.Gtk
│ ├── Counter.Skia.Gtk.csproj
│ ├── Package.appxmanifest
│ ├── Program.cs
│ └── app.manifest
│ ├── Counter.Wasm
│ ├── Counter.Wasm.csproj
│ ├── LinkerConfig.xml
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── WasmCSS
│ │ └── Fonts.css
│ ├── WasmScripts
│ │ └── AppManifest.js
│ ├── manifest.webmanifest
│ └── wwwroot
│ │ ├── staticwebapp.config.json
│ │ └── web.config
│ ├── Counter.Windows
│ ├── Counter.Windows.csproj
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── PublishProfiles
│ │ │ ├── win-arm64.pubxml
│ │ │ ├── win-x64.pubxml
│ │ │ └── win-x86.pubxml
│ │ └── launchsettings.json
│ ├── Resources.lang-en-us.resw
│ └── app.manifest
│ ├── Counter.sln
│ ├── Counter
│ ├── App.cs
│ ├── AppResources.xaml
│ ├── Assets
│ │ ├── Icons
│ │ │ └── back.svg
│ │ ├── SharedAssets.md
│ │ └── logo.svg
│ ├── Counter.csproj
│ ├── GlobalUsings.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── MainViewModel.cs
│ └── Strings
│ │ └── en
│ │ └── Resources.resw
│ ├── Directory.Build.props
│ ├── Directory.Build.targets
│ ├── Directory.Packages.props
│ └── solution-config.props.sample
├── Getting-Started-Tutorial-1
├── UnoSliderDemo.sln
└── UnoSliderDemo
│ ├── .gitignore
│ ├── .vscode
│ ├── launch.json
│ ├── settings.json
│ └── tasks.json
│ ├── .vsconfig
│ ├── Directory.Build.props
│ ├── Directory.Build.targets
│ ├── Directory.Packages.props
│ ├── UnoSliderDemo.Base
│ ├── AppHead.xaml
│ ├── AppHead.xaml.cs
│ ├── Icons
│ │ ├── appconfig.svg
│ │ └── iconapp.svg
│ ├── Splash
│ │ └── splash_screen.svg
│ ├── UnoSliderDemo.Base.csproj
│ └── base.props
│ ├── UnoSliderDemo.Mobile
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── Assets
│ │ │ └── AboutAssets.txt
│ │ ├── Main.Android.cs
│ │ ├── MainActivity.Android.cs
│ │ ├── Resources
│ │ │ ├── AboutResources.txt
│ │ │ └── values
│ │ │ │ ├── Strings.xml
│ │ │ │ └── Styles.xml
│ │ └── environment.conf
│ ├── MacCatalyst
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.maccatalyst.cs
│ │ └── Media.xcassets
│ │ │ └── LaunchImages.launchimage
│ │ │ └── Contents.json
│ ├── UnoSliderDemo.Mobile.csproj
│ └── iOS
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ ├── Main.iOS.cs
│ │ └── Media.xcassets
│ │ └── LaunchImages.launchimage
│ │ └── Contents.json
│ ├── UnoSliderDemo.Skia.Gtk
│ ├── Package.appxmanifest
│ ├── Program.cs
│ ├── UnoSliderDemo.Skia.Gtk.csproj
│ └── app.manifest
│ ├── UnoSliderDemo.Wasm
│ ├── LinkerConfig.xml
│ ├── Program.cs
│ ├── Properties
│ │ └── launchSettings.json
│ ├── UnoSliderDemo.Wasm.csproj
│ ├── WasmCSS
│ │ └── Fonts.css
│ ├── WasmScripts
│ │ └── AppManifest.js
│ ├── manifest.webmanifest
│ └── wwwroot
│ │ ├── staticwebapp.config.json
│ │ └── web.config
│ ├── UnoSliderDemo.Windows
│ ├── Package.appxmanifest
│ ├── Properties
│ │ ├── PublishProfiles
│ │ │ ├── win-arm64.pubxml
│ │ │ ├── win-x64.pubxml
│ │ │ └── win-x86.pubxml
│ │ └── launchsettings.json
│ ├── Resources.lang-en-us.resw
│ ├── UnoSliderDemo.Windows.csproj
│ └── app.manifest
│ ├── UnoSliderDemo
│ ├── App.cs
│ ├── AppResources.xaml
│ ├── Assets
│ │ ├── Icons
│ │ │ └── back.svg
│ │ └── SharedAssets.md
│ ├── GlobalUsings.cs
│ ├── MainPage.xaml
│ ├── MainPage.xaml.cs
│ ├── Strings
│ │ └── en
│ │ │ └── Resources.resw
│ └── UnoSliderDemo.csproj
│ └── solution-config.props.sample
└── Getting-Started-Tutorial-2
├── BugTracker.sln
└── BugTracker
├── .gitignore
├── .vscode
├── launch.json
├── settings.json
└── tasks.json
├── .vsconfig
├── BugTracker.Base
├── AppHead.xaml
├── AppHead.xaml.cs
├── BugTracker.Base.csproj
├── Icons
│ ├── appconfig.svg
│ └── iconapp.svg
├── Splash
│ └── splash_screen.svg
└── base.props
├── BugTracker.Mobile
├── Android
│ ├── AndroidManifest.xml
│ ├── Assets
│ │ └── AboutAssets.txt
│ ├── Main.Android.cs
│ ├── MainActivity.Android.cs
│ ├── Resources
│ │ ├── AboutResources.txt
│ │ └── values
│ │ │ ├── Strings.xml
│ │ │ └── Styles.xml
│ └── environment.conf
├── BugTracker.Mobile.csproj
├── MacCatalyst
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.maccatalyst.cs
│ └── Media.xcassets
│ │ └── LaunchImages.launchimage
│ │ └── Contents.json
└── iOS
│ ├── Entitlements.plist
│ ├── Info.plist
│ ├── Main.iOS.cs
│ └── Media.xcassets
│ └── LaunchImages.launchimage
│ └── Contents.json
├── BugTracker.Skia.Gtk
├── BugTracker.Skia.Gtk.csproj
├── Package.appxmanifest
├── Program.cs
└── app.manifest
├── BugTracker.Wasm
├── BugTracker.Wasm.csproj
├── LinkerConfig.xml
├── Program.cs
├── Properties
│ └── launchSettings.json
├── WasmCSS
│ └── Fonts.css
├── WasmScripts
│ └── AppManifest.js
├── manifest.webmanifest
└── wwwroot
│ ├── staticwebapp.config.json
│ └── web.config
├── BugTracker.Windows
├── BugTracker.Windows.csproj
├── Package.appxmanifest
├── Properties
│ ├── PublishProfiles
│ │ ├── win-arm64.pubxml
│ │ ├── win-x64.pubxml
│ │ └── win-x86.pubxml
│ └── launchsettings.json
├── Resources.lang-en-us.resw
└── app.manifest
├── BugTracker
├── App.cs
├── AppResources.xaml
├── Assets
│ ├── Icons
│ │ └── back.svg
│ └── SharedAssets.md
├── BugTracker.csproj
├── GlobalUsings.cs
├── MainPage.xaml
├── MainPage.xaml.cs
├── Models
│ └── IssueItem.cs
└── Strings
│ └── en
│ └── Resources.resw
├── Directory.Build.props
├── Directory.Build.targets
├── Directory.Packages.props
└── solution-config.props.sample
/src/Counter/CSharp-MVUX/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Base/Counter.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Base/Icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Android.App;
6 | using Android.Content;
7 | using Android.OS;
8 | using Android.Runtime;
9 | using Android.Views;
10 | using Android.Widget;
11 | using Com.Nostra13.Universalimageloader.Core;
12 | using Microsoft.UI.Xaml.Media;
13 |
14 | namespace Counter.Droid
15 | {
16 | [global::Android.App.ApplicationAttribute(
17 | Label = "@string/ApplicationName",
18 | Icon = "@mipmap/icon",
19 | LargeHeap = true,
20 | HardwareAccelerated = true,
21 | Theme = "@style/AppTheme"
22 | )]
23 | public class Application : Microsoft.UI.Xaml.NativeApplication
24 | {
25 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
26 | : base(() => new AppHead(), javaReference, transfer)
27 | {
28 | ConfigureUniversalImageLoader();
29 | }
30 |
31 | private static void ConfigureUniversalImageLoader()
32 | {
33 | // Create global configuration and initialize ImageLoader with this config
34 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
35 | .Builder(Context)
36 | .Build();
37 |
38 | ImageLoader.Instance.Init(config);
39 |
40 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace Counter.Droid
8 | {
9 | [Activity(
10 | MainLauncher = true,
11 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
13 | )]
14 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Counter
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/icon.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.MacCatalyst
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/icon.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.iOS
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Mobile/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "orientation": "portrait",
5 | "extent": "full-screen",
6 | "minimum-system-version": "7.0",
7 | "scale": "2x",
8 | "size": "640x960",
9 | "idiom": "iphone"
10 | },
11 | {
12 | "orientation": "portrait",
13 | "extent": "full-screen",
14 | "minimum-system-version": "7.0",
15 | "subtype": "retina4",
16 | "scale": "2x",
17 | "size": "640x1136",
18 | "idiom": "iphone"
19 | },
20 | {
21 | "orientation": "portrait",
22 | "extent": "full-screen",
23 | "minimum-system-version": "7.0",
24 | "scale": "1x",
25 | "size": "768x1024",
26 | "idiom": "ipad"
27 | },
28 | {
29 | "orientation": "landscape",
30 | "extent": "full-screen",
31 | "minimum-system-version": "7.0",
32 | "scale": "1x",
33 | "size": "1024x768",
34 | "idiom": "ipad"
35 | },
36 | {
37 | "orientation": "portrait",
38 | "extent": "full-screen",
39 | "minimum-system-version": "7.0",
40 | "scale": "2x",
41 | "size": "1536x2048",
42 | "idiom": "ipad"
43 | },
44 | {
45 | "orientation": "landscape",
46 | "extent": "full-screen",
47 | "minimum-system-version": "7.0",
48 | "scale": "2x",
49 | "size": "2048x1536",
50 | "idiom": "ipad"
51 | }
52 | ],
53 | "properties": {},
54 | "info": {
55 | "version": 1,
56 | "author": ""
57 | }
58 | }
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Skia.Gtk/Counter.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using GLib;
3 | using Uno.UI.Runtime.Skia.Gtk;
4 |
5 | namespace Counter.Skia.Gtk
6 | {
7 | public class Program
8 | {
9 | public static void Main(string[] args)
10 | {
11 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
12 | {
13 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
14 | expArgs.ExitApplication = true;
15 | };
16 |
17 | var host = new GtkHost(() => new AppHead());
18 |
19 | host.Run();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Counter.Wasm
2 | {
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "Counter.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5001",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "Counter"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "Counter",
4 | "display": "standalone",
5 | "name": "Counter",
6 | "short_name": "Counter",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Counter.Windows (Unpackaged)": {
4 | "commandName": "Project"
5 | },
6 | "Counter.Windows (Package)": {
7 | "commandName": "MsixPackage"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter/AppResources.cs:
--------------------------------------------------------------------------------
1 | namespace Counter
2 | {
3 | public sealed class AppResources : ResourceDictionary
4 | {
5 | public AppResources()
6 | {
7 | // Load WinUI Resources
8 | this.Build(r => r.Merged(
9 | new XamlControlsResources()));
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | # Shared Assets
2 |
3 | See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
4 |
5 | ## Here is a cheat sheet
6 |
7 | 1. Add the image file to the `Assets` directory of a shared project.
8 | 2. Set the build action to `Content`.
9 | 3. (Recommended) Provide an asset for various scales/dpi
10 |
11 | ### Examples
12 |
13 | ```text
14 | \Assets\Images\logo.scale-100.png
15 | \Assets\Images\logo.scale-200.png
16 | \Assets\Images\logo.scale-400.png
17 |
18 | \Assets\Images\scale-100\logo.png
19 | \Assets\Images\scale-200\logo.png
20 | \Assets\Images\scale-400\logo.png
21 | ```
22 |
23 | ### Table of scales
24 |
25 | | Scale | WinUI | iOS/MacCatalyst | Android |
26 | |-------|:-----------:|:---------------:|:-------:|
27 | | `100` | scale-100 | @1x | mdpi |
28 | | `125` | scale-125 | N/A | N/A |
29 | | `150` | scale-150 | N/A | hdpi |
30 | | `200` | scale-200 | @2x | xhdpi |
31 | | `300` | scale-300 | @3x | xxhdpi |
32 | | `400` | scale-400 | N/A | xxxhdpi |
33 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using System.Collections.Immutable;
2 | global using System.Windows.Input;
3 | global using Microsoft.Extensions.DependencyInjection;
4 | global using Microsoft.Extensions.Logging;
5 | global using Microsoft.UI.Xaml;
6 | global using Microsoft.UI.Xaml.Automation;
7 | global using Microsoft.UI.Xaml.Controls;
8 | global using Microsoft.UI.Xaml.Controls.Primitives;
9 | global using Microsoft.UI.Xaml.Data;
10 | global using Microsoft.UI.Xaml.Media;
11 | global using Microsoft.UI.Xaml.Navigation;
12 | global using Uno.Extensions.Markup;
13 | global using Uno.Themes.Markup;
14 | global using Uno.UI;
15 | global using Windows.ApplicationModel;
16 | global using Windows.Networking.Connectivity;
17 | global using Windows.Storage;
18 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
19 | global using Color = Windows.UI.Color;
20 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Counter/MainModel.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | internal partial record MainModel
4 | {
5 | public IState Count => State.Value(this, () => 0);
6 |
7 | public IState Step => State.Value(this, () => 1);
8 |
9 | public ValueTask IncrementCommand(int Step)
10 | => Count.Update(c => c + Step, CancellationToken.None);
11 | }
12 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVUX/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Base/Counter.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Base/Icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Android.App;
6 | using Android.Content;
7 | using Android.OS;
8 | using Android.Runtime;
9 | using Android.Views;
10 | using Android.Widget;
11 | using Com.Nostra13.Universalimageloader.Core;
12 | using Microsoft.UI.Xaml.Media;
13 |
14 | namespace Counter.Droid;
15 | [global::Android.App.ApplicationAttribute(
16 | Label = "@string/ApplicationName",
17 | Icon = "@mipmap/icon",
18 | LargeHeap = true,
19 | HardwareAccelerated = true,
20 | Theme = "@style/AppTheme"
21 | )]
22 | public class Application : Microsoft.UI.Xaml.NativeApplication
23 | {
24 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
25 | : base(() => new AppHead(), javaReference, transfer)
26 | {
27 | ConfigureUniversalImageLoader();
28 | }
29 |
30 | private static void ConfigureUniversalImageLoader()
31 | {
32 | // Create global configuration and initialize ImageLoader with this config
33 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
34 | .Builder(Context)
35 | .Build();
36 |
37 | ImageLoader.Instance.Init(config);
38 |
39 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace Counter.Droid;
8 | [Activity(
9 | MainLauncher = true,
10 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
11 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
12 | )]
13 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
14 | {
15 | }
16 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Counter
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/icon.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.MacCatalyst;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | public static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/icon.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.iOS;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | public static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Skia.Gtk/Counter.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using GLib;
3 | using Uno.UI.Runtime.Skia.Gtk;
4 |
5 | namespace Counter.Skia.Gtk;
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
11 | {
12 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
13 | expArgs.ExitApplication = true;
14 | };
15 |
16 | var host = new GtkHost(() => new AppHead());
17 |
18 | host.Run();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Counter.Wasm;
2 |
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "Counter.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5001",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "Counter"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "Counter",
4 | "display": "standalone",
5 | "name": "Counter",
6 | "short_name": "Counter",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Counter.Windows (Unpackaged)": {
4 | "commandName": "Project"
5 | },
6 | "Counter.Windows (Package)": {
7 | "commandName": "MsixPackage"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter/AppResources.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | public sealed class AppResources : ResourceDictionary
4 | {
5 | public AppResources()
6 | {
7 | // Load WinUI Resources
8 | this.Build(r => r.Merged(
9 | new XamlControlsResources()));
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | # Shared Assets
2 |
3 | See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
4 |
5 | ## Here is a cheat sheet
6 |
7 | 1. Add the image file to the `Assets` directory of a shared project.
8 | 2. Set the build action to `Content`.
9 | 3. (Recommended) Provide an asset for various scales/dpi
10 |
11 | ### Examples
12 |
13 | ```text
14 | \Assets\Images\logo.scale-100.png
15 | \Assets\Images\logo.scale-200.png
16 | \Assets\Images\logo.scale-400.png
17 |
18 | \Assets\Images\scale-100\logo.png
19 | \Assets\Images\scale-200\logo.png
20 | \Assets\Images\scale-400\logo.png
21 | ```
22 |
23 | ### Table of scales
24 |
25 | | Scale | WinUI | iOS/MacCatalyst | Android |
26 | |-------|:-----------:|:---------------:|:-------:|
27 | | `100` | scale-100 | @1x | mdpi |
28 | | `125` | scale-125 | N/A | N/A |
29 | | `150` | scale-150 | N/A | hdpi |
30 | | `200` | scale-200 | @2x | xhdpi |
31 | | `300` | scale-300 | @3x | xxhdpi |
32 | | `400` | scale-400 | N/A | xxxhdpi |
33 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using System.Collections.Immutable;
2 | global using System.Windows.Input;
3 | global using CommunityToolkit.Mvvm.ComponentModel;
4 | global using CommunityToolkit.Mvvm.Input;
5 | global using Microsoft.Extensions.DependencyInjection;
6 | global using Microsoft.Extensions.Logging;
7 | global using Microsoft.UI.Xaml;
8 | global using Microsoft.UI.Xaml.Automation;
9 | global using Microsoft.UI.Xaml.Controls;
10 | global using Microsoft.UI.Xaml.Controls.Primitives;
11 | global using Microsoft.UI.Xaml.Data;
12 | global using Microsoft.UI.Xaml.Media;
13 | global using Microsoft.UI.Xaml.Navigation;
14 | global using Uno.Extensions.Markup;
15 | global using Uno.Themes.Markup;
16 | global using Uno.UI;
17 | global using Windows.ApplicationModel;
18 | global using Windows.Networking.Connectivity;
19 | global using Windows.Storage;
20 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
21 | global using Color = Windows.UI.Color;
22 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Counter/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | internal partial class MainViewModel : ObservableObject
4 | {
5 | [ObservableProperty]
6 | private int _count = 0;
7 |
8 | [ObservableProperty]
9 | private int _step = 1;
10 |
11 | [RelayCommand]
12 | private void Increment()
13 | => Count += Step;
14 | }
15 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/CSharp-MVVM/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Base/Counter.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Base/Icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Android.App;
6 | using Android.Content;
7 | using Android.OS;
8 | using Android.Runtime;
9 | using Android.Views;
10 | using Android.Widget;
11 | using Com.Nostra13.Universalimageloader.Core;
12 | using Microsoft.UI.Xaml.Media;
13 |
14 | namespace Counter.Droid
15 | {
16 | [global::Android.App.ApplicationAttribute(
17 | Label = "@string/ApplicationName",
18 | Icon = "@mipmap/icon",
19 | LargeHeap = true,
20 | HardwareAccelerated = true,
21 | Theme = "@style/AppTheme"
22 | )]
23 | public class Application : Microsoft.UI.Xaml.NativeApplication
24 | {
25 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
26 | : base(() => new AppHead(), javaReference, transfer)
27 | {
28 | ConfigureUniversalImageLoader();
29 | }
30 |
31 | private static void ConfigureUniversalImageLoader()
32 | {
33 | // Create global configuration and initialize ImageLoader with this config
34 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
35 | .Builder(Context)
36 | .Build();
37 |
38 | ImageLoader.Instance.Init(config);
39 |
40 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace Counter.Droid
8 | {
9 | [Activity(
10 | MainLauncher = true,
11 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
13 | )]
14 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Counter
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/icon.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.MacCatalyst
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/icon.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.iOS
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Mobile/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "orientation": "portrait",
5 | "extent": "full-screen",
6 | "minimum-system-version": "7.0",
7 | "scale": "2x",
8 | "size": "640x960",
9 | "idiom": "iphone"
10 | },
11 | {
12 | "orientation": "portrait",
13 | "extent": "full-screen",
14 | "minimum-system-version": "7.0",
15 | "subtype": "retina4",
16 | "scale": "2x",
17 | "size": "640x1136",
18 | "idiom": "iphone"
19 | },
20 | {
21 | "orientation": "portrait",
22 | "extent": "full-screen",
23 | "minimum-system-version": "7.0",
24 | "scale": "1x",
25 | "size": "768x1024",
26 | "idiom": "ipad"
27 | },
28 | {
29 | "orientation": "landscape",
30 | "extent": "full-screen",
31 | "minimum-system-version": "7.0",
32 | "scale": "1x",
33 | "size": "1024x768",
34 | "idiom": "ipad"
35 | },
36 | {
37 | "orientation": "portrait",
38 | "extent": "full-screen",
39 | "minimum-system-version": "7.0",
40 | "scale": "2x",
41 | "size": "1536x2048",
42 | "idiom": "ipad"
43 | },
44 | {
45 | "orientation": "landscape",
46 | "extent": "full-screen",
47 | "minimum-system-version": "7.0",
48 | "scale": "2x",
49 | "size": "2048x1536",
50 | "idiom": "ipad"
51 | }
52 | ],
53 | "properties": {},
54 | "info": {
55 | "version": 1,
56 | "author": ""
57 | }
58 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Skia.Gtk/Counter.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using GLib;
3 | using Uno.UI.Runtime.Skia.Gtk;
4 |
5 | namespace Counter.Skia.Gtk
6 | {
7 | public class Program
8 | {
9 | public static void Main(string[] args)
10 | {
11 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
12 | {
13 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
14 | expArgs.ExitApplication = true;
15 | };
16 |
17 | var host = new GtkHost(() => new AppHead());
18 |
19 | host.Run();
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Counter.Wasm
2 | {
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "Counter.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5001",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "Counter"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "Counter",
4 | "display": "standalone",
5 | "name": "Counter",
6 | "short_name": "Counter",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Counter.Windows (Unpackaged)": {
4 | "commandName": "Project"
5 | },
6 | "Counter.Windows (Package)": {
7 | "commandName": "MsixPackage"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/AppResources.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | # Shared Assets
2 |
3 | See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
4 |
5 | ## Here is a cheat sheet
6 |
7 | 1. Add the image file to the `Assets` directory of a shared project.
8 | 2. Set the build action to `Content`.
9 | 3. (Recommended) Provide an asset for various scales/dpi
10 |
11 | ### Examples
12 |
13 | ```text
14 | \Assets\Images\logo.scale-100.png
15 | \Assets\Images\logo.scale-200.png
16 | \Assets\Images\logo.scale-400.png
17 |
18 | \Assets\Images\scale-100\logo.png
19 | \Assets\Images\scale-200\logo.png
20 | \Assets\Images\scale-400\logo.png
21 | ```
22 |
23 | ### Table of scales
24 |
25 | | Scale | WinUI | iOS/MacCatalyst | Android |
26 | |-------|:-----------:|:---------------:|:-------:|
27 | | `100` | scale-100 | @1x | mdpi |
28 | | `125` | scale-125 | N/A | N/A |
29 | | `150` | scale-150 | N/A | hdpi |
30 | | `200` | scale-200 | @2x | xhdpi |
31 | | `300` | scale-300 | @3x | xxhdpi |
32 | | `400` | scale-400 | N/A | xxxhdpi |
33 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using System.Collections.Immutable;
2 | global using System.Windows.Input;
3 | global using Microsoft.Extensions.DependencyInjection;
4 | global using Microsoft.Extensions.Logging;
5 | global using Microsoft.UI.Xaml;
6 | global using Microsoft.UI.Xaml.Controls;
7 | global using Microsoft.UI.Xaml.Media;
8 | global using Microsoft.UI.Xaml.Navigation;
9 | global using Uno.UI;
10 | global using Windows.ApplicationModel;
11 | global using Windows.Networking.Connectivity;
12 | global using Windows.Storage;
13 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
14 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/MainModel.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | internal partial record MainModel
4 | {
5 | public IState Count => State.Value(this, () => 0);
6 |
7 | public IState Step => State.Value(this, () => 1);
8 |
9 | public ValueTask IncrementCommand(int Step)
10 | => Count.Update(c => c + Step, CancellationToken.None);
11 | }
12 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
17 |
18 |
24 |
25 |
29 |
30 |
31 |
32 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Counter/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | public sealed partial class MainPage : Page
4 | {
5 | public MainPage()
6 | {
7 | this.InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVUX/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Base/Counter.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Base/Icons/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Android.App;
6 | using Android.Content;
7 | using Android.OS;
8 | using Android.Runtime;
9 | using Android.Views;
10 | using Android.Widget;
11 | using Com.Nostra13.Universalimageloader.Core;
12 | using Microsoft.UI.Xaml.Media;
13 |
14 | namespace Counter.Droid;
15 | [global::Android.App.ApplicationAttribute(
16 | Label = "@string/ApplicationName",
17 | Icon = "@mipmap/icon",
18 | LargeHeap = true,
19 | HardwareAccelerated = true,
20 | Theme = "@style/AppTheme"
21 | )]
22 | public class Application : Microsoft.UI.Xaml.NativeApplication
23 | {
24 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
25 | : base(() => new AppHead(), javaReference, transfer)
26 | {
27 | ConfigureUniversalImageLoader();
28 | }
29 |
30 | private static void ConfigureUniversalImageLoader()
31 | {
32 | // Create global configuration and initialize ImageLoader with this config
33 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
34 | .Builder(Context)
35 | .Build();
36 |
37 | ImageLoader.Instance.Init(config);
38 |
39 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace Counter.Droid;
8 | [Activity(
9 | MainLauncher = true,
10 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
11 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
12 | )]
13 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
14 | {
15 | }
16 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | Counter
5 |
6 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/icon.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.MacCatalyst;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | public static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/icon.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace Counter.iOS;
4 | public class EntryPoint
5 | {
6 | // This is the main entry point of the application.
7 | public static void Main(string[] args)
8 | {
9 | // if you want to use a different Application Delegate class from "AppDelegate"
10 | // you can specify it here.
11 | UIApplication.Main(args, null, typeof(AppHead));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Mobile/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "orientation": "portrait",
5 | "extent": "full-screen",
6 | "minimum-system-version": "7.0",
7 | "scale": "2x",
8 | "size": "640x960",
9 | "idiom": "iphone"
10 | },
11 | {
12 | "orientation": "portrait",
13 | "extent": "full-screen",
14 | "minimum-system-version": "7.0",
15 | "subtype": "retina4",
16 | "scale": "2x",
17 | "size": "640x1136",
18 | "idiom": "iphone"
19 | },
20 | {
21 | "orientation": "portrait",
22 | "extent": "full-screen",
23 | "minimum-system-version": "7.0",
24 | "scale": "1x",
25 | "size": "768x1024",
26 | "idiom": "ipad"
27 | },
28 | {
29 | "orientation": "landscape",
30 | "extent": "full-screen",
31 | "minimum-system-version": "7.0",
32 | "scale": "1x",
33 | "size": "1024x768",
34 | "idiom": "ipad"
35 | },
36 | {
37 | "orientation": "portrait",
38 | "extent": "full-screen",
39 | "minimum-system-version": "7.0",
40 | "scale": "2x",
41 | "size": "1536x2048",
42 | "idiom": "ipad"
43 | },
44 | {
45 | "orientation": "landscape",
46 | "extent": "full-screen",
47 | "minimum-system-version": "7.0",
48 | "scale": "2x",
49 | "size": "2048x1536",
50 | "idiom": "ipad"
51 | }
52 | ],
53 | "properties": {},
54 | "info": {
55 | "version": 1,
56 | "author": ""
57 | }
58 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Skia.Gtk/Counter.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using GLib;
3 | using Uno.UI.Runtime.Skia.Gtk;
4 |
5 | namespace Counter.Skia.Gtk;
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
11 | {
12 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
13 | expArgs.ExitApplication = true;
14 | };
15 |
16 | var host = new GtkHost(() => new AppHead());
17 |
18 | host.Run();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace Counter.Wasm;
2 |
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "Counter.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5001",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "Counter"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "Counter",
4 | "display": "standalone",
5 | "name": "Counter",
6 | "short_name": "Counter",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | Counter
16 | Counter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
16 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Counter.Windows (Unpackaged)": {
4 | "commandName": "Project"
5 | },
6 | "Counter.Windows (Package)": {
7 | "commandName": "MsixPackage"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/AppResources.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | # Shared Assets
2 |
3 | See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
4 |
5 | ## Here is a cheat sheet
6 |
7 | 1. Add the image file to the `Assets` directory of a shared project.
8 | 2. Set the build action to `Content`.
9 | 3. (Recommended) Provide an asset for various scales/dpi
10 |
11 | ### Examples
12 |
13 | ```text
14 | \Assets\Images\logo.scale-100.png
15 | \Assets\Images\logo.scale-200.png
16 | \Assets\Images\logo.scale-400.png
17 |
18 | \Assets\Images\scale-100\logo.png
19 | \Assets\Images\scale-200\logo.png
20 | \Assets\Images\scale-400\logo.png
21 | ```
22 |
23 | ### Table of scales
24 |
25 | | Scale | WinUI | iOS/MacCatalyst | Android |
26 | |-------|:-----------:|:---------------:|:-------:|
27 | | `100` | scale-100 | @1x | mdpi |
28 | | `125` | scale-125 | N/A | N/A |
29 | | `150` | scale-150 | N/A | hdpi |
30 | | `200` | scale-200 | @2x | xhdpi |
31 | | `300` | scale-300 | @3x | xxhdpi |
32 | | `400` | scale-400 | N/A | xxxhdpi |
33 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using System.Collections.Immutable;
2 | global using System.Windows.Input;
3 | global using CommunityToolkit.Mvvm.ComponentModel;
4 | global using CommunityToolkit.Mvvm.Input;
5 | global using Microsoft.Extensions.DependencyInjection;
6 | global using Microsoft.Extensions.Logging;
7 | global using Microsoft.UI.Xaml;
8 | global using Microsoft.UI.Xaml.Controls;
9 | global using Microsoft.UI.Xaml.Media;
10 | global using Microsoft.UI.Xaml.Navigation;
11 | global using Uno.UI;
12 | global using Windows.ApplicationModel;
13 | global using Windows.Networking.Connectivity;
14 | global using Windows.Storage;
15 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
16 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
17 |
18 |
24 |
25 |
29 |
30 |
31 |
32 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | public sealed partial class MainPage : Page
4 | {
5 | public MainPage()
6 | {
7 | this.InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Counter/MainViewModel.cs:
--------------------------------------------------------------------------------
1 | namespace Counter;
2 |
3 | internal partial class MainViewModel : ObservableObject
4 | {
5 | [ObservableProperty]
6 | private int _count = 0;
7 |
8 | [ObservableProperty]
9 | private int _step = 1;
10 |
11 | [RelayCommand]
12 | private void Increment()
13 | => Count += Step;
14 | }
15 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Counter/XAML-MVVM/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Base/Icons/iconapp.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Base/UnoSliderDemo.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content;
3 | using Android.OS;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using Com.Nostra13.Universalimageloader.Core;
8 | using Microsoft.UI.Xaml.Media;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.Linq;
12 | using System.Text;
13 |
14 | namespace UnoSliderDemo.Droid
15 | {
16 | [global::Android.App.ApplicationAttribute(
17 | Label = "@string/ApplicationName",
18 | Icon = "@mipmap/iconapp",
19 | LargeHeap = true,
20 | HardwareAccelerated = true,
21 | Theme = "@style/AppTheme"
22 | )]
23 | public class Application : Microsoft.UI.Xaml.NativeApplication
24 | {
25 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
26 | : base(() => new AppHead(), javaReference, transfer)
27 | {
28 | ConfigureUniversalImageLoader();
29 | }
30 |
31 | private static void ConfigureUniversalImageLoader()
32 | {
33 | // Create global configuration and initialize ImageLoader with this config
34 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
35 | .Builder(Context)
36 | .Build();
37 |
38 | ImageLoader.Instance.Init(config);
39 |
40 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace UnoSliderDemo.Droid
8 | {
9 | [Activity(
10 | MainLauncher = true,
11 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
13 | )]
14 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | UnoSliderDemo
5 |
6 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/iconapp.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace UnoSliderDemo.MacCatalyst
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/iconapp.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace UnoSliderDemo.iOS
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | UnoSliderDemo
16 | UnoSliderDemo
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using GLib;
2 | using Uno.UI.Runtime.Skia.Gtk;
3 |
4 | namespace UnoSliderDemo.Skia.Gtk
5 | {
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
11 | {
12 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
13 | expArgs.ExitApplication = true;
14 | };
15 |
16 | var host = new GtkHost(() => new AppHead());
17 |
18 | host.Run();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Skia.Gtk/UnoSliderDemo.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace UnoSliderDemo.Wasm
2 | {
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "UnoSliderDemo.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5000",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "UnoSliderDemo"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "UnoSliderDemo",
4 | "display": "standalone",
5 | "name": "UnoSliderDemo",
6 | "short_name": "UnoSliderDemo",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | UnoSliderDemo
16 | UnoSliderDemo
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "UnoSliderDemo.Windows (Package)": {
4 | "commandName": "MsixPackage"
5 | },
6 | "UnoSliderDemo.Windows (Unpackaged)": {
7 | "commandName": "Project"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/AppResources.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
2 |
3 | # Here is a cheat sheet:
4 |
5 | 1. Add the image file to the `Assets` directory of a shared project.
6 | 2. Set the build action to `Content`.
7 | 3. (Recommended) Provide an asset for various scales/dpi
8 |
9 | ## Examples
10 |
11 | ```
12 | \Assets\Images\logo.scale-100.png
13 | \Assets\Images\logo.scale-200.png
14 | \Assets\Images\logo.scale-400.png
15 |
16 | \Assets\Images\scale-100\logo.png
17 | \Assets\Images\scale-200\logo.png
18 | \Assets\Images\scale-400\logo.png
19 | ```
20 |
21 | ## Table of scales
22 |
23 | | Scale | UWP | iOS | Android |
24 | |-------|:-----------:|:--------:|:-------:|
25 | | `100` | scale-100 | @1x | mdpi |
26 | | `125` | scale-125 | N/A | N/A |
27 | | `150` | scale-150 | N/A | hdpi |
28 | | `200` | scale-200 | @2x | xhdpi |
29 | | `300` | scale-300 | @3x | xxhdpi |
30 | | `400` | scale-400 | N/A | xxxhdpi |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using Microsoft.Extensions.DependencyInjection;
2 | global using Microsoft.Extensions.Logging;
3 | global using Microsoft.UI.Xaml;
4 | global using Microsoft.UI.Xaml.Controls;
5 | global using Microsoft.UI.Xaml.Media;
6 | global using Microsoft.UI.Xaml.Navigation;
7 | global using System.Collections.Immutable;
8 | global using System.Windows.Input;
9 | global using Windows.ApplicationModel;
10 | global using Windows.Networking.Connectivity;
11 | global using Windows.Storage;
12 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
13 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/UnoSliderDemo/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace UnoSliderDemo
2 | {
3 | public sealed partial class MainPage : Page
4 | {
5 | public MainPage()
6 | {
7 | this.InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-1/UnoSliderDemo/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "explorer.fileNesting.enabled": true,
3 | "explorer.fileNesting.expand": false,
4 | "explorer.fileNesting.patterns": {
5 | "*.xaml": "$(capture).xaml.cs"
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Base/AppHead.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Base/BugTracker.Base.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | false
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Base/Icons/iconapp.svg:
--------------------------------------------------------------------------------
1 |
2 |
43 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Base/base.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | To add cross-platform image assets for your Uno Platform app, use the Assets folder
2 | in the shared project instead. Assets in this folder are Android-only assets.
3 |
4 | Any raw assets you want to be deployed with your application can be placed in
5 | this directory (and child directories) and given a Build Action of "AndroidAsset".
6 |
7 | These files will be deployed with you package and will be accessible using Android's
8 | AssetManager, like this:
9 |
10 | public class ReadAsset : Activity
11 | {
12 | protected override void OnCreate (Bundle bundle)
13 | {
14 | base.OnCreate (bundle);
15 |
16 | InputStream input = Assets.Open ("my_asset.txt");
17 | }
18 | }
19 |
20 | Additionally, some Android functions will automatically load asset files:
21 |
22 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/Main.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content;
3 | using Android.OS;
4 | using Android.Runtime;
5 | using Android.Views;
6 | using Android.Widget;
7 | using Com.Nostra13.Universalimageloader.Core;
8 | using Microsoft.UI.Xaml.Media;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.Linq;
12 | using System.Text;
13 |
14 | namespace BugTracker.Droid
15 | {
16 | [global::Android.App.ApplicationAttribute(
17 | Label = "@string/ApplicationName",
18 | Icon = "@mipmap/iconapp",
19 | LargeHeap = true,
20 | HardwareAccelerated = true,
21 | Theme = "@style/AppTheme"
22 | )]
23 | public class Application : Microsoft.UI.Xaml.NativeApplication
24 | {
25 | public Application(IntPtr javaReference, JniHandleOwnership transfer)
26 | : base(() => new AppHead(), javaReference, transfer)
27 | {
28 | ConfigureUniversalImageLoader();
29 | }
30 |
31 | private static void ConfigureUniversalImageLoader()
32 | {
33 | // Create global configuration and initialize ImageLoader with this config
34 | ImageLoaderConfiguration config = new ImageLoaderConfiguration
35 | .Builder(Context)
36 | .Build();
37 |
38 | ImageLoader.Instance.Init(config);
39 |
40 | ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/MainActivity.Android.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 | using Android.Views;
5 | using Android.Widget;
6 |
7 | namespace BugTracker.Droid
8 | {
9 | [Activity(
10 | MainLauncher = true,
11 | ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12 | WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
13 | )]
14 | public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/Resources/values/Strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Hello World, Click Me!
4 | BugTracker
5 |
6 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/Resources/values/Styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/Android/environment.conf:
--------------------------------------------------------------------------------
1 | # See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
2 | MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 2
8 |
9 | LSApplicationCategoryType
10 | public.app-category.utilities
11 | UISupportedInterfaceOrientations
12 |
13 | UIInterfaceOrientationPortrait
14 | UIInterfaceOrientationLandscapeLeft
15 | UIInterfaceOrientationLandscapeRight
16 |
17 | XSAppIconAssets
18 | Assets.xcassets/iconapp.appiconset
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/MacCatalyst/Main.maccatalyst.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace BugTracker.MacCatalyst
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | armv7
15 | arm64
16 |
17 | UISupportedInterfaceOrientations
18 |
19 | UIInterfaceOrientationPortrait
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | UISupportedInterfaceOrientations~ipad
24 |
25 | UIInterfaceOrientationPortrait
26 | UIInterfaceOrientationPortraitUpsideDown
27 | UIInterfaceOrientationLandscapeLeft
28 | UIInterfaceOrientationLandscapeRight
29 |
30 | UIViewControllerBasedStatusBarAppearance
31 |
32 | XSAppIconAssets
33 | Assets.xcassets/iconapp.appiconset
34 | UIApplicationSupportsIndirectInputEvents
35 |
36 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Mobile/iOS/Main.iOS.cs:
--------------------------------------------------------------------------------
1 | using UIKit;
2 |
3 | namespace BugTracker.iOS
4 | {
5 | public class EntryPoint
6 | {
7 | // This is the main entry point of the application.
8 | public static void Main(string[] args)
9 | {
10 | // if you want to use a different Application Delegate class from "AppDelegate"
11 | // you can specify it here.
12 | UIApplication.Main(args, null, typeof(AppHead));
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Skia.Gtk/BugTracker.Skia.Gtk.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | Exe
5 | net8.0
6 | app.manifest
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Skia.Gtk/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | BugTracker
16 | BugTracker
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Skia.Gtk/Program.cs:
--------------------------------------------------------------------------------
1 | using GLib;
2 | using Uno.UI.Runtime.Skia.Gtk;
3 |
4 | namespace BugTracker.Skia.Gtk
5 | {
6 | public class Program
7 | {
8 | public static void Main(string[] args)
9 | {
10 | ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
11 | {
12 | Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
13 | expArgs.ExitApplication = true;
14 | };
15 |
16 | var host = new GtkHost(() => new AppHead());
17 |
18 | host.Run();
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/LinkerConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/Program.cs:
--------------------------------------------------------------------------------
1 | namespace BugTracker.Wasm
2 | {
3 | public class Program
4 | {
5 | private static App? _app;
6 |
7 | public static int Main(string[] args)
8 | {
9 | Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
10 |
11 | return 0;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:8080",
7 | "sslPort": 0
8 | }
9 | },
10 | "profiles": {
11 | "BugTracker.Wasm": {
12 | "commandName": "Project",
13 | "dotnetRunMessages": true,
14 | "launchBrowser": true,
15 | "applicationUrl": "http://localhost:5000",
16 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
17 | "environmentVariables": {
18 | "ASPNETCORE_ENVIRONMENT": "Development"
19 | }
20 | },
21 | "IIS Express": {
22 | "commandName": "IISExpress",
23 | "launchBrowser": true,
24 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25 | "environmentVariables": {
26 | "ASPNETCORE_ENVIRONMENT": "Development"
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/WasmCSS/Fonts.css:
--------------------------------------------------------------------------------
1 | /**
2 | When adding fonts here, make sure to add them using a base64 data uri, otherwise
3 | fonts loading are delayed, and text may get displayed incorrectly.
4 | */
5 |
6 | /* https://github.com/unoplatform/uno/issues/3954 */
7 | @font-face {
8 | font-family: 'Segoe UI';
9 | src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
10 | }
11 |
12 | @font-face {
13 | font-family: 'Roboto';
14 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
15 | font-weight: 300;
16 | }
17 |
18 | @font-face {
19 | font-family: 'Roboto';
20 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
21 | font-weight: 400;
22 | }
23 |
24 | @font-face {
25 | font-family: 'Roboto';
26 | src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
27 | font-weight: 500;
28 | }
29 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/WasmScripts/AppManifest.js:
--------------------------------------------------------------------------------
1 | var UnoAppManifest = {
2 | displayName: "BugTracker"
3 | }
4 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/manifest.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "background_color": "#ffffff",
3 | "description": "BugTracker",
4 | "display": "standalone",
5 | "name": "BugTracker",
6 | "short_name": "BugTracker",
7 | "start_url": "/index.html",
8 | "theme_color": "#ffffff",
9 | "scope": "/"
10 | }
11 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Wasm/wwwroot/staticwebapp.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationFallback": {
3 | "rewrite": "/index.html",
4 | "exclude": [
5 | "*.{css,js}",
6 | "*.{png}",
7 | "*.{c,h,wasm,clr,pdb,dat,txt}"
8 | ]
9 | },
10 | "routes": [
11 | {
12 | "route": "/package_*",
13 | "headers": {
14 | "cache-control": "public, immutable, max-age=31536000"
15 | }
16 | },
17 | {
18 | "route": "/*.ttf",
19 | "headers": {
20 | "cache-control": "public, immutable, max-age=31536000"
21 | }
22 | },
23 | {
24 | "route": "/*",
25 | "headers": {
26 | "cache-control": "must-revalidate, max-age=3600"
27 | }
28 | }
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
15 | BugTracker
16 | BugTracker
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/Properties/PublishProfiles/win-arm64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | arm64
9 | win-arm64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/Properties/PublishProfiles/win-x64.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x64
9 | win-x64
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/Properties/PublishProfiles/win-x86.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | FileSystem
8 | x86
9 | win-x86
10 | bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
11 | true
12 | False
13 | False
14 | True
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/Properties/launchsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "BugTracker.Windows (Package)": {
4 | "commandName": "MsixPackage"
5 | },
6 | "BugTracker.Windows (Unpackaged)": {
7 | "commandName": "Project"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker.Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 | true/PM
22 | PerMonitorV2, PerMonitor
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker/AppResources.xaml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker/Assets/Icons/back.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker/Assets/SharedAssets.md:
--------------------------------------------------------------------------------
1 | See documentation about assets here : https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md
2 |
3 | # Here is a cheat sheet:
4 |
5 | 1. Add the image file to the `Assets` directory of a shared project.
6 | 2. Set the build action to `Content`.
7 | 3. (Recommended) Provide an asset for various scales/dpi
8 |
9 | ## Examples
10 |
11 | ```
12 | \Assets\Images\logo.scale-100.png
13 | \Assets\Images\logo.scale-200.png
14 | \Assets\Images\logo.scale-400.png
15 |
16 | \Assets\Images\scale-100\logo.png
17 | \Assets\Images\scale-200\logo.png
18 | \Assets\Images\scale-400\logo.png
19 | ```
20 |
21 | ## Table of scales
22 |
23 | | Scale | UWP | iOS | Android |
24 | |-------|:-----------:|:--------:|:-------:|
25 | | `100` | scale-100 | @1x | mdpi |
26 | | `125` | scale-125 | N/A | N/A |
27 | | `150` | scale-150 | N/A | hdpi |
28 | | `200` | scale-200 | @2x | xhdpi |
29 | | `300` | scale-300 | @3x | xxhdpi |
30 | | `400` | scale-400 | N/A | xxxhdpi |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/BugTracker/GlobalUsings.cs:
--------------------------------------------------------------------------------
1 | global using Microsoft.Extensions.DependencyInjection;
2 | global using Microsoft.Extensions.Logging;
3 | global using Microsoft.UI.Xaml;
4 | global using Microsoft.UI.Xaml.Controls;
5 | global using Microsoft.UI.Xaml.Media;
6 | global using Microsoft.UI.Xaml.Navigation;
7 | global using System.Collections.Immutable;
8 | global using System.Windows.Input;
9 | global using Windows.ApplicationModel;
10 | global using Windows.Networking.Connectivity;
11 | global using Windows.Storage;
12 | global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState;
13 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Getting-Started-Tutorial-2/BugTracker/solution-config.props.sample:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------