Updated .NET MAUI Triggers sample

This commit is contained in:
Javier Suárez Ruiz 2022-03-27 17:56:51 +02:00
Родитель 3e762a6f66
Коммит 59cc0b9caa
49 изменённых файлов: 283 добавлений и 489 удалений

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

@ -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}") = "Triggers", "Triggers\Triggers\Triggers.csproj", "{928579F0-DDC1-47EC-A023-21A8788C037A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Triggers.WinUI", "Triggers\Triggers.WinUI\Triggers.WinUI.csproj", "{7BCF8FB8-E000-464A-8318-2667F89F9A7E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Triggers", "Triggers\Triggers.csproj", "{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -13,18 +11,12 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{928579F0-DDC1-47EC-A023-21A8788C037A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{928579F0-DDC1-47EC-A023-21A8788C037A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{928579F0-DDC1-47EC-A023-21A8788C037A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{928579F0-DDC1-47EC-A023-21A8788C037A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{928579F0-DDC1-47EC-A023-21A8788C037A}.Release|Any CPU.Build.0 = Release|Any CPU
{928579F0-DDC1-47EC-A023-21A8788C037A}.Release|Any CPU.Deploy.0 = Release|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Release|Any CPU.Build.0 = Release|Any CPU
{7BCF8FB8-E000-464A-8318-2667F89F9A7E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.Release|Any CPU.Build.0 = Release|Any CPU
{26290A55-3E0E-48EA-A8EB-CD76DA956C9A}.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:Triggers"
x:Class="Triggers.App">
</Application>

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

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

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

@ -1,21 +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 - Overwrite tasks that are not needed when multitargeting -->
<Target Name="ValidateWinUIPlatform" />
<Target Name="BinPlaceBootstrapDll" />
</Project>

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

@ -1,4 +1,5 @@
<ContentPage
<?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"
x:Class="Triggers.MainPage"
@ -15,7 +16,7 @@
x:Name="Entry"
Text=""
Placeholder="Required field" />
<!-- Referenced below in DataTrigger-->
<!-- Referenced below in DataTrigger -->
<Button
x:Name="Button"
Text="Save"
@ -24,12 +25,12 @@
<Button.Triggers>
<DataTrigger
TargetType="Button"
Binding="{Binding Source={x:Reference Entry},
Path=Text.Length}"
Binding="{Binding Source={x:Reference Entry},
Path=Text.Length}"
Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Button.Triggers>
</Button>
</StackLayout>
</ContentPage>
</ContentPage>

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

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

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

@ -0,0 +1,17 @@
namespace Triggers;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.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,10 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace Triggers;
[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 Triggers;
[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 Triggers;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

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

@ -2,15 +2,11 @@
<!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>
<integer>2</integer>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>

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

@ -0,0 +1,15 @@
using ObjCRuntime;
using UIKit;
namespace Triggers;
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 @@
<maui:MauiWinUIApplication
x:Class="Triggers.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:Triggers.WinUI">
</maui:MauiWinUIApplication>

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

@ -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 Triggers.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 Triggers;
[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 Triggers;
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

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

@ -1,7 +0,0 @@
{
"profiles": {
"Triggers.WinUI": {
"commandName": "AppContainer"
}
}
}

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

@ -1,64 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.19041</TargetFrameworks>
<OutputType>WinExe</OutputType>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<SingleProject>true</SingleProject>
<RootNamespace>Triggers</RootNamespace>
<!-- Required - Enable Single Project for WinUI -->
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<WindowsPackageType>MSIX</WindowsPackageType>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiImage
Include="..\Triggers\Resources\appicon.svg"
Link="Resources\appicon.svg"
ForegroundFile="..\Triggers\Resources\appiconfg.svg"
IsAppIcon="true"
Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen
Include="..\Triggers\Resources\appiconfg.svg"
Link="Resources\appiconfg.svg"
Color="#512BD4" />
<!-- Images -->
<MauiImage
Include="..\Triggers\Resources\Images\*"
Link="Resources\Images\%(Filename)%(Extension)" />
<!-- Custom Fonts -->
<MauiFont
Include="..\Triggers\Resources\Fonts\*"
Link="Resources\Fonts\%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<Compile
Include="..\Triggers\**\*.cs"
Exclude="..\Triggers\bin\**;..\Triggers\obj\**;..\Triggers\Android\**;..\Triggers\iOS\**;..\Triggers\MacCatalyst\**"
Link="%(RecursiveDir)%(Filename)%(Extension)"/>
<MauiXaml
Include="..\Triggers\**\*.xaml"
Exclude="..\Triggers\bin\**;..\Triggers\obj\**"
Link="%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Maui" Version="6.0.100-preview.5.794" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ProjectReunion" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.Foundation" Version="0.8.0-preview" />
<PackageReference Include="Microsoft.ProjectReunion.WinUI" Version="0.8.0-preview" />
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.19041.16" />
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.19041.16" />
</ItemGroup>
</Project>

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

@ -1,15 +0,0 @@
<local:MiddleApp
x:Class="Triggers.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Triggers.WinUI">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</local:MiddleApp>

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

@ -1,34 +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 Triggers.WinUI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MiddleApp
{
/// <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 void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);
Microsoft.Maui.Essentials.Platform.OnLaunched(args);
}
}
public class MiddleApp : MauiWinUIApplication<Startup>
{
}
}

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

@ -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="3A242880-AE19-483A-BADD-14D2D149E9EE"
Publisher="CN=User Name"
Version="1.0.0.0" />
<Properties>
<DisplayName>Triggers</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="Triggers"
Description="Triggers"
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="Triggers">
<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>

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

@ -0,0 +1,63 @@
<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>Triggers</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<!-- Display name -->
<ApplicationTitle>Triggers</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.triggers</ApplicationId>
<ApplicationId Condition="$(TargetFramework.Contains('-windows'))">35CEA039-99E7-405E-B588-49C17890ED25</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>
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
<OutputType>WinExe</OutputType>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
</Project>

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

@ -1 +0,0 @@
DOTNET_MODIFIABLE_ASSEMBLIES=Debug

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

@ -1,11 +0,0 @@
using Android.App;
using Android.Content.PM;
using Microsoft.Maui;
namespace Triggers
{
[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 Triggers
{
[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,6 +0,0 @@
<Application
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Triggers"
x:Class="Triggers.App">
</Application>

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

@ -1,22 +0,0 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Application = Microsoft.Maui.Controls.Application;
namespace Triggers
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}
protected override IWindow CreateWindow(IActivationState activationState)
{
this.On<Microsoft.Maui.Controls.PlatformConfiguration.Windows>()
.SetImageDirectory("Assets");
return new Microsoft.Maui.Controls.Window(new MainPage());
}
}
}

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

@ -1,10 +0,0 @@
using Foundation;
using Microsoft.Maui;
namespace Triggers
{
[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 Triggers
{
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,12 +0,0 @@
using Microsoft.Maui.Controls;
namespace Triggers
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
}
}

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

@ -1,19 +0,0 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Hosting;
namespace Triggers
{
public class Startup : IStartup
{
public void Configure(IAppHostBuilder appBuilder)
{
appBuilder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
}
}
}

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

@ -1,53 +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>
<SingleProject>true</SingleProject>
<RootNamespace>Triggers</RootNamespace>
<!-- Display name -->
<ApplicationTitle>Triggers</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.Triggers</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>
<ItemGroup>
<PackageReference Include="Microsoft.Maui" Version="6.0.100-preview.5.794" />
</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'))">True</UseInterpreter>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<AndroidEnvironment Include="Android\AndroidEnvironment.txt" />
</ItemGroup>
</Project>

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

@ -1,10 +0,0 @@
using Foundation;
using Microsoft.Maui;
namespace Triggers
{
[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 Triggers
{
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>