Updated .NET MAUI Effects sample

This commit is contained in:
Javier Suárez Ruiz 2022-03-27 17:50:25 +02:00
Родитель 0e63e699e4
Коммит 3e762a6f66
47 изменённых файлов: 291 добавлений и 458 удалений

Просмотреть файл

@ -1,11 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31220.234
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Effects", "Effects\Effects\Effects.csproj", "{EB524249-58DC-47CA-9871-E4E1A03C66EA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Effects.WinUI", "Effects\Effects.WinUI\Effects.WinUI.csproj", "{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Effects", "Effects\Effects.csproj", "{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -13,18 +11,12 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Release|Any CPU.Build.0 = Release|Any CPU
{EB524249-58DC-47CA-9871-E4E1A03C66EA}.Release|Any CPU.Deploy.0 = Release|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Release|Any CPU.Build.0 = Release|Any CPU
{97AB9608-FCF9-479D-9BF9-B1EFA2ADB698}.Release|Any CPU.Deploy.0 = Release|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Release|Any CPU.Build.0 = Release|Any CPU
{E620A6F6-1AA6-4A9B-9934-3FD7D1724FDB}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Effects"
x:Class="Effects.App">
</Application>

Просмотреть файл

@ -0,0 +1,11 @@
namespace Effects;
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
}

Просмотреть файл

@ -1,26 +0,0 @@
<Project>
<PropertyGroup>
<!-- Required - Enable Launch Profiles for .NET 6 iOS/Android -->
<_KeepLaunchProfiles>true</_KeepLaunchProfiles>
</PropertyGroup>
<ItemGroup>
<!-- Required - Setup Single Project features -->
<ProjectCapability Include="MauiSingleProject" />
<!-- Optional - Enables a list of TFM's and device categories in the debug menu -->
<!-- This allows easily toggling of debug target TFM by selecting the platform -->
<!-- If removed, Top level debug targets show as a list of devices for the selected TFM -->
<ProjectCapability Include="XamarinStaticLaunchProfiles" />
</ItemGroup>
<!-- Required - Skip the runtime settings -->
<PropertyGroup>
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<!-- Required - Overwrite tasks that are not needed when multitargeting -->
<Target Name="ValidateWinUIPlatform" />
<Target Name="BinPlaceBootstrapDll" />
</Project>

Просмотреть файл

@ -1,61 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041</TargetFrameworks>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<OutputType>WinExe</OutputType>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<RootNamespace>Effects</RootNamespace>
<!-- Required - Enable Single Project for WinUI -->
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsPackageType>MSIX</WindowsPackageType>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiImage
Include="..\Effects\Resources\appicon.svg"
Link="Resources\appicon.svg"
ForegroundFile="..\Effects\Resources\appiconfg.svg"
IsAppIcon="true"
Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen
Include="..\Effects\Resources\appiconfg.svg"
Link="Resources\appiconfg.svg"
Color="#512BD4" />
<!-- Images -->
<MauiImage
Include="..\Effects\Resources\Images\*"
Link="Resources\Images\%(Filename)%(Extension)" />
<!-- Custom Fonts -->
<MauiFont
Include="..\Effects\Resources\Fonts\*"
Link="Resources\Fonts\%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<Compile
Include="..\Effects\**\*.cs"
Exclude="..\Effects\bin\**;..\Effects\obj\**;..\Effects\Platforms\**"
Link="%(RecursiveDir)%(Filename)%(Extension)"/>
<MauiXaml
Include="..\Effects\**\*.xaml"
Exclude="..\Effects\bin\**;..\Effects\obj\**"
Link="%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.0" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.0" />
<PackageReference Include="Microsoft.ProjectReunion.InteractiveExperiences" Version="0.8.0" NoWarn="NU1701" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,33 +0,0 @@
using Microsoft.Maui;
using Microsoft.UI.Xaml;
using Windows.ApplicationModel;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Effects.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override IStartup OnCreateStartup() => new Startup();
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);
Microsoft.Maui.Essentials.Platform.OnLaunched(args);
}
}
}

Просмотреть файл

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity
Name="9DD825F5-AC36-4C40-9412-D3D40F3AF6E6"
Publisher="CN=User Name"
Version="1.0.0.0" />
<Properties>
<DisplayName>Effects</DisplayName>
<PublisherDisplayName>Microsoft</PublisherDisplayName>
<Logo>Assets\appiconStoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="Effects"
Description="Effects"
BackgroundColor="transparent"
Square150x150Logo="Assets\appiconMediumTile.png"
Square44x44Logo="Assets\appiconLogo.png">
<uap:DefaultTile
Wide310x150Logo="Assets\appiconWideTile.png"
Square71x71Logo="Assets\appiconSmallTile.png"
Square310x310Logo="Assets\appiconLargeTile.png"
ShortName="Effects">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile >
<uap:SplashScreen Image="Assets\appiconfgSplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

Просмотреть файл

@ -1,7 +0,0 @@
{
"profiles": {
"Effects.WinUI": {
"commandName": "MsixPackage"
}
}
}

Просмотреть файл

@ -0,0 +1,67 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Effects</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<!-- Display name -->
<ApplicationTitle>Effects</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.effects</ApplicationId>
<ApplicationId Condition="$(TargetFramework.Contains('-windows'))">B0025432-3381-4185-B2DE-EAB36EB2D276</ApplicationId>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<!-- Required for C# Hot Reload -->
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\appiconfg.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<!-- Required - WinUI does not yet have buildTransitive for everything -->
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.30" />
</ItemGroup>
<ItemGroup>
<Folder Include="Effects\" />
</ItemGroup>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
<OutputType>WinExe</OutputType>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,7 +0,0 @@
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls"
xmlns:local="clr-namespace:Effects"
x:Class="Effects.App"
windows:Application.ImageDirectory="Assets">
</Application>

Просмотреть файл

@ -1,14 +0,0 @@
using Application = Microsoft.Maui.Controls.Application;
namespace Effects
{
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new MainPage();
}
}
}

Просмотреть файл

@ -1,43 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- iOS, Android, MacCatalyst -->
<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst</TargetFrameworks>
<OutputType>Exe</OutputType>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<RootNamespace>Effects</RootNamespace>
<!-- Display name -->
<ApplicationTitle>Effects</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.Effects</ApplicationId>
<!-- Versions -->
<ApplicationVersion>1.0</ApplicationVersion>
<AndroidVersionCode>1</AndroidVersionCode>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiImage Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" IsAppIcon="true" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\appiconfg.svg" Color="#512BD4" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>
<PropertyGroup>
<InvariantGlobalization Condition="$(TargetFramework.Contains('-maccatalyst'))">true</InvariantGlobalization>
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-ios'))">iossimulator-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="$(TargetFramework.Contains('-maccatalyst'))">maccatalyst-x64</RuntimeIdentifier>
<UseInterpreter Condition="$(TargetFramework.Contains('-android'))">False</UseInterpreter>
</PropertyGroup>
</Project>

Просмотреть файл

@ -10,7 +10,7 @@ namespace Effects.Effects
}
#if WINDOWS
public class FocusPlatformEffect : Microsoft.Maui.Controls.Compatibility.Platform.UWP.PlatformEffect
public class PlatformFocusPlatformEffect : Microsoft.Maui.Controls.Platform.PlatformEffect
{
public FocusPlatformEffect() : base()
{
@ -35,7 +35,7 @@ namespace Effects.Effects
}
}
#elif __ANDROID__
public class FocusPlatformEffect : Microsoft.Maui.Controls.Compatibility.Platform.Android.PlatformEffect
public class PlatformFocusPlatformEffect : Microsoft.Maui.Controls.Platform.PlatformEffect
{
Android.Graphics.Color originalBackgroundColor = new Android.Graphics.Color(0, 0, 0, 0);
Android.Graphics.Color backgroundColor;
@ -81,7 +81,7 @@ namespace Effects.Effects
}
}
#elif __IOS__
public class FocusPlatformEffect : Microsoft.Maui.Controls.Compatibility.Platform.iOS.PlatformEffect
public class PlatformFocusPlatformEffect : Microsoft.Maui.Controls.Platform.PlatformEffect
{
UIKit.UIColor backgroundColor;

Просмотреть файл

@ -1,12 +0,0 @@
using Microsoft.Maui.Controls;
namespace Effects
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -1,11 +0,0 @@
using Android.App;
using Android.Content.PM;
using Microsoft.Maui;
namespace Effects
{
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
public class MainActivity : MauiAppCompatActivity
{
}
}

Просмотреть файл

@ -1,16 +0,0 @@
using System;
using Android.App;
using Android.Runtime;
using Microsoft.Maui;
namespace Effects
{
[Application]
public class MainApplication : MauiApplication<Startup>
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
}
}

Просмотреть файл

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>

Просмотреть файл

@ -1,10 +0,0 @@
using Foundation;
using Microsoft.Maui;
namespace Effects
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate<Startup>
{
}
}

Просмотреть файл

@ -1,15 +0,0 @@
using UIKit;
namespace Effects
{
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, "AppDelegate");
}
}
}

Просмотреть файл

@ -1,10 +0,0 @@
using Foundation;
using Microsoft.Maui;
namespace Effects
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate<Startup>
{
}
}

Просмотреть файл

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>

Просмотреть файл

@ -1,15 +0,0 @@
using UIKit;
namespace Effects
{
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, "AppDelegate");
}
}
}

Просмотреть файл

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207" />
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1" />
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" />
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder" />
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480" />
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2017 " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines"
minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21" />
<fontDescription key="fontDescription" type="system" pointSize="17" />
<color key="textColor" cocoaTouchSystemColor="darkTextColor" />
<nil key="highlightedColor" />
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sample.iOS" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines"
minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43" />
<fontDescription key="fontDescription" type="boldSystem" pointSize="36" />
<color key="textColor" cocoaTouchSystemColor="darkTextColor" />
<nil key="highlightedColor" />
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC" />
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk" />
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l" />
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0" />
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9" />
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g" />
</constraints>
<nil key="simulatedStatusBarMetrics" />
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics" />
<point key="canvasLocation" x="548" y="455" />
</view>
</objects>
</document>

Просмотреть файл

@ -1,28 +0,0 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Hosting;
using Microsoft.Maui.Controls.Xaml;
using Effects.Effects;
[assembly: XamlCompilationAttribute(XamlCompilationOptions.Compile)]
namespace Effects
{
public class Startup : IStartup
{
public void Configure(IAppHostBuilder appBuilder)
{
appBuilder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
})
.ConfigureEffects(effects =>
{
effects.Add<FocusRoutingEffect, FocusPlatformEffect>();
});
}
}
}

Просмотреть файл

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@ -9,10 +10,16 @@
<Label
Text="Entry With Focus Routing Effect"/>
<Entry
Text="Alert Simple">
Text="Entry 1">
<Entry.Effects>
<effects:FocusRoutingEffect />
</Entry.Effects>
</Entry>
<Entry
Text="Entry 2">
<Entry.Effects>
<effects:FocusRoutingEffect />
</Entry.Effects>
</Entry>
</StackLayout>
</ContentPage>
</ContentPage>

Просмотреть файл

@ -0,0 +1,9 @@
namespace Effects;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}

Просмотреть файл

@ -0,0 +1,24 @@
using Effects.Effects;
using Microsoft.Maui.Controls.Hosting;
namespace Effects;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureEffects(effects =>
{
effects.Add(typeof(FocusRoutingEffect), typeof(PlatformFocusPlatformEffect));
})
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
return builder.Build();
}
}

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

Просмотреть файл

@ -0,0 +1,9 @@
using Android.App;
using Android.Content.PM;
namespace Effects;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
public class MainActivity : MauiAppCompatActivity
{
}

Просмотреть файл

@ -0,0 +1,15 @@
using Android.App;
using Android.Runtime;
namespace Effects;
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,9 @@
using Foundation;
namespace Effects;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSMinimumSystemVersion</key>
<string>10.15</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>

Просмотреть файл

@ -0,0 +1,15 @@
using ObjCRuntime;
using UIKit;
namespace Effects;
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));
}
}

Просмотреть файл

@ -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 Effects.WinUI;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Publisher="CN=User Name" />
<Properties>
<PublisherDisplayName>User Name</PublisherDisplayName>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements />
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,9 @@
using Foundation;
namespace Effects;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -4,8 +4,6 @@
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>10.3.4</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>

Просмотреть файл

@ -0,0 +1,15 @@
using ObjCRuntime;
using UIKit;
namespace Effects;
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));
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": false
}
}
}

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 12 KiB

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Просмотреть файл

@ -0,0 +1,14 @@
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 "MauiAsset":
<MauiAsset Include="AboutAssets.txt" />
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();
}

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 228 B

После

Ширина:  |  Высота:  |  Размер: 228 B

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 1.8 KiB

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB