From e4b49935be1e2007cef61d327ef11422e109818d Mon Sep 17 00:00:00 2001 From: eriklimakc Date: Thu, 9 May 2024 16:49:11 +0100 Subject: [PATCH 1/7] feat: Binding Samples --- UI/BindingSources/CSHARP/.gitattributes | 63 +++ UI/BindingSources/CSHARP/.gitignore | 403 ++++++++++++++++++ UI/BindingSources/CSHARP/.vsconfig | 38 ++ UI/BindingSources/CSHARP/Binding-CSHARP.sln | 36 ++ UI/BindingSources/CSHARP/Binding/App.xaml | 4 + UI/BindingSources/CSHARP/Binding/App.xaml.cs | 138 ++++++ .../CSHARP/Binding/Assets/Icons/icon.svg | 42 ++ .../Binding/Assets/Icons/icon_foreground.svg | 137 ++++++ .../CSHARP/Binding/Assets/SharedAssets.md | 32 ++ .../Binding/Assets/Splash/splash_screen.svg | 137 ++++++ .../CSHARP/Binding/Binding.csproj | 45 ++ .../CSHARP/Binding/GlobalUsings.cs | 5 + UI/BindingSources/CSHARP/Binding/MainPage.cs | 51 +++ .../CSHARP/Binding/MainViewModel.cs | 58 +++ .../CSHARP/Binding/Package.appxmanifest | 43 ++ .../Platforms/Android/AndroidManifest.xml | 4 + .../Platforms/Android/Assets/AboutAssets.txt | 22 + .../Binding/Platforms/Android/Main.Android.cs | 42 ++ .../Platforms/Android/MainActivity.Android.cs | 15 + .../Android/Resources/AboutResources.txt | 47 ++ .../Android/Resources/values/Strings.xml | 5 + .../Android/Resources/values/Styles.xml | 22 + .../Platforms/Android/environment.conf | 2 + .../Binding/Platforms/Desktop/Program.cs | 21 + .../Platforms/MacCatalyst/Entitlements.plist | 6 + .../Binding/Platforms/MacCatalyst/Info.plist | 26 ++ .../Platforms/MacCatalyst/Main.maccatalyst.cs | 13 + .../LaunchImages.launchimage/Contents.json | 58 +++ .../Platforms/WebAssembly/LinkerConfig.xml | 10 + .../Binding/Platforms/WebAssembly/Program.cs | 13 + .../Platforms/WebAssembly/WasmCSS/Fonts.css | 28 ++ .../WebAssembly/WasmScripts/AppManifest.js | 3 + .../WebAssembly/manifest.webmanifest | 10 + .../wwwroot/staticwebapp.config.json | 30 ++ .../Platforms/WebAssembly/wwwroot/web.config | 78 ++++ .../PublishProfiles/win-arm64.pubxml | 22 + .../Properties/PublishProfiles/win-x64.pubxml | 22 + .../Properties/PublishProfiles/win-x86.pubxml | 22 + .../Binding/Platforms/iOS/Entitlements.plist | 6 + .../CSHARP/Binding/Platforms/iOS/Info.plist | 43 ++ .../CSHARP/Binding/Platforms/iOS/Main.iOS.cs | 13 + .../LaunchImages.launchimage/Contents.json | 58 +++ .../Platforms/iOS/PrivacyInfo.xcprivacy | 41 ++ .../Binding/Properties/launchSettings.json | 50 +++ UI/BindingSources/CSHARP/Binding/ReadMe.md | 7 + .../CSHARP/Binding/Strings/en/Resources.resw | 123 ++++++ .../Binding/Styles/ColorPaletteOverride.cs | 44 ++ .../Binding/Styles/MaterialFontsOverride.cs | 13 + UI/BindingSources/CSHARP/Binding/app.manifest | 25 ++ .../CSHARP/Directory.Build.props | 23 + .../CSHARP/Directory.Build.targets | 2 + .../CSHARP/Directory.Packages.props | 9 + UI/BindingSources/CSHARP/global.json | 6 + UI/BindingSources/CSHARP/nuget.config | 12 + UI/BindingSources/XAML/.gitattributes | 63 +++ UI/BindingSources/XAML/.gitignore | 403 ++++++++++++++++++ UI/BindingSources/XAML/.vsconfig | 38 ++ UI/BindingSources/XAML/Binding-XAML.sln | 36 ++ UI/BindingSources/XAML/Binding/App.xaml | 30 ++ UI/BindingSources/XAML/Binding/App.xaml.cs | 129 ++++++ .../XAML/Binding/Assets/Icons/icon.svg | 42 ++ .../Binding/Assets/Icons/icon_foreground.svg | 137 ++++++ .../XAML/Binding/Assets/SharedAssets.md | 32 ++ .../Binding/Assets/Splash/splash_screen.svg | 137 ++++++ UI/BindingSources/XAML/Binding/Binding.csproj | 44 ++ .../XAML/Binding/GlobalUsings.cs | 4 + UI/BindingSources/XAML/Binding/MainPage.xaml | 39 ++ .../XAML/Binding/MainPage.xaml.cs | 9 + .../XAML/Binding/MainViewModel.cs | 58 +++ .../XAML/Binding/Package.appxmanifest | 43 ++ .../Platforms/Android/AndroidManifest.xml | 4 + .../Platforms/Android/Assets/AboutAssets.txt | 22 + .../Binding/Platforms/Android/Main.Android.cs | 42 ++ .../Platforms/Android/MainActivity.Android.cs | 15 + .../Android/Resources/AboutResources.txt | 47 ++ .../Android/Resources/values/Strings.xml | 5 + .../Android/Resources/values/Styles.xml | 22 + .../Platforms/Android/environment.conf | 2 + .../XAML/Binding/Platforms/Desktop/Program.cs | 21 + .../Platforms/MacCatalyst/Entitlements.plist | 6 + .../Binding/Platforms/MacCatalyst/Info.plist | 26 ++ .../Platforms/MacCatalyst/Main.maccatalyst.cs | 13 + .../LaunchImages.launchimage/Contents.json | 58 +++ .../Platforms/WebAssembly/LinkerConfig.xml | 10 + .../Binding/Platforms/WebAssembly/Program.cs | 13 + .../Platforms/WebAssembly/WasmCSS/Fonts.css | 28 ++ .../WebAssembly/WasmScripts/AppManifest.js | 3 + .../WebAssembly/manifest.webmanifest | 10 + .../wwwroot/staticwebapp.config.json | 30 ++ .../Platforms/WebAssembly/wwwroot/web.config | 78 ++++ .../PublishProfiles/win-arm64.pubxml | 22 + .../Properties/PublishProfiles/win-x64.pubxml | 22 + .../Properties/PublishProfiles/win-x86.pubxml | 22 + .../Binding/Platforms/iOS/Entitlements.plist | 6 + .../XAML/Binding/Platforms/iOS/Info.plist | 43 ++ .../XAML/Binding/Platforms/iOS/Main.iOS.cs | 13 + .../LaunchImages.launchimage/Contents.json | 58 +++ .../Platforms/iOS/PrivacyInfo.xcprivacy | 41 ++ .../Binding/Properties/launchSettings.json | 50 +++ UI/BindingSources/XAML/Binding/ReadMe.md | 7 + .../XAML/Binding/Strings/en/Resources.resw | 123 ++++++ .../Binding/Styles/ColorPaletteOverride.xaml | 65 +++ UI/BindingSources/XAML/Binding/app.manifest | 25 ++ UI/BindingSources/XAML/Directory.Build.props | 23 + .../XAML/Directory.Build.targets | 2 + .../XAML/Directory.Packages.props | 9 + UI/BindingSources/XAML/global.json | 6 + UI/BindingSources/XAML/nuget.config | 12 + 108 files changed, 4476 insertions(+) create mode 100644 UI/BindingSources/CSHARP/.gitattributes create mode 100644 UI/BindingSources/CSHARP/.gitignore create mode 100644 UI/BindingSources/CSHARP/.vsconfig create mode 100644 UI/BindingSources/CSHARP/Binding-CSHARP.sln create mode 100644 UI/BindingSources/CSHARP/Binding/App.xaml create mode 100644 UI/BindingSources/CSHARP/Binding/App.xaml.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Assets/Icons/icon.svg create mode 100644 UI/BindingSources/CSHARP/Binding/Assets/Icons/icon_foreground.svg create mode 100644 UI/BindingSources/CSHARP/Binding/Assets/SharedAssets.md create mode 100644 UI/BindingSources/CSHARP/Binding/Assets/Splash/splash_screen.svg create mode 100644 UI/BindingSources/CSHARP/Binding/Binding.csproj create mode 100644 UI/BindingSources/CSHARP/Binding/GlobalUsings.cs create mode 100644 UI/BindingSources/CSHARP/Binding/MainPage.cs create mode 100644 UI/BindingSources/CSHARP/Binding/MainViewModel.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Package.appxmanifest create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/AndroidManifest.xml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/Assets/AboutAssets.txt create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/Main.Android.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/MainActivity.Android.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/AboutResources.txt create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Strings.xml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Styles.xml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Android/environment.conf create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Desktop/Program.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Entitlements.plist create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Info.plist create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Main.maccatalyst.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/LinkerConfig.xml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/Program.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmCSS/Fonts.css create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmScripts/AppManifest.js create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/manifest.webmanifest create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/staticwebapp.config.json create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/web.config create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/iOS/Entitlements.plist create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/iOS/Info.plist create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/iOS/Main.iOS.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json create mode 100644 UI/BindingSources/CSHARP/Binding/Platforms/iOS/PrivacyInfo.xcprivacy create mode 100644 UI/BindingSources/CSHARP/Binding/Properties/launchSettings.json create mode 100644 UI/BindingSources/CSHARP/Binding/ReadMe.md create mode 100644 UI/BindingSources/CSHARP/Binding/Strings/en/Resources.resw create mode 100644 UI/BindingSources/CSHARP/Binding/Styles/ColorPaletteOverride.cs create mode 100644 UI/BindingSources/CSHARP/Binding/Styles/MaterialFontsOverride.cs create mode 100644 UI/BindingSources/CSHARP/Binding/app.manifest create mode 100644 UI/BindingSources/CSHARP/Directory.Build.props create mode 100644 UI/BindingSources/CSHARP/Directory.Build.targets create mode 100644 UI/BindingSources/CSHARP/Directory.Packages.props create mode 100644 UI/BindingSources/CSHARP/global.json create mode 100644 UI/BindingSources/CSHARP/nuget.config create mode 100644 UI/BindingSources/XAML/.gitattributes create mode 100644 UI/BindingSources/XAML/.gitignore create mode 100644 UI/BindingSources/XAML/.vsconfig create mode 100644 UI/BindingSources/XAML/Binding-XAML.sln create mode 100644 UI/BindingSources/XAML/Binding/App.xaml create mode 100644 UI/BindingSources/XAML/Binding/App.xaml.cs create mode 100644 UI/BindingSources/XAML/Binding/Assets/Icons/icon.svg create mode 100644 UI/BindingSources/XAML/Binding/Assets/Icons/icon_foreground.svg create mode 100644 UI/BindingSources/XAML/Binding/Assets/SharedAssets.md create mode 100644 UI/BindingSources/XAML/Binding/Assets/Splash/splash_screen.svg create mode 100644 UI/BindingSources/XAML/Binding/Binding.csproj create mode 100644 UI/BindingSources/XAML/Binding/GlobalUsings.cs create mode 100644 UI/BindingSources/XAML/Binding/MainPage.xaml create mode 100644 UI/BindingSources/XAML/Binding/MainPage.xaml.cs create mode 100644 UI/BindingSources/XAML/Binding/MainViewModel.cs create mode 100644 UI/BindingSources/XAML/Binding/Package.appxmanifest create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/AndroidManifest.xml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/Assets/AboutAssets.txt create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/Main.Android.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/MainActivity.Android.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/Resources/AboutResources.txt create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/Resources/values/Strings.xml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/Resources/values/Styles.xml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Android/environment.conf create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Desktop/Program.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/MacCatalyst/Entitlements.plist create mode 100644 UI/BindingSources/XAML/Binding/Platforms/MacCatalyst/Info.plist create mode 100644 UI/BindingSources/XAML/Binding/Platforms/MacCatalyst/Main.maccatalyst.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/LinkerConfig.xml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/Program.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/WasmCSS/Fonts.css create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/WasmScripts/AppManifest.js create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/manifest.webmanifest create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/wwwroot/staticwebapp.config.json create mode 100644 UI/BindingSources/XAML/Binding/Platforms/WebAssembly/wwwroot/web.config create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml create mode 100644 UI/BindingSources/XAML/Binding/Platforms/iOS/Entitlements.plist create mode 100644 UI/BindingSources/XAML/Binding/Platforms/iOS/Info.plist create mode 100644 UI/BindingSources/XAML/Binding/Platforms/iOS/Main.iOS.cs create mode 100644 UI/BindingSources/XAML/Binding/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json create mode 100644 UI/BindingSources/XAML/Binding/Platforms/iOS/PrivacyInfo.xcprivacy create mode 100644 UI/BindingSources/XAML/Binding/Properties/launchSettings.json create mode 100644 UI/BindingSources/XAML/Binding/ReadMe.md create mode 100644 UI/BindingSources/XAML/Binding/Strings/en/Resources.resw create mode 100644 UI/BindingSources/XAML/Binding/Styles/ColorPaletteOverride.xaml create mode 100644 UI/BindingSources/XAML/Binding/app.manifest create mode 100644 UI/BindingSources/XAML/Directory.Build.props create mode 100644 UI/BindingSources/XAML/Directory.Build.targets create mode 100644 UI/BindingSources/XAML/Directory.Packages.props create mode 100644 UI/BindingSources/XAML/global.json create mode 100644 UI/BindingSources/XAML/nuget.config diff --git a/UI/BindingSources/CSHARP/.gitattributes b/UI/BindingSources/CSHARP/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/UI/BindingSources/CSHARP/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/UI/BindingSources/CSHARP/.gitignore b/UI/BindingSources/CSHARP/.gitignore new file mode 100644 index 000000000..ef88c2053 --- /dev/null +++ b/UI/BindingSources/CSHARP/.gitignore @@ -0,0 +1,403 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# Single Target Config +solution-config.props +# Publish Profiles +!**/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/.vsconfig b/UI/BindingSources/CSHARP/.vsconfig new file mode 100644 index 000000000..7c56eecf7 --- /dev/null +++ b/UI/BindingSources/CSHARP/.vsconfig @@ -0,0 +1,38 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.NetCore.Component.SDK", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.NetCore.Component.Web", + "Microsoft.VisualStudio.Component.IISExpress", + "Component.Microsoft.Web.LibraryManager", + "Microsoft.VisualStudio.ComponentGroup.Web", + "Microsoft.VisualStudio.Component.Web", + "Microsoft.VisualStudio.ComponentGroup.Web.Client", + "Microsoft.VisualStudio.Workload.NetWeb", + "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", + "Microsoft.VisualStudio.Workload.Azure", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.Component.NetFX.Native", + "Microsoft.VisualStudio.Component.Graphics", + "Microsoft.VisualStudio.Component.Merq", + "Component.Xamarin.RemotedSimulator", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.Android.SDK33", + "Component.OpenJDK", + "Microsoft.VisualStudio.Workload.NetCrossPlat", + "Microsoft.VisualStudio.Workload.NetCoreTools" + ] +} diff --git a/UI/BindingSources/CSHARP/Binding-CSHARP.sln b/UI/BindingSources/CSHARP/Binding-CSHARP.sln new file mode 100644 index 000000000..733c9b2f5 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding-CSHARP.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Binding", "Binding\Binding.csproj", "{FA731DD1-5868-4D45-89AC-8203188031CF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{90A94984-C99E-46AB-A331-1E56E42DDCF5}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + global.json = global.json + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FA731DD1-5868-4D45-89AC-8203188031CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA731DD1-5868-4D45-89AC-8203188031CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA731DD1-5868-4D45-89AC-8203188031CF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {FA731DD1-5868-4D45-89AC-8203188031CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA731DD1-5868-4D45-89AC-8203188031CF}.Release|Any CPU.Build.0 = Release|Any CPU + {FA731DD1-5868-4D45-89AC-8203188031CF}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {21BDB7D1-DB08-49C4-9B6D-31046E3A4FBB} + EndGlobalSection +EndGlobal diff --git a/UI/BindingSources/CSHARP/Binding/App.xaml b/UI/BindingSources/CSHARP/Binding/App.xaml new file mode 100644 index 000000000..30d2c1dd7 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/App.xaml @@ -0,0 +1,4 @@ + + diff --git a/UI/BindingSources/CSHARP/Binding/App.xaml.cs b/UI/BindingSources/CSHARP/Binding/App.xaml.cs new file mode 100644 index 000000000..3065bd1b2 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/App.xaml.cs @@ -0,0 +1,138 @@ +using System; +using Microsoft.Extensions.Logging; +using Uno.Resizetizer; + +namespace Binding; +public partial class App : Application +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected Window? MainWindow { get; private set; } + + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + // Load WinUI Resources + Resources.Build(r => r.Merged( + new XamlControlsResources())); + + // Load Uno.UI.Toolkit and Material Resources + Resources.Build(r => r.Merged( + new MaterialToolkitTheme( + new Styles.ColorPaletteOverride(), + new Styles.MaterialFontsOverride()))); + MainWindow = new Window(); +#if DEBUG + MainWindow.EnableHotReload(); +#endif + + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (MainWindow.Content is not Frame rootFrame) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + // Place the frame in the current Window + MainWindow.Content = rootFrame; + + rootFrame.NavigationFailed += OnNavigationFailed; + } + + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), args.Arguments); + } + + MainWindow.SetWindowIcon(); + // Ensure the current window is active + MainWindow.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); + } + + /// + /// Configures global Uno Platform logging + /// + public static void InitializeLogging() + { +#if DEBUG + // Logging is disabled by default for release builds, as it incurs a significant + // initialization cost from Microsoft.Extensions.Logging setup. If startup performance + // is a concern for your application, keep this disabled. If you're running on the web or + // desktop targets, you can use URL or command line parameters to enable it. + // + // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html + + var factory = LoggerFactory.Create(builder => + { +#if __WASM__ + builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider()); +#elif __IOS__ || __MACCATALYST__ + builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider()); +#else + builder.AddConsole(); +#endif + + // Exclude logs below this level + builder.SetMinimumLevel(LogLevel.Information); + + // Default filters for Uno Platform namespaces + builder.AddFilter("Uno", LogLevel.Warning); + builder.AddFilter("Windows", LogLevel.Warning); + builder.AddFilter("Microsoft", LogLevel.Warning); + + // Generic Xaml events + // builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.UIElement", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.FrameworkElement", LogLevel.Trace ); + + // Layouter specific messages + // builder.AddFilter("Microsoft.UI.Xaml.Controls", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Layouter", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Panel", LogLevel.Debug ); + + // builder.AddFilter("Windows.Storage", LogLevel.Debug ); + + // Binding related messages + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + + // Binder memory references tracking + // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug ); + + // DevServer and HotReload related + // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information); + + // Debug JS interop + // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug ); + }); + + global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory; + +#if HAS_UNO + global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize(); +#endif +#endif + } +} diff --git a/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon.svg b/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon.svg new file mode 100644 index 000000000..a15af53aa --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon_foreground.svg b/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon_foreground.svg new file mode 100644 index 000000000..8ffc41ae3 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Assets/Icons/icon_foreground.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Assets/SharedAssets.md b/UI/BindingSources/CSHARP/Binding/Assets/SharedAssets.md new file mode 100644 index 000000000..1b84a74ab --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Assets/SharedAssets.md @@ -0,0 +1,32 @@ +# Shared Assets + +See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +## Here is a cheat sheet + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +### Examples + +```text +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +### Table of scales + +| Scale | WinUI | iOS/MacCatalyst | Android | +|-------|:-----------:|:---------------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | diff --git a/UI/BindingSources/CSHARP/Binding/Assets/Splash/splash_screen.svg b/UI/BindingSources/CSHARP/Binding/Assets/Splash/splash_screen.svg new file mode 100644 index 000000000..8ffc41ae3 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Assets/Splash/splash_screen.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Binding.csproj b/UI/BindingSources/CSHARP/Binding/Binding.csproj new file mode 100644 index 000000000..caeaf2248 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Binding.csproj @@ -0,0 +1,45 @@ + + + + net8.0-android; + net8.0-ios; + net8.0-maccatalyst; + net8.0-windows10.0.19041; + net8.0-desktop; + net8.0-browserwasm; + + + Exe + true + + + Binding + + com.companyname.Binding + + 1.0 + 1 + + + + + + CSharpMarkup; + Material; + Toolkit; + + + + diff --git a/UI/BindingSources/CSHARP/Binding/GlobalUsings.cs b/UI/BindingSources/CSHARP/Binding/GlobalUsings.cs new file mode 100644 index 000000000..60a1f3843 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/GlobalUsings.cs @@ -0,0 +1,5 @@ +global using System.Collections.Immutable; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState; +global using Color = Windows.UI.Color; diff --git a/UI/BindingSources/CSHARP/Binding/MainPage.cs b/UI/BindingSources/CSHARP/Binding/MainPage.cs new file mode 100644 index 000000000..e84ff4b7c --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/MainPage.cs @@ -0,0 +1,51 @@ +namespace Binding; + +public sealed partial class MainPage : Page +{ + public MainPage() + { + this.DataContext(new MainViewModel(), (page, vm) + => page + .Background(Theme.Brushes.Background.Default) + .Content( + new StackPanel() + .VerticalAlignment(VerticalAlignment.Center) + .HorizontalAlignment(HorizontalAlignment.Center) + .Children( + new ListView() + .ItemsSource(() => vm.Items) + .ItemTemplate(item => + new StackPanel() + .Spacing(8) + .Orientation(Orientation.Horizontal) + .Children( + new TextBlock() + .Text(() => item) + .VerticalAlignment(VerticalAlignment.Center), + new Button() + .Content("Delete") + .CommandParameter(() => item) + .Command(x => x.Source(page) + .DataContext() + .Binding(() => vm.RemoveItemCommand)) + ) + .ContextFlyout( + MenuFlyout(item) + ) + ) + ) + ) + ); + } + + private MenuFlyout MenuFlyout(string item) + => new MenuFlyout() + .Items( + new MenuFlyoutItem() + .Text("Delete") + .CommandParameter(() => item) + .Command(x => x.Source(this) + .DataContext() + .Binding(vm => vm.RemoveItemCommand)) + ); +} \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/MainViewModel.cs b/UI/BindingSources/CSHARP/Binding/MainViewModel.cs new file mode 100644 index 000000000..3d6b524f6 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/MainViewModel.cs @@ -0,0 +1,58 @@ +using System.Collections.ObjectModel; +using System.ComponentModel; + +namespace Binding; + +public class MainViewModel : INotifyPropertyChanged +{ + public event PropertyChangedEventHandler? PropertyChanged; + + private ObservableCollection? _items; + public ObservableCollection? Items + { + get { return _items; } + set + { + _items = value; + OnPropertyChanged(nameof(Items)); + } + } + + public ICommand RemoveItemCommand { get; } + + public MainViewModel() + { + Items = + [ + "Item 1", + "Item 2", + "Item 3", + "Item 4" + ]; + + RemoveItemCommand = new RelayCommand(RemoveItem); + } + + private void RemoveItem(object? obj) + { + if (obj is string itemToRemove && Items is { Count: > 0}) + { + Items.Remove(itemToRemove); + } + } + + protected virtual void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } +} + +public class RelayCommand : ICommand +{ + private readonly Action _execute; + public RelayCommand(Action execute) => _execute = execute; + public static ICommand Create(Action execute) => new RelayCommand(execute); + public event EventHandler? CanExecuteChanged; + public bool CanExecute(object? parameter) => true; + public void Execute(object? parameter) => _execute?.Invoke(parameter); +} \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Package.appxmanifest b/UI/BindingSources/CSHARP/Binding/Package.appxmanifest new file mode 100644 index 000000000..0e67c5a9a --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Package.appxmanifest @@ -0,0 +1,43 @@ + + + + + + + + Binding + Binding + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/AndroidManifest.xml b/UI/BindingSources/CSHARP/Binding/Platforms/Android/AndroidManifest.xml new file mode 100644 index 000000000..95ae07533 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/Assets/AboutAssets.txt b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Assets/AboutAssets.txt new file mode 100644 index 000000000..210a93b80 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Assets/AboutAssets.txt @@ -0,0 +1,22 @@ +To add cross-platform image assets for your Uno Platform app, use the Assets folder +in the shared project instead. Assets in this folder are Android-only assets. + +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories) and given a Build Action of "AndroidAsset". + +These files will be deployed with you package and will be accessible using Android's +AssetManager, like this: + +public class ReadAsset : Activity +{ + protected override void OnCreate (Bundle bundle) + { + base.OnCreate (bundle); + + InputStream input = Assets.Open ("my_asset.txt"); + } +} + +Additionally, some Android functions will automatically load asset files: + +Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/Main.Android.cs b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Main.Android.cs new file mode 100644 index 000000000..f56d7fdf4 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Main.Android.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; +using Com.Nostra13.Universalimageloader.Core; +using Microsoft.UI.Xaml.Media; + +namespace Binding.Droid; +[global::Android.App.ApplicationAttribute( + Label = "@string/ApplicationName", + Icon = "@mipmap/icon", + LargeHeap = true, + HardwareAccelerated = true, + Theme = "@style/AppTheme" +)] +public class Application : Microsoft.UI.Xaml.NativeApplication +{ + public Application(IntPtr javaReference, JniHandleOwnership transfer) + : base(() => new App(), javaReference, transfer) + { + ConfigureUniversalImageLoader(); + } + + private static void ConfigureUniversalImageLoader() + { + // Create global configuration and initialize ImageLoader with this config + ImageLoaderConfiguration config = new ImageLoaderConfiguration + .Builder(Context) + .Build(); + + ImageLoader.Instance.Init(config); + + ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync; + } +} + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/MainActivity.Android.cs b/UI/BindingSources/CSHARP/Binding/Platforms/Android/MainActivity.Android.cs new file mode 100644 index 000000000..018be239f --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/MainActivity.Android.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; +using Android.Views; +using Android.Widget; + +namespace Binding.Droid; +[Activity( + MainLauncher = true, + ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges, + WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden +)] +public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity +{ +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/AboutResources.txt b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/AboutResources.txt new file mode 100644 index 000000000..17e3b1333 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/AboutResources.txt @@ -0,0 +1,47 @@ +To add cross-platform image assets for your Uno Platform app, use the Assets folder +in the shared project instead. Resources in this folder are Android-only. + +Images, layout descriptions, binary blobs and string dictionaries can be included +in your application as resource files. Various Android APIs are designed to +operate on the resource IDs instead of dealing with images, strings or binary blobs +directly. + +For example, a sample Android app that contains a user interface layout (main.axml), +an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) +would keep its resources in the "Resources" directory of the application: + +Resources/ + drawable/ + icon.png + + layout/ + main.axml + + values/ + strings.xml + +In order to get the build system to recognize Android resources, set the build action to +"AndroidResource". The native Android APIs do not operate directly with filenames, but +instead operate on resource IDs. When you compile an Android application that uses resources, +the build system will package the resources for distribution and generate a class called "R" +(this is an Android convention) that contains the tokens for each one of the resources +included. For example, for the above Resources layout, this is what the R class would expose: + +public class R { + public class drawable { + public const int icon = 0x123; + } + + public class layout { + public const int main = 0x456; + } + + public class strings { + public const int first_string = 0xabc; + public const int second_string = 0xbcd; + } +} + +You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main +to reference the layout/main.axml file, or R.strings.first_string to reference the first +string in the dictionary file values/strings.xml. diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Strings.xml b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Strings.xml new file mode 100644 index 000000000..cea35ec25 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Strings.xml @@ -0,0 +1,5 @@ + + + Hello World, Click Me! + Binding + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Styles.xml b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Styles.xml new file mode 100644 index 000000000..c02bd06f7 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/Resources/values/Styles.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Android/environment.conf b/UI/BindingSources/CSHARP/Binding/Platforms/Android/environment.conf new file mode 100644 index 000000000..fa6c2e32b --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Android/environment.conf @@ -0,0 +1,2 @@ +# See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/ +MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Desktop/Program.cs b/UI/BindingSources/CSHARP/Binding/Platforms/Desktop/Program.cs new file mode 100644 index 000000000..51b787c23 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Desktop/Program.cs @@ -0,0 +1,21 @@ +using Uno.UI.Runtime.Skia; + +namespace Binding; +public class Program +{ + [STAThread] + public static void Main(string[] args) + { + App.InitializeLogging(); + + var host = SkiaHostBuilder.Create() + .App(() => new App()) + .UseX11() + .UseLinuxFrameBuffer() + .UseMacOS() + .UseWindows() + .Build(); + + host.Run(); + } +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Entitlements.plist b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 000000000..24c310368 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Info.plist b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Info.plist new file mode 100644 index 000000000..1bb02ddcd --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,26 @@ + + + + + UIDeviceFamily + + 2 + + LSApplicationCategoryType + public.app-category.utilities + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/icon.appiconset + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Main.maccatalyst.cs b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Main.maccatalyst.cs new file mode 100644 index 000000000..ee7547003 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Main.maccatalyst.cs @@ -0,0 +1,13 @@ +using UIKit; + +namespace Binding.MacCatalyst; +public class EntryPoint +{ + // This is the main entry point of the application. + public static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(App)); + } +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json new file mode 100644 index 000000000..69555e440 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/MacCatalyst/Media.xcassets/LaunchImages.launchimage/Contents.json @@ -0,0 +1,58 @@ +{ + "images": [ + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "640x960", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "subtype": "retina4", + "scale": "2x", + "size": "640x1136", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "1x", + "size": "768x1024", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "1x", + "size": "1024x768", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "1536x2048", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "2048x1536", + "idiom": "ipad" + } + ], + "properties": {}, + "info": { + "version": 1, + "author": "" + } +} \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/LinkerConfig.xml b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/LinkerConfig.xml new file mode 100644 index 000000000..36cb46f59 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/LinkerConfig.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/Program.cs b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/Program.cs new file mode 100644 index 000000000..2943dba7b --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/Program.cs @@ -0,0 +1,13 @@ +namespace Binding; + +public class Program +{ + private static App? _app; + + public static int Main(string[] args) + { + Microsoft.UI.Xaml.Application.Start(_ => _app = new App()); + + return 0; + } +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmCSS/Fonts.css b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmCSS/Fonts.css new file mode 100644 index 000000000..4fdd60555 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmCSS/Fonts.css @@ -0,0 +1,28 @@ +/** + When adding fonts here, make sure to add them using a base64 data uri, otherwise + fonts loading are delayed, and text may get displayed incorrectly. +*/ + +/* https://github.com/unoplatform/uno/issues/3954 */ +@font-face { + font-family: 'Segoe UI'; + 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'); +} + +@font-face { + font-family: 'Roboto'; + src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype'); + font-weight: 300; +} + +@font-face { + font-family: 'Roboto'; + src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype'); + font-weight: 400; +} + +@font-face { + font-family: 'Roboto'; + src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype'); + font-weight: 500; +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmScripts/AppManifest.js b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmScripts/AppManifest.js new file mode 100644 index 000000000..9202e173c --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/WasmScripts/AppManifest.js @@ -0,0 +1,3 @@ +var UnoAppManifest = { + displayName: "Binding" +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/manifest.webmanifest b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/manifest.webmanifest new file mode 100644 index 000000000..d5f4727bf --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/manifest.webmanifest @@ -0,0 +1,10 @@ +{ + "background_color": "#ffffff", + "description": "Binding", + "display": "standalone", + "name": "Binding", + "short_name": "Binding", + "start_url": "/index.html", + "theme_color": "#ffffff", + "scope": "/" +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/staticwebapp.config.json b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/staticwebapp.config.json new file mode 100644 index 000000000..79c1b17c4 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/staticwebapp.config.json @@ -0,0 +1,30 @@ +{ + "navigationFallback": { + "rewrite": "/index.html", + "exclude": [ + "*.{css,js}", + "*.{png}", + "*.{c,h,wasm,clr,pdb,dat,txt}" + ] + }, + "routes": [ + { + "route": "/package_*", + "headers": { + "cache-control": "public, immutable, max-age=31536000" + } + }, + { + "route": "/*.ttf", + "headers": { + "cache-control": "public, immutable, max-age=31536000" + } + }, + { + "route": "/*", + "headers": { + "cache-control": "must-revalidate, max-age=3600" + } + } + ] +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/web.config b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/web.config new file mode 100644 index 000000000..8f5a860f5 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/WebAssembly/wwwroot/web.config @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml new file mode 100644 index 000000000..d5147f103 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-arm64.pubxml @@ -0,0 +1,22 @@ + + + + + FileSystem + arm64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + False + True + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 000000000..4fea954ee --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,22 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + False + True + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 000000000..928cb25eb --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/Windows/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,22 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + False + True + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Entitlements.plist b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Entitlements.plist new file mode 100644 index 000000000..24c310368 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Info.plist b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Info.plist new file mode 100644 index 000000000..ea3dcb4bc --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Info.plist @@ -0,0 +1,43 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + armv7 + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + XSAppIconAssets + Assets.xcassets/icon.appiconset + UIApplicationSupportsIndirectInputEvents + + + + + diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Main.iOS.cs b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Main.iOS.cs new file mode 100644 index 000000000..2ca439f59 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Main.iOS.cs @@ -0,0 +1,13 @@ +using UIKit; + +namespace Binding.iOS; +public class EntryPoint +{ + // This is the main entry point of the application. + public static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(App)); + } +} diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json new file mode 100644 index 000000000..69555e440 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/Media.xcassets/LaunchImages.launchimage/Contents.json @@ -0,0 +1,58 @@ +{ + "images": [ + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "640x960", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "subtype": "retina4", + "scale": "2x", + "size": "640x1136", + "idiom": "iphone" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "1x", + "size": "768x1024", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "1x", + "size": "1024x768", + "idiom": "ipad" + }, + { + "orientation": "portrait", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "1536x2048", + "idiom": "ipad" + }, + { + "orientation": "landscape", + "extent": "full-screen", + "minimum-system-version": "7.0", + "scale": "2x", + "size": "2048x1536", + "idiom": "ipad" + } + ], + "properties": {}, + "info": { + "version": 1, + "author": "" + } +} \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Platforms/iOS/PrivacyInfo.xcprivacy b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/PrivacyInfo.xcprivacy new file mode 100644 index 000000000..902abb059 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Platforms/iOS/PrivacyInfo.xcprivacy @@ -0,0 +1,41 @@ + + + + + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + + + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryUserDefaults + NSPrivacyAccessedAPITypeReasons + + CA92.1 + + + diff --git a/UI/BindingSources/CSHARP/Binding/Properties/launchSettings.json b/UI/BindingSources/CSHARP/Binding/Properties/launchSettings.json new file mode 100644 index 000000000..cec44aa78 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Properties/launchSettings.json @@ -0,0 +1,50 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:8080", + "sslPort": 0 + } + }, + "profiles": { + // This profile is first in order for dotnet run to pick it up by default + "Binding (WebAssembly)": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "http://localhost:5000", + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Binding (WebAssembly IIS Express)": { + "commandName": "IISExpress", + "launchBrowser": true, + "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + // Note: In order to select this profile, you'll need to comment the `Packaged` profile below until this is fixed: https://aka.platform.uno/wasdk-maui-debug-profile-issue + "Binding (WinAppSDK Unpackaged)": { + "commandName": "Project", + "compatibleTargetFramework": "windows" + }, + "Binding (WinAppSDK Packaged)": { + "commandName": "MsixPackage", + "compatibleTargetFramework": "windows" + }, + "Binding (Desktop)": { + "commandName": "Project", + "compatibleTargetFramework": "desktop" + }, + "Binding (Desktop WSL2)": { + "commandName": "WSL2", + "commandLineArgs": "{ProjectDir}/bin/Debug/net8.0-desktop/Binding.dll", + "distributionName": "", + "compatibleTargetFramework": "desktop" + } + } +} diff --git a/UI/BindingSources/CSHARP/Binding/ReadMe.md b/UI/BindingSources/CSHARP/Binding/ReadMe.md new file mode 100644 index 000000000..93482da23 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/ReadMe.md @@ -0,0 +1,7 @@ +# Getting Started + +Welcome to the Uno Platform! + +To discover how to get started with your new app: https://aka.platform.uno/get-started + +For more information on how to use the Uno.Sdk or upgrade Uno Platform packages in your solution: https://aka.platform.uno/using-uno-sdk \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Strings/en/Resources.resw b/UI/BindingSources/CSHARP/Binding/Strings/en/Resources.resw new file mode 100644 index 000000000..5f17e6302 --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Strings/en/Resources.resw @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Binding-en + + diff --git a/UI/BindingSources/CSHARP/Binding/Styles/ColorPaletteOverride.cs b/UI/BindingSources/CSHARP/Binding/Styles/ColorPaletteOverride.cs new file mode 100644 index 000000000..8c12d348f --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Styles/ColorPaletteOverride.cs @@ -0,0 +1,44 @@ +// This file is generated by a tool from the file ColorPaletteOverride.zip -- YOU SHOULD NOT EDIT IT manually. +using Uno.Extensions.Markup; + +namespace Binding.Styles; +public sealed partial class ColorPaletteOverride : ResourceDictionary +{ + public ColorPaletteOverride() + { + this.Build + ( + r => r + .Add(Uno.Themes.Markup.Theme.Colors.Primary.Default, light: "#5946D2", dark: "#C7BFFF") + .Add(Uno.Themes.Markup.Theme.Colors.Primary.Inverse, light: "#C8BFFF", dark: "#2A009F") + .Add(Uno.Themes.Markup.Theme.Colors.Primary.Container, light: "#E5DEFF", dark: "#4129BA") + .Add(Uno.Themes.Markup.Theme.Colors.OnPrimary.Default, light: "#FFFFFF", dark: "#2A009F") + .Add(Uno.Themes.Markup.Theme.Colors.OnPrimary.Container, light: "#170065", dark: "#E4DFFF") + .Add(Uno.Themes.Markup.Theme.Colors.Secondary.Default, light: "#6B4EA2", dark: "#CDC2DC") + .Add(Uno.Themes.Markup.Theme.Colors.Secondary.Container, light: "#EBDDFF", dark: "#433C52") + .Add(Uno.Themes.Markup.Theme.Colors.OnSecondary.Default, light: "#FFFFFF", dark: "#332D41") + .Add(Uno.Themes.Markup.Theme.Colors.OnSecondary.Container, light: "#220555", dark: "#EDDFFF") + .Add(Uno.Themes.Markup.Theme.Colors.Tertiary.Default, light: "#0061A4", dark: "#9FCAFF") + .Add(Uno.Themes.Markup.Theme.Colors.Tertiary.Container, light: "#CFE4FF", dark: "#00497D") + .Add(Uno.Themes.Markup.Theme.Colors.OnTertiary.Default, light: "#FFFFFF", dark: "#003258") + .Add(Uno.Themes.Markup.Theme.Colors.OnTertiary.Container, light: "#001D36", dark: "#D1E4FF") + .Add(Uno.Themes.Markup.Theme.Colors.Error.Default, light: "#B3261E", dark: "#FFB4AB") + .Add(Uno.Themes.Markup.Theme.Colors.Error.Container, light: "#F9DEDC", dark: "#93000A") + .Add(Uno.Themes.Markup.Theme.Colors.OnError.Default, light: "#FFFFFF", dark: "#690005") + .Add(Uno.Themes.Markup.Theme.Colors.OnError.Container, light: "#410E0B", dark: "#FFDAD6") + .Add(Uno.Themes.Markup.Theme.Colors.Background.Default, light: "#FCFBFF", dark: "#1C1B1F") + .Add(Uno.Themes.Markup.Theme.Colors.OnBackground.Default, light: "#1C1B1F", dark: "#E5E1E6") + .Add(Uno.Themes.Markup.Theme.Colors.Surface.Default, light: "#FFFFFF", dark: "#302D37") + .Add(Uno.Themes.Markup.Theme.Colors.Surface.Variant, light: "#F2EFF5", dark: "#47464F") + .Add(Uno.Themes.Markup.Theme.Colors.Surface.Inverse, light: "#313033", dark: "#E6E1E5") + .Add(Uno.Themes.Markup.Theme.Colors.Surface.Tint, light: "#5946D2", dark: "#C7BFFF") + .Add(Uno.Themes.Markup.Theme.Colors.OnSurface.Default, light: "#1C1B1F", dark: "#E6E1E5") + .Add(Uno.Themes.Markup.Theme.Colors.OnSurface.Variant, light: "#8B8494", dark: "#C9C5D0") + .Add(Uno.Themes.Markup.Theme.Colors.OnSurface.Inverse, light: "#F4EFF4", dark: "#1C1B1F") + .Add(Uno.Themes.Markup.Theme.Colors.Outline.Default, light: "#79747E", dark: "#928F99") + .Add(Uno.Themes.Markup.Theme.Colors.Outline.Variant, light: "#C9C5D0", dark: "#57545D") +) + ; + + } +} \ No newline at end of file diff --git a/UI/BindingSources/CSHARP/Binding/Styles/MaterialFontsOverride.cs b/UI/BindingSources/CSHARP/Binding/Styles/MaterialFontsOverride.cs new file mode 100644 index 000000000..b675e34ce --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/Styles/MaterialFontsOverride.cs @@ -0,0 +1,13 @@ +namespace Binding.Styles; + +public sealed class MaterialFontsOverride : ResourceDictionary +{ + public MaterialFontsOverride() + { + // NOTE: You can override the default Roboto font by providing your font assets here. + // this.Build(r => r + // .Add("MaterialLightFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Light.ttf#Roboto") + // .Add("MaterialMediumFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Medium.ttf#Roboto") + // .Add("MaterialRegularFontFamily", "ms-appx:///Uno.Fonts.Roboto/Fonts/Material/Roboto-Regular.ttf#Roboto")); + } +} diff --git a/UI/BindingSources/CSHARP/Binding/app.manifest b/UI/BindingSources/CSHARP/Binding/app.manifest new file mode 100644 index 000000000..f4ad42a6c --- /dev/null +++ b/UI/BindingSources/CSHARP/Binding/app.manifest @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/UI/BindingSources/CSHARP/Directory.Build.props b/UI/BindingSources/CSHARP/Directory.Build.props new file mode 100644 index 000000000..bbf79e251 --- /dev/null +++ b/UI/BindingSources/CSHARP/Directory.Build.props @@ -0,0 +1,23 @@ + + + enable + enable + true + + + $(NoWarn);NU1507;NETSDK1201;PRI257 + + + + + 4.1.21 + 6.0.18 + 5.0.13 + 5.2.13 + + diff --git a/UI/BindingSources/CSHARP/Directory.Build.targets b/UI/BindingSources/CSHARP/Directory.Build.targets new file mode 100644 index 000000000..f75adf7e4 --- /dev/null +++ b/UI/BindingSources/CSHARP/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/UI/BindingSources/CSHARP/Directory.Packages.props b/UI/BindingSources/CSHARP/Directory.Packages.props new file mode 100644 index 000000000..0cea764d8 --- /dev/null +++ b/UI/BindingSources/CSHARP/Directory.Packages.props @@ -0,0 +1,9 @@ + + + + + diff --git a/UI/BindingSources/CSHARP/global.json b/UI/BindingSources/CSHARP/global.json new file mode 100644 index 000000000..77eedc60c --- /dev/null +++ b/UI/BindingSources/CSHARP/global.json @@ -0,0 +1,6 @@ +{ + // To update the version of Uno please update the version of the Uno.Sdk here. See https://aka.platform.uno/upgrade-uno-packages for more information. + "msbuild-sdks": { + "Uno.Sdk": "5.2.112" + } +} diff --git a/UI/BindingSources/CSHARP/nuget.config b/UI/BindingSources/CSHARP/nuget.config new file mode 100644 index 000000000..3242ec407 --- /dev/null +++ b/UI/BindingSources/CSHARP/nuget.config @@ -0,0 +1,12 @@ + + + + + + + diff --git a/UI/BindingSources/XAML/.gitattributes b/UI/BindingSources/XAML/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/UI/BindingSources/XAML/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/UI/BindingSources/XAML/.gitignore b/UI/BindingSources/XAML/.gitignore new file mode 100644 index 000000000..ef88c2053 --- /dev/null +++ b/UI/BindingSources/XAML/.gitignore @@ -0,0 +1,403 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +# Single Target Config +solution-config.props +# Publish Profiles +!**/Properties/PublishProfiles/*.pubxml \ No newline at end of file diff --git a/UI/BindingSources/XAML/.vsconfig b/UI/BindingSources/XAML/.vsconfig new file mode 100644 index 000000000..7c56eecf7 --- /dev/null +++ b/UI/BindingSources/XAML/.vsconfig @@ -0,0 +1,38 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Component.CoreEditor", + "Microsoft.VisualStudio.Workload.CoreEditor", + "Microsoft.NetCore.Component.SDK", + "Microsoft.NetCore.Component.DevelopmentTools", + "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", + "Microsoft.VisualStudio.Component.TextTemplating", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions", + "Microsoft.NetCore.Component.Web", + "Microsoft.VisualStudio.Component.IISExpress", + "Component.Microsoft.Web.LibraryManager", + "Microsoft.VisualStudio.ComponentGroup.Web", + "Microsoft.VisualStudio.Component.Web", + "Microsoft.VisualStudio.ComponentGroup.Web.Client", + "Microsoft.VisualStudio.Workload.NetWeb", + "Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites", + "Microsoft.VisualStudio.Workload.Azure", + "Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine", + "Microsoft.VisualStudio.Component.Windows10SDK.19041", + "Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging", + "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", + "Microsoft.VisualStudio.Component.Debugger.JustInTime", + "Microsoft.VisualStudio.Workload.ManagedDesktop", + "Microsoft.Component.NetFX.Native", + "Microsoft.VisualStudio.Component.Graphics", + "Microsoft.VisualStudio.Component.Merq", + "Component.Xamarin.RemotedSimulator", + "Microsoft.VisualStudio.Component.MonoDebugger", + "Microsoft.VisualStudio.ComponentGroup.Maui.All", + "Component.Android.SDK34", + "Component.Android.SDK33", + "Component.OpenJDK", + "Microsoft.VisualStudio.Workload.NetCrossPlat", + "Microsoft.VisualStudio.Workload.NetCoreTools" + ] +} diff --git a/UI/BindingSources/XAML/Binding-XAML.sln b/UI/BindingSources/XAML/Binding-XAML.sln new file mode 100644 index 000000000..7fd1070fb --- /dev/null +++ b/UI/BindingSources/XAML/Binding-XAML.sln @@ -0,0 +1,36 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Binding", "Binding\Binding.csproj", "{C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{726E42F8-A887-4F5A-A6C5-3199665CA684}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + global.json = global.json + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Release|Any CPU.Build.0 = Release|Any CPU + {C7169E40-1CB1-4242-AA6D-8D72A1EDC21E}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {ACB69401-ACCB-4E67-B297-9D60B7DCAF9F} + EndGlobalSection +EndGlobal diff --git a/UI/BindingSources/XAML/Binding/App.xaml b/UI/BindingSources/XAML/Binding/App.xaml new file mode 100644 index 000000000..ee8f8f87f --- /dev/null +++ b/UI/BindingSources/XAML/Binding/App.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/XAML/Binding/App.xaml.cs b/UI/BindingSources/XAML/Binding/App.xaml.cs new file mode 100644 index 000000000..e3eb74e5c --- /dev/null +++ b/UI/BindingSources/XAML/Binding/App.xaml.cs @@ -0,0 +1,129 @@ +using System; +using Microsoft.Extensions.Logging; +using Uno.Resizetizer; + +namespace Binding; +public partial class App : Application +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected Window? MainWindow { get; private set; } + + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + MainWindow = new Window(); +#if DEBUG + MainWindow.EnableHotReload(); +#endif + + + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (MainWindow.Content is not Frame rootFrame) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + // Place the frame in the current Window + MainWindow.Content = rootFrame; + + rootFrame.NavigationFailed += OnNavigationFailed; + } + + if (rootFrame.Content == null) + { + // When the navigation stack isn't restored navigate to the first page, + // configuring the new page by passing required information as a navigation + // parameter + rootFrame.Navigate(typeof(MainPage), args.Arguments); + } + + MainWindow.SetWindowIcon(); + // Ensure the current window is active + MainWindow.Activate(); + } + + /// + /// Invoked when Navigation to a certain page fails + /// + /// The Frame which failed navigation + /// Details about the navigation failure + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new InvalidOperationException($"Failed to load {e.SourcePageType.FullName}: {e.Exception}"); + } + + /// + /// Configures global Uno Platform logging + /// + public static void InitializeLogging() + { +#if DEBUG + // Logging is disabled by default for release builds, as it incurs a significant + // initialization cost from Microsoft.Extensions.Logging setup. If startup performance + // is a concern for your application, keep this disabled. If you're running on the web or + // desktop targets, you can use URL or command line parameters to enable it. + // + // For more performance documentation: https://platform.uno/docs/articles/Uno-UI-Performance.html + + var factory = LoggerFactory.Create(builder => + { +#if __WASM__ + builder.AddProvider(new global::Uno.Extensions.Logging.WebAssembly.WebAssemblyConsoleLoggerProvider()); +#elif __IOS__ || __MACCATALYST__ + builder.AddProvider(new global::Uno.Extensions.Logging.OSLogLoggerProvider()); +#else + builder.AddConsole(); +#endif + + // Exclude logs below this level + builder.SetMinimumLevel(LogLevel.Information); + + // Default filters for Uno Platform namespaces + builder.AddFilter("Uno", LogLevel.Warning); + builder.AddFilter("Windows", LogLevel.Warning); + builder.AddFilter("Microsoft", LogLevel.Warning); + + // Generic Xaml events + // builder.AddFilter("Microsoft.UI.Xaml", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.VisualStateGroup", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.StateTriggerBase", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.UIElement", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.FrameworkElement", LogLevel.Trace ); + + // Layouter specific messages + // builder.AddFilter("Microsoft.UI.Xaml.Controls", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Layouter", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Controls.Panel", LogLevel.Debug ); + + // builder.AddFilter("Windows.Storage", LogLevel.Debug ); + + // Binding related messages + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + // builder.AddFilter("Microsoft.UI.Xaml.Data", LogLevel.Debug ); + + // Binder memory references tracking + // builder.AddFilter("Uno.UI.DataBinding.BinderReferenceHolder", LogLevel.Debug ); + + // DevServer and HotReload related + // builder.AddFilter("Uno.UI.RemoteControl", LogLevel.Information); + + // Debug JS interop + // builder.AddFilter("Uno.Foundation.WebAssemblyRuntime", LogLevel.Debug ); + }); + + global::Uno.Extensions.LogExtensionPoint.AmbientLoggerFactory = factory; + +#if HAS_UNO + global::Uno.UI.Adapter.Microsoft.Extensions.Logging.LoggingAdapter.Initialize(); +#endif +#endif + } +} diff --git a/UI/BindingSources/XAML/Binding/Assets/Icons/icon.svg b/UI/BindingSources/XAML/Binding/Assets/Icons/icon.svg new file mode 100644 index 000000000..a15af53aa --- /dev/null +++ b/UI/BindingSources/XAML/Binding/Assets/Icons/icon.svg @@ -0,0 +1,42 @@ + + + + + + diff --git a/UI/BindingSources/XAML/Binding/Assets/Icons/icon_foreground.svg b/UI/BindingSources/XAML/Binding/Assets/Icons/icon_foreground.svg new file mode 100644 index 000000000..8ffc41ae3 --- /dev/null +++ b/UI/BindingSources/XAML/Binding/Assets/Icons/icon_foreground.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/XAML/Binding/Assets/SharedAssets.md b/UI/BindingSources/XAML/Binding/Assets/SharedAssets.md new file mode 100644 index 000000000..1b84a74ab --- /dev/null +++ b/UI/BindingSources/XAML/Binding/Assets/SharedAssets.md @@ -0,0 +1,32 @@ +# Shared Assets + +See documentation about assets here: https://github.com/unoplatform/uno/blob/master/doc/articles/features/working-with-assets.md + +## Here is a cheat sheet + +1. Add the image file to the `Assets` directory of a shared project. +2. Set the build action to `Content`. +3. (Recommended) Provide an asset for various scales/dpi + +### Examples + +```text +\Assets\Images\logo.scale-100.png +\Assets\Images\logo.scale-200.png +\Assets\Images\logo.scale-400.png + +\Assets\Images\scale-100\logo.png +\Assets\Images\scale-200\logo.png +\Assets\Images\scale-400\logo.png +``` + +### Table of scales + +| Scale | WinUI | iOS/MacCatalyst | Android | +|-------|:-----------:|:---------------:|:-------:| +| `100` | scale-100 | @1x | mdpi | +| `125` | scale-125 | N/A | N/A | +| `150` | scale-150 | N/A | hdpi | +| `200` | scale-200 | @2x | xhdpi | +| `300` | scale-300 | @3x | xxhdpi | +| `400` | scale-400 | N/A | xxxhdpi | diff --git a/UI/BindingSources/XAML/Binding/Assets/Splash/splash_screen.svg b/UI/BindingSources/XAML/Binding/Assets/Splash/splash_screen.svg new file mode 100644 index 000000000..8ffc41ae3 --- /dev/null +++ b/UI/BindingSources/XAML/Binding/Assets/Splash/splash_screen.svg @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UI/BindingSources/XAML/Binding/Binding.csproj b/UI/BindingSources/XAML/Binding/Binding.csproj new file mode 100644 index 000000000..ae19715b5 --- /dev/null +++ b/UI/BindingSources/XAML/Binding/Binding.csproj @@ -0,0 +1,44 @@ + + + + net8.0-android; + net8.0-ios; + net8.0-maccatalyst; + net8.0-windows10.0.19041; + net8.0-desktop; + net8.0-browserwasm; + + + Exe + true + + + Binding + + com.companyname.Binding + + 1.0 + 1 + + + + + + Material; + Toolkit; + + + + diff --git a/UI/BindingSources/XAML/Binding/GlobalUsings.cs b/UI/BindingSources/XAML/Binding/GlobalUsings.cs new file mode 100644 index 000000000..eeafbe36f --- /dev/null +++ b/UI/BindingSources/XAML/Binding/GlobalUsings.cs @@ -0,0 +1,4 @@ +global using System.Collections.Immutable; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using ApplicationExecutionState = Windows.ApplicationModel.Activation.ApplicationExecutionState; diff --git a/UI/BindingSources/XAML/Binding/MainPage.xaml b/UI/BindingSources/XAML/Binding/MainPage.xaml new file mode 100644 index 000000000..45c99754c --- /dev/null +++ b/UI/BindingSources/XAML/Binding/MainPage.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + +