diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/README.md b/10.0/UserInterface/Layouts/SafeAreaDemos/README.md new file mode 100644 index 000000000..542dab5b7 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/README.md @@ -0,0 +1,29 @@ +--- +name: .NET MAUI - SafeArea +description: This sample demonstrates how to use the .NET MAUI SafeAreaEdges property to control how content interacts with system UI elements like notches, status bars, and keyboards. +page_type: sample +languages: +- csharp +- xaml +products: +- dotnet-maui +urlFragment: userinterface-safearea +--- + +# SafeArea + +This sample demonstrates how to use the .NET MAUI Multi-platform App UI (.NET MAUI) `SafeAreaEdges` property to control how content interacts with system UI elements like notches, status bars, navigation bars, and software keyboards. + +The `SafeAreaEdges` property allows you to specify which edges of a view should respect the system's safe area insets, enabling both immersive edge-to-edge experiences and traditional safe layouts. + +## Features + +This sample includes the following examples: + +- **Edge-to-Edge Content** - Demonstrates `SafeAreaEdges="None"` to create immersive full-screen experiences where content extends behind system bars +- **Respect All Safe Areas** - Shows `SafeAreaEdges="All"` to ensure content avoids all system UI elements including notches, status bars, and keyboards +- **Keyboard-Aware Layout** - Uses `SafeAreaEdges="SoftInput"` to create layouts that automatically adjust when the software keyboard appears +- **Default Safe Area** - Shows the platform default behavior with `SafeAreaEdges="Default"` +- **Container Safe Area** - Demonstrates `SafeAreaEdges="Container"` for container controls with automatic padding management + +For more information about SafeArea in .NET MAUI, see [.NET MAUI SafeArea documentation](https://docs.microsoft.com/dotnet/maui/user-interface/layouts/safearea). diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos.sln b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos.sln new file mode 100644 index 000000000..2a5713fdc --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31611.283 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SafeAreaDemos", "SafeAreaDemos\SafeAreaDemos.csproj", "{47285539-D077-423D-8878-21E7DC4D4C70}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {47285539-D077-423D-8878-21E7DC4D4C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47285539-D077-423D-8878-21E7DC4D4C70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47285539-D077-423D-8878-21E7DC4D4C70}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {47285539-D077-423D-8878-21E7DC4D4C70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47285539-D077-423D-8878-21E7DC4D4C70}.Release|Any CPU.Build.0 = Release|Any CPU + {47285539-D077-423D-8878-21E7DC4D4C70}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572} + EndGlobalSection +EndGlobal diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml new file mode 100644 index 000000000..7c52dae9f --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + #4068A5F6 + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml.cs new file mode 100644 index 000000000..f24a4f368 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/App.xaml.cs @@ -0,0 +1,14 @@ +namespace SafeAreaDemos; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState activationState) + { + return new Window(new AppShell()); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml new file mode 100644 index 000000000..c936e1d41 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml.cs new file mode 100644 index 000000000..85cba014a --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace SafeAreaDemos; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/MauiProgram.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/MauiProgram.cs new file mode 100644 index 000000000..38f5f467d --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/MauiProgram.cs @@ -0,0 +1,18 @@ +namespace SafeAreaDemos; + +public static class MauiProgram +{ + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + + return builder.Build(); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/AndroidManifest.xml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/AndroidManifest.xml new file mode 100644 index 000000000..e9937ad77 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainActivity.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainActivity.cs new file mode 100644 index 000000000..a10879569 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainActivity.cs @@ -0,0 +1,10 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace SafeAreaDemos; + +[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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainApplication.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainApplication.cs new file mode 100644 index 000000000..5b36a753b --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/MainApplication.cs @@ -0,0 +1,15 @@ +using Android.App; +using Android.Runtime; + +namespace SafeAreaDemos; + +[Application] +public class MainApplication : MauiApplication +{ + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/Resources/values/colors.xml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 000000000..c04d7492a --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/AppDelegate.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 000000000..e8ac972c1 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace SafeAreaDemos; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Info.plist b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Info.plist new file mode 100644 index 000000000..c96dd0a22 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,30 @@ + + + + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Program.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Program.cs new file mode 100644 index 000000000..85bcfb3e0 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace SafeAreaDemos; + +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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/Main.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/Main.cs new file mode 100644 index 000000000..730fcf131 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/Main.cs @@ -0,0 +1,16 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace SafeAreaDemos; + +class Program : MauiApplication +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/tizen-manifest.xml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 000000000..4a1cfd91f --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + appicon.xhigh.png + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/App.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/App.xaml new file mode 100644 index 000000000..076f66857 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/App.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/App.xaml.cs new file mode 100644 index 000000000..e911ab6ac --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/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 SafeAreaDemos.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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/Package.appxmanifest b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/Package.appxmanifest new file mode 100644 index 000000000..2bcb11edf --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,43 @@ + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/app.manifest b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/app.manifest new file mode 100644 index 000000000..abe028cc4 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/AppDelegate.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/AppDelegate.cs new file mode 100644 index 000000000..e8ac972c1 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,9 @@ +using Foundation; + +namespace SafeAreaDemos; + +[Register("AppDelegate")] +public class AppDelegate : MauiUIApplicationDelegate +{ + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/Info.plist b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/Info.plist new file mode 100644 index 000000000..0004a4fde --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/Program.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/Program.cs new file mode 100644 index 000000000..85bcfb3e0 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Platforms/iOS/Program.cs @@ -0,0 +1,15 @@ +using ObjCRuntime; +using UIKit; + +namespace SafeAreaDemos; + +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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Properties/launchSettings.json b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Properties/launchSettings.json new file mode 100644 index 000000000..4f857936f --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "Project", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appicon.svg b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appicon.svg new file mode 100644 index 000000000..9d63b6513 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appiconfg.svg b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appiconfg.svg new file mode 100644 index 000000000..21dfb25f1 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Regular.ttf b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 000000000..534d00947 Binary files /dev/null and b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Semibold.ttf b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 000000000..f33315301 Binary files /dev/null and b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Images/dotnet_bot.png b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Images/dotnet_bot.png new file mode 100644 index 000000000..1709b39ec Binary files /dev/null and b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Images/dotnet_bot.png differ diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Raw/AboutAssets.txt b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Raw/AboutAssets.txt new file mode 100644 index 000000000..15d624484 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/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/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Splash/splash.svg b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Splash/splash.svg new file mode 100644 index 000000000..21dfb25f1 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Colors.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Colors.xaml new file mode 100644 index 000000000..245758ba1 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Colors.xaml @@ -0,0 +1,44 @@ + + + + + #512BD4 + #DFD8F7 + #2B0B98 + White + Black + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + #F7B548 + #FFD590 + #FFE5B9 + #28C2D1 + #7BDDEF + #C3F2F4 + #3E8EED + #72ACF1 + #A7CBF6 + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Styles.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Styles.xaml new file mode 100644 index 000000000..1ec9d55fe --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Resources/Styles/Styles.xaml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/SafeAreaDemos.csproj b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/SafeAreaDemos.csproj new file mode 100644 index 000000000..0fdb8b1fa --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/SafeAreaDemos.csproj @@ -0,0 +1,97 @@ + + + + net10.0-android;net10.0-ios;net10.0-maccatalyst + $(TargetFrameworks);net10.0-windows10.0.19041.0 + + + + + + + Exe + SafeAreaDemos + true + true + enable + true + + + SafeAreaDemos + + + com.companyname.safeareademos + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + MSBuild:Compile + + + + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml new file mode 100644 index 000000000..afa428877 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml.cs new file mode 100644 index 000000000..0fe76bdc7 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example1EdgeToEdge.xaml.cs @@ -0,0 +1,14 @@ +namespace SafeAreaDemos.Views; + +public partial class Example1EdgeToEdge : ContentPage +{ + public Example1EdgeToEdge() + { + InitializeComponent(); + } + + async void Button_Clicked(object sender, EventArgs e) + { + await Navigation.PopAsync(); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml new file mode 100644 index 000000000..e3fc8e976 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml.cs new file mode 100644 index 000000000..f47ddf08f --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example2RespectAll.xaml.cs @@ -0,0 +1,14 @@ +namespace SafeAreaDemos.Views; + +public partial class Example2RespectAll : ContentPage +{ + public Example2RespectAll() + { + InitializeComponent(); + } + + async void Button_Clicked(object sender, EventArgs e) + { + await Navigation.PopAsync(); + } +} \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example3KeyboardAware.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example3KeyboardAware.xaml new file mode 100644 index 000000000..b2a40980c --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example3KeyboardAware.xaml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example4Default.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example4Default.xaml.cs new file mode 100644 index 000000000..f61509d92 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example4Default.xaml.cs @@ -0,0 +1,14 @@ +namespace SafeAreaDemos.Views; + +public partial class Example4Default : ContentPage +{ + public Example4Default() + { + InitializeComponent(); + } + + async void Button_Clicked(object sender, EventArgs e) + { + await Navigation.PopAsync(); + } +} \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml new file mode 100644 index 000000000..c1ac7925c --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml.cs b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml.cs new file mode 100644 index 000000000..e7116cf28 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/Example5Container.xaml.cs @@ -0,0 +1,24 @@ +namespace SafeAreaDemos.Views; + +public partial class Example5Container : ContentPage +{ + public Example5Container() + { + InitializeComponent(); + } + async void Button_Clicked(object sender, EventArgs e) + { + await Navigation.PopAsync(); + } + protected override void OnAppearing() + { + base.OnAppearing(); + + // Auto-focus the message entry to show keyboard for screenshot + Dispatcher.DispatchDelayed(TimeSpan.FromSeconds(2), () => + { + var entry = this.FindByName("MessageEntry"); + entry?.Focus(); + }); + } +} diff --git a/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/MainPage.xaml b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/MainPage.xaml new file mode 100644 index 000000000..3d7300661 --- /dev/null +++ b/10.0/UserInterface/Layouts/SafeAreaDemos/SafeAreaDemos/Views/MainPage.xaml @@ -0,0 +1,63 @@ + + + +