-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91e1c41
commit b76f1bf
Showing
76 changed files
with
2,009 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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:MyMauiApp" | ||
x:Class="MyMauiApp.App"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" /> | ||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" /> | ||
</ResourceDictionary.MergedDictionaries> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace MyMauiApp; | ||
|
||
public partial class App : Application | ||
{ | ||
public App() | ||
{ | ||
InitializeComponent(); | ||
|
||
MainPage = new AppShell(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<Shell | ||
x:Class="MyMauiApp.AppShell" | ||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
xmlns:local="clr-namespace:MyMauiApp" | ||
Shell.FlyoutBehavior="Disabled" | ||
Title="MyMauiApp"> | ||
|
||
<ShellContent | ||
Title="Home" | ||
ContentTemplate="{DataTemplate local:MainPage}" | ||
Route="MainPage" /> | ||
|
||
</Shell> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace MyMauiApp; | ||
|
||
public partial class AppShell : Shell | ||
{ | ||
public AppShell() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?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="MyMauiApp.MainPage"> | ||
|
||
<ScrollView> | ||
<VerticalStackLayout | ||
Padding="30,0" | ||
Spacing="25"> | ||
<Image | ||
Source="dotnet_bot.png" | ||
HeightRequest="185" | ||
Aspect="AspectFit" | ||
SemanticProperties.Description="dot net bot in a race car number eight" /> | ||
|
||
<Label | ||
Text="Hello, World!" | ||
Style="{StaticResource Headline}" | ||
SemanticProperties.HeadingLevel="Level1" /> | ||
|
||
<Label | ||
Text="Welcome to .NET Multi-platform App UI" | ||
Style="{StaticResource SubHeadline}" | ||
SemanticProperties.HeadingLevel="Level2" | ||
SemanticProperties.Description="Welcome to dot net Multi platform App U I" /> | ||
|
||
<Button | ||
x:Name="CounterBtn" | ||
Text="Click me" | ||
SemanticProperties.Hint="Counts the number of times you click" | ||
Clicked="OnCounterClicked" | ||
HorizontalOptions="Fill" /> | ||
</VerticalStackLayout> | ||
</ScrollView> | ||
|
||
</ContentPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace MyMauiApp; | ||
|
||
public partial class MainPage : ContentPage | ||
{ | ||
int count = 0; | ||
|
||
public MainPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void OnCounterClicked(object sender, EventArgs e) | ||
{ | ||
count++; | ||
|
||
if (count == 1) | ||
CounterBtn.Text = $"Clicked {count} time"; | ||
else | ||
CounterBtn.Text = $"Clicked {count} times"; | ||
|
||
SemanticScreenReader.Announce(CounterBtn.Text); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include ../shared.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace MyMauiApp; | ||
|
||
public static class MauiProgram | ||
{ | ||
public static MauiApp CreateMauiApp() | ||
{ | ||
var builder = MauiApp.CreateBuilder(); | ||
builder | ||
.UseMauiApp<App>() | ||
.ConfigureFonts(fonts => | ||
{ | ||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | ||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | ||
}); | ||
|
||
#if DEBUG | ||
builder.Logging.AddDebug(); | ||
#endif | ||
|
||
return builder.Build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net$(BundledNETCoreAppTargetFrameworkVersion)-maccatalyst</TargetFrameworks> | ||
</PropertyGroup> | ||
|
||
<Import Project="../shared.csproj" /> | ||
</Project> |
6 changes: 6 additions & 0 deletions
6
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Android/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<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" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
</manifest> |
10 changes: 10 additions & 0 deletions
10
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Android/MainActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Android.App; | ||
using Android.Content.PM; | ||
using Android.OS; | ||
|
||
namespace MyMauiApp; | ||
|
||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] | ||
public class MainActivity : MauiAppCompatActivity | ||
{ | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Android/MainApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Android.App; | ||
using Android.Runtime; | ||
|
||
namespace MyMauiApp; | ||
|
||
[Application] | ||
public class MainApplication : MauiApplication | ||
{ | ||
public MainApplication(IntPtr handle, JniHandleOwnership ownership) | ||
: base(handle, ownership) | ||
{ | ||
} | ||
|
||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Android/Resources/values/colors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#512BD4</color> | ||
<color name="colorPrimaryDark">#2B0B98</color> | ||
<color name="colorAccent">#2B0B98</color> | ||
</resources> |
9 changes: 9 additions & 0 deletions
9
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/MacCatalyst/AppDelegate.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Foundation; | ||
|
||
namespace MyMauiApp; | ||
|
||
[Register("AppDelegate")] | ||
public class AppDelegate : MauiUIApplicationDelegate | ||
{ | ||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/MacCatalyst/Entitlements.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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"> | ||
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.--> | ||
<dict> | ||
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. --> | ||
<key>com.apple.security.app-sandbox</key> | ||
<true/> | ||
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. --> | ||
<key>com.apple.security.network.client</key> | ||
<true/> | ||
</dict> | ||
</plist> | ||
|
38 changes: 38 additions & 0 deletions
38
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/MacCatalyst/Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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> | ||
<!-- The Mac App Store requires you specify if the app uses encryption. --> | ||
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption --> | ||
<!-- <key>ITSAppUsesNonExemptEncryption</key> --> | ||
<!-- Please indicate <true/> or <false/> here. --> | ||
|
||
<!-- Specify the category for your app here. --> | ||
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype --> | ||
<!-- <key>LSApplicationCategoryType</key> --> | ||
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> --> | ||
<key>UIDeviceFamily</key> | ||
<array> | ||
<integer>2</integer> | ||
</array> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>arm64</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations~ipad</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>XSAppIconAssets</key> | ||
<string>Assets.xcassets/appicon.appiconset</string> | ||
</dict> | ||
</plist> |
15 changes: 15 additions & 0 deletions
15
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/MacCatalyst/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using ObjCRuntime; | ||
using UIKit; | ||
|
||
namespace MyMauiApp; | ||
|
||
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)); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Tizen/Main.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using Microsoft.Maui; | ||
using Microsoft.Maui.Hosting; | ||
|
||
namespace MyMauiApp; | ||
|
||
class Program : MauiApplication | ||
{ | ||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
|
||
static void Main(string[] args) | ||
{ | ||
var app = new Program(); | ||
app.Run(args); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Tizen/tizen-manifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages"> | ||
<profile name="common" /> | ||
<ui-application appid="maui-application-id-placeholder" exec="MyMauiApp.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single"> | ||
<label>maui-application-title-placeholder</label> | ||
<icon>maui-appicon-placeholder</icon> | ||
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" /> | ||
</ui-application> | ||
<shortcut-list /> | ||
<privileges> | ||
<privilege>http://tizen.org/privilege/internet</privilege> | ||
</privileges> | ||
<dependencies /> | ||
<provides-appdefined-privileges /> | ||
</manifest> |
8 changes: 8 additions & 0 deletions
8
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Windows/App.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<maui:MauiWinUIApplication | ||
x:Class="MyMauiApp.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:MyMauiApp.WinUI"> | ||
|
||
</maui:MauiWinUIApplication> |
24 changes: 24 additions & 0 deletions
24
tests/dotnet/MyMauiApp/MacCatalyst/Platforms/Windows/App.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 MyMauiApp.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(); | ||
} | ||
|
Oops, something went wrong.