diff --git a/NuGet.config b/NuGet.config index 1a0f14021c0..4a68a68f8d4 100644 --- a/NuGet.config +++ b/NuGet.config @@ -21,6 +21,7 @@ + diff --git a/samples/NativeAOT/App.xaml b/samples/NativeAOT/App.xaml new file mode 100644 index 00000000000..05dc94e9e83 --- /dev/null +++ b/samples/NativeAOT/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/samples/NativeAOT/App.xaml.cs b/samples/NativeAOT/App.xaml.cs new file mode 100644 index 00000000000..79a77569f63 --- /dev/null +++ b/samples/NativeAOT/App.xaml.cs @@ -0,0 +1,14 @@ +namespace NativeAOT; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); + } +} \ No newline at end of file diff --git a/samples/NativeAOT/AppShell.xaml b/samples/NativeAOT/AppShell.xaml new file mode 100644 index 00000000000..f1086a916c0 --- /dev/null +++ b/samples/NativeAOT/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/samples/NativeAOT/AppShell.xaml.cs b/samples/NativeAOT/AppShell.xaml.cs new file mode 100644 index 00000000000..f393f3d5a07 --- /dev/null +++ b/samples/NativeAOT/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace NativeAOT; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/samples/NativeAOT/MainActivity.cs b/samples/NativeAOT/MainActivity.cs deleted file mode 100644 index aaedc0aef2d..00000000000 --- a/samples/NativeAOT/MainActivity.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Android.Runtime; -using Android.Util; -using System.Reflection; -using System.Runtime.InteropServices; - -namespace NativeAOT; - -// Name required for typemap in NativeAotTypeManager -[Activity (Label = "@string/app_name", MainLauncher = true, Name = "my.MainActivity")] -public class MainActivity : Activity -{ - protected override void OnCreate(Bundle? savedInstanceState) - { - Log.Debug ("NativeAOT", "MainActivity.OnCreate()"); - - base.OnCreate(savedInstanceState); - - // Set our view from the "main" layout resource - SetContentView(Resource.Layout.activity_main); - } -} \ No newline at end of file diff --git a/samples/NativeAOT/MainApplication.cs b/samples/NativeAOT/MainApplication.cs deleted file mode 100644 index e3f2c6f546f..00000000000 --- a/samples/NativeAOT/MainApplication.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Android.Runtime; -using Android.Util; - -/// -/// NOTE: This class is not required, but used for testing Android.App.Application subclasses. -/// Name required for typemap in NativeAotTypeManager -/// -[Application (Name = "my.MainApplication")] -public class MainApplication : Application -{ - public MainApplication (IntPtr handle, JniHandleOwnership transfer) - : base (handle, transfer) - { - Log.Debug ("NativeAOT", $"Application..ctor({handle.ToString ("x2")}, {transfer})"); - } - - public override void OnCreate () - { - Log.Debug ("NativeAOT", "Application.OnCreate()"); - - base.OnCreate (); - } -} diff --git a/samples/NativeAOT/MainPage.xaml b/samples/NativeAOT/MainPage.xaml new file mode 100644 index 00000000000..a32254090aa --- /dev/null +++ b/samples/NativeAOT/MainPage.xaml @@ -0,0 +1,36 @@ + + + + + + + +