diff --git a/Samples.sln b/Samples.sln new file mode 100644 index 0000000..f0a068f --- /dev/null +++ b/Samples.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ch03_DataBinding", "ch03_DataBinding", "{E9273679-4D52-465F-8C23-8096DD8C2A7B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_BindingToA2dArray_v1", "ch03_DataBinding\ex_BindingToA2dArray_v1\ex_BindingToA2dArray_v1.csproj", "{AB5CCC4D-10B3-4116-A6B3-D1F720507608}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_BindingToA2dArray_context", "ch03_DataBinding\ex_BindingToA2dArray_context\ex_BindingToA2dArray_context.csproj", "{43E82F4F-6EBA-4708-A392-1B2E8130A19E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ex_BindingToA2dArray_v2", "ch03_DataBinding\ex_BindingToA2dArray_v2\ex_BindingToA2dArray_v2.csproj", "{C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AB5CCC4D-10B3-4116-A6B3-D1F720507608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB5CCC4D-10B3-4116-A6B3-D1F720507608}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB5CCC4D-10B3-4116-A6B3-D1F720507608}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB5CCC4D-10B3-4116-A6B3-D1F720507608}.Release|Any CPU.Build.0 = Release|Any CPU + {43E82F4F-6EBA-4708-A392-1B2E8130A19E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43E82F4F-6EBA-4708-A392-1B2E8130A19E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43E82F4F-6EBA-4708-A392-1B2E8130A19E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43E82F4F-6EBA-4708-A392-1B2E8130A19E}.Release|Any CPU.Build.0 = Release|Any CPU + {C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AB5CCC4D-10B3-4116-A6B3-D1F720507608} = {E9273679-4D52-465F-8C23-8096DD8C2A7B} + {43E82F4F-6EBA-4708-A392-1B2E8130A19E} = {E9273679-4D52-465F-8C23-8096DD8C2A7B} + {C93C6EF6-C535-44C0-B5BF-0DD4988F3FA4} = {E9273679-4D52-465F-8C23-8096DD8C2A7B} + EndGlobalSection +EndGlobal diff --git a/ch03_DataBinding/ex_BindingToA2dArray_context/Matrix2d.cs b/ch03_DataBinding/ex_BindingToA2dArray_context/Matrix2d.cs new file mode 100644 index 0000000..052f8b2 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_context/Matrix2d.cs @@ -0,0 +1,67 @@ +namespace ex_BindingToA2dArray_context; + +public class Matrix2d +{ + private static Random random = new Random(); + + private static int[,] RandomInit(int nbRows, int nbColumns) + { + int[,] mat = new int[6,7]; + for(int i=0; i<6; i++) + { + for(int j=0; j<7; j++) + { + mat[i,j] = random.Next(101); + } + }; + return mat; + } + + public Matrix2d(int nbRows, int nbColumns) + { + matrix = RandomInit(nbRows, nbColumns); + } + + private readonly int[,]? matrix; + + public int NbRows => matrix?.GetLength(0) ?? 0; + public int NbColumns => matrix?.GetLength(1) ?? 0; + + public int[,] Matrix + { + get + { + if(matrix == null) return new int[,]{{}}; + + int[,] mat = new int[NbRows, NbColumns]; + for(int numRow=0; numRow FlatMatrix2d + { + get + { + List flatMatrix = new(); + + if(matrix == null) return flatMatrix; + + int[,] mat = new int[NbRows, NbColumns]; + for(int numRow=0; numRow + + + net8.0 + enable + enable + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml new file mode 100644 index 0000000..6010525 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml.cs new file mode 100644 index 0000000..e675fc4 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/App.xaml.cs @@ -0,0 +1,11 @@ +namespace ex_BindingToA2dArray_v1; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml new file mode 100644 index 0000000..f8d300c --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml.cs new file mode 100644 index 0000000..7a340a0 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace ex_BindingToA2dArray_v1; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml new file mode 100644 index 0000000..e3f22c3 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml @@ -0,0 +1,54 @@ + + + + + 100 + 100 + 10 + 10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml.cs new file mode 100644 index 0000000..e1e7880 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/MainPage.xaml.cs @@ -0,0 +1,15 @@ +using ex_BindingToA2dArray_context; + +namespace ex_BindingToA2dArray_v1; + +public partial class MainPage : ContentPage +{ + public Matrix2d Matrix {get;} = new Matrix2d(7, 6); + + public MainPage() + { + InitializeComponent(); + BindingContext = this; + } +} + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/MauiProgram.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/MauiProgram.cs new file mode 100644 index 0000000..1b8dc48 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/MauiProgram.cs @@ -0,0 +1,26 @@ +using CommunityToolkit.Maui; +using Microsoft.Extensions.Logging; + +namespace ex_BindingToA2dArray_v1; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .UseMauiCommunityToolkit() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/AndroidManifest.xml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..bdec9b5 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainActivity.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..1108368 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace ex_BindingToA2dArray_v1; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainApplication.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..c719069 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace ex_BindingToA2dArray_v1; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/Resources/values/colors.xml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..5cd1604 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/AppDelegate.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..e4b76de --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ex_BindingToA2dArray_v1; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Entitlements.plist b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..8e87c0c --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Info.plist b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..f24aacc --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Program.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..6daca69 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ex_BindingToA2dArray_v1; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/Main.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..337aa7a --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/Main.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace ex_BindingToA2dArray_v1; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/tizen-manifest.xml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..d9edfb2 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml new file mode 100644 index 0000000..4da832b --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..b54cc30 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/App.xaml.cs @@ -0,0 +1,24 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace ex_BindingToA2dArray_v1.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/Package.appxmanifest b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..68d6354 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/app.manifest b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/app.manifest new file mode 100644 index 0000000..fda1d54 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/AppDelegate.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..e4b76de --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ex_BindingToA2dArray_v1; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Info.plist b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Info.plist new file mode 100644 index 0000000..358337b --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Program.cs b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Program.cs new file mode 100644 index 0000000..6daca69 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ex_BindingToA2dArray_v1; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Properties/launchSettings.json b/ch03_DataBinding/ex_BindingToA2dArray_v1/Properties/launchSettings.json new file mode 100644 index 0000000..c16206a --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appicon.svg b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..5f04fcf --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appiconfg.svg b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Regular.ttf b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..2d1edf0 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Semibold.ttf b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..fe13d06 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Images/dotnet_bot.png b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..f93ce02 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Images/dotnet_bot.png differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Raw/AboutAssets.txt b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..50b8a7b --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Splash/splash.svg b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Splash/splash.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Colors.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..22f0a67 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Styles.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..5bc20f1 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/Resources/Styles/Styles.xaml @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v1/ex_BindingToA2dArray_v1.csproj b/ch03_DataBinding/ex_BindingToA2dArray_v1/ex_BindingToA2dArray_v1.csproj new file mode 100644 index 0000000..b00af9d --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v1/ex_BindingToA2dArray_v1.csproj @@ -0,0 +1,70 @@ + + + + net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + + + + + Exe + ex_BindingToA2dArray_v1 + true + true + enable + enable + + + ex_BindingToA2dArray_v1 + + + com.companyname.ex_bindingtoa2darray_v1 + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml new file mode 100644 index 0000000..db0d4bf --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml.cs new file mode 100644 index 0000000..c399986 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/App.xaml.cs @@ -0,0 +1,11 @@ +namespace ex_BindingToA2dArray_v2; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml new file mode 100644 index 0000000..b8528e2 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml.cs new file mode 100644 index 0000000..dcfe905 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace ex_BindingToA2dArray_v2; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml new file mode 100644 index 0000000..0ce91a4 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml @@ -0,0 +1,30 @@ + + + + + + 10 + 10 + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml.cs new file mode 100644 index 0000000..5aac1f1 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/MainPage.xaml.cs @@ -0,0 +1,15 @@ +using ex_BindingToA2dArray_context; + +namespace ex_BindingToA2dArray_v2; + +public partial class MainPage : ContentPage +{ + public Matrix2d Matrix {get;} = new Matrix2d(7, 6); + + public MainPage() + { + InitializeComponent(); + BindingContext = this; + } +} + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/MauiProgram.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/MauiProgram.cs new file mode 100644 index 0000000..b20be40 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/MauiProgram.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.Logging; + +namespace ex_BindingToA2dArray_v2; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayout.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayout.cs new file mode 100644 index 0000000..4feabd2 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayout.cs @@ -0,0 +1,65 @@ +using Microsoft.Maui.Layouts; + +namespace ex_BindingToA2dArray_v2.MyLayouts; + +public class MatrixLayout : Layout +{ + public static readonly BindableProperty NbColumnsProperty + = BindableProperty.Create(nameof(NbColumns), + typeof(int), + typeof(MatrixLayout), + 10, propertyChanged: OrientationChanged); + + public int NbColumns + { + get { return (int)GetValue(NbColumnsProperty); } + set { SetValue(NbColumnsProperty, value); } + } + + public static readonly BindableProperty NbRowsProperty + = BindableProperty.Create(nameof(NbRows), + typeof(int), + typeof(MatrixLayout), + 10, propertyChanged: OrientationChanged); + + public int NbRows + { + get { return (int)GetValue(NbRowsProperty); } + set { SetValue(NbRowsProperty, value); } + } + + public static readonly BindableProperty HorizontalSpacingProperty + = BindableProperty.Create(nameof(HorizontalSpacing), + typeof(double), + typeof(MatrixLayout), + 0.0, propertyChanged: OrientationChanged); + + public double HorizontalSpacing + { + get { return (double)GetValue(HorizontalSpacingProperty); } + set { SetValue(HorizontalSpacingProperty, value); } + } + + public static readonly BindableProperty VerticalSpacingProperty + = BindableProperty.Create(nameof(VerticalSpacing), + typeof(double), + typeof(MatrixLayout), + 0.0, propertyChanged: OrientationChanged); + + public double VerticalSpacing + { + get { return (double)GetValue(VerticalSpacingProperty); } + set { SetValue(VerticalSpacingProperty, value); } + } + + protected override ILayoutManager CreateLayoutManager() + { + return new MatrixLayoutManager(this); + } + + static void OrientationChanged(BindableObject bindable, object oldValue, object newValue) + { + // var layout = bindable as MatrixLayout; + // layout?.InvalidateMeasure(); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayoutManager.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayoutManager.cs new file mode 100644 index 0000000..5241eef --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/MyLayouts/MatrixLayoutManager.cs @@ -0,0 +1,69 @@ +using Microsoft.Maui.Layouts; + +namespace ex_BindingToA2dArray_v2.MyLayouts; + +public class MatrixLayoutManager : ILayoutManager +{ + MatrixLayout? MatrixLayout {get; set;} + double LayoutWidth {get; set;} + double LayoutHeight {get; set;} + double MaxCellWidth {get; set;} + double MaxCellHeight {get; set;} + + public MatrixLayoutManager(MatrixLayout matrixLayout) + { + MatrixLayout = matrixLayout; + } + + public Size Measure(double widthConstraint, double heightConstraint) + { + if(MatrixLayout == null) + return new Size(widthConstraint, heightConstraint); + + int nbRows = MatrixLayout.NbRows; + int nbColumns = MatrixLayout.NbColumns; + + var padding = MatrixLayout.Padding; + var horizontalSpacing = MatrixLayout.HorizontalSpacing; + var verticalSpacing = MatrixLayout.VerticalSpacing; + + MaxCellWidth = (widthConstraint - padding.HorizontalThickness - (nbColumns - 1)* horizontalSpacing)/nbColumns; + MaxCellHeight = (heightConstraint - padding.VerticalThickness - (nbRows - 1)* verticalSpacing)/nbRows; + + double minDim = Math.Min(MaxCellWidth, MaxCellHeight); + MaxCellWidth = minDim; + MaxCellHeight = minDim; + + LayoutWidth = MaxCellWidth*nbColumns + (nbColumns-1)* horizontalSpacing + padding.HorizontalThickness; + LayoutHeight = MaxCellHeight*nbRows + (nbRows-1)* verticalSpacing + padding.VerticalThickness; + return new Size(LayoutWidth, LayoutHeight); + } + + public Size ArrangeChildren(Rect bounds) + { + if(MatrixLayout == null) + return new Size(LayoutWidth, LayoutHeight); + + var padding = MatrixLayout.Padding; + var horizontalSpacing = MatrixLayout.HorizontalSpacing; + var verticalSpacing = MatrixLayout.VerticalSpacing; + int nbColumns = MatrixLayout.NbColumns; + double top = padding.Top + bounds.Top; + double left = padding.Left + bounds.Left; + + for (int cellId = 0; cellId < MatrixLayout.Count; cellId++) + { + var cell = MatrixLayout[cellId]; + int numRow = cellId / nbColumns; + int numColumn = cellId - numRow * nbColumns; + + double leftSide = left + numColumn * (MaxCellWidth + horizontalSpacing); + double topSide = top + numRow * (MaxCellHeight + verticalSpacing); + + var destination = new Rect(leftSide, topSide, MaxCellWidth, MaxCellHeight); + cell.Arrange(destination); + } + + return new Size(LayoutWidth, LayoutHeight); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/AndroidManifest.xml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..bdec9b5 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainActivity.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..e0bea4f --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace ex_BindingToA2dArray_v2; + +[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] +public class MainActivity : MauiAppCompatActivity +{ +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainApplication.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..3118994 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace ex_BindingToA2dArray_v2; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/Resources/values/colors.xml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..5cd1604 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/AppDelegate.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..71cc406 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ex_BindingToA2dArray_v2; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Entitlements.plist b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..8e87c0c --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Info.plist b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..f24aacc --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Program.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..bdb3d94 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ex_BindingToA2dArray_v2; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/Main.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..004f716 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/Main.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace ex_BindingToA2dArray_v2; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/tizen-manifest.xml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..5392d03 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml new file mode 100644 index 0000000..835c23e --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..e480f03 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/App.xaml.cs @@ -0,0 +1,24 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace ex_BindingToA2dArray_v2.WinUI; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : MauiWinUIApplication +{ + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/Package.appxmanifest b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..9fbe6cd --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/app.manifest b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/app.manifest new file mode 100644 index 0000000..88a0d11 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/AppDelegate.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..71cc406 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace ex_BindingToA2dArray_v2; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Info.plist b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Info.plist new file mode 100644 index 0000000..358337b --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Program.cs b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Program.cs new file mode 100644 index 0000000..bdb3d94 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace ex_BindingToA2dArray_v2; + +public class Program +{ + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } +} diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Properties/launchSettings.json b/ch03_DataBinding/ex_BindingToA2dArray_v2/Properties/launchSettings.json new file mode 100644 index 0000000..c16206a --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appicon.svg b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..5f04fcf --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appiconfg.svg b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Regular.ttf b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..2d1edf0 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Semibold.ttf b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..fe13d06 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Images/dotnet_bot.png b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..f93ce02 Binary files /dev/null and b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Images/dotnet_bot.png differ diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Raw/AboutAssets.txt b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..50b8a7b --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with you package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Splash/splash.svg b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Splash/splash.svg new file mode 100644 index 0000000..62d66d7 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Colors.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..22f0a67 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Styles.xaml b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..5bc20f1 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/Resources/Styles/Styles.xaml @@ -0,0 +1,426 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ch03_DataBinding/ex_BindingToA2dArray_v2/ex_BindingToA2dArray_v2.csproj b/ch03_DataBinding/ex_BindingToA2dArray_v2/ex_BindingToA2dArray_v2.csproj new file mode 100644 index 0000000..c49cb33 --- /dev/null +++ b/ch03_DataBinding/ex_BindingToA2dArray_v2/ex_BindingToA2dArray_v2.csproj @@ -0,0 +1,69 @@ + + + + net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + + + + + + Exe + ex_BindingToA2dArray_v2 + true + true + enable + enable + + + ex_BindingToA2dArray_v2 + + + com.companyname.ex_bindingtoa2darray_v2 + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +