Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate AOT Profilers for Non Shell based apps #8941

Merged
merged 7 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .nuspec/maui.aotprofile
Binary file not shown.
587 changes: 270 additions & 317 deletions .nuspec/maui.aotprofile.txt

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/ProfiledAot/src/maui/AppFlyoutPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<FlyoutPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="maui.AppFlyoutPage"
xmlns:local="clr-namespace:maui"
Title="AppFlyoutPage">
<FlyoutPage.Detail>
<local:Tabs Title="Detail"></local:Tabs>
</FlyoutPage.Detail>
<FlyoutPage.Flyout>
<ContentPage Title="Flyout">
<VerticalStackLayout>
<Label Text="Flyout Item 1"></Label>
<Label Text="Flyout Item 2"></Label>
<Label Text="Flyout Item 3"></Label>
<Label Text="Flyout Item 4"></Label>
</VerticalStackLayout>
</ContentPage>
</FlyoutPage.Flyout>
</FlyoutPage>
9 changes: 9 additions & 0 deletions src/ProfiledAot/src/maui/AppFlyoutPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace maui;

public partial class AppFlyoutPage : FlyoutPage
{
public AppFlyoutPage()
{
InitializeComponent();
}
}
25 changes: 24 additions & 1 deletion src/ProfiledAot/src/maui/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,39 @@ namespace maui;
public partial class MainPage : ContentPage
{
int count = 0;
bool _isLoaded;
bool _startCompleted;

public MainPage()
{
InitializeComponent();
Start();

if (Application.Current.MainPage is not AppFlyoutPage)
{
Start();
this.Loaded += OnMainPageLoaded;
}
}

private async void Start()
{
CounterBtn.Text = await CommonMethods.Invoke();
_startCompleted= true;
LoadFlyoutPage();
}

void OnMainPageLoaded(object sender, EventArgs e)
{
_isLoaded = true;
LoadFlyoutPage();
}

void LoadFlyoutPage()
{
if (_isLoaded && _startCompleted)
{
Application.Current.MainPage = new AppFlyoutPage();
}
}

private void OnCounterClicked(object sender, EventArgs e)
Expand Down
8 changes: 8 additions & 0 deletions src/ProfiledAot/src/maui/Tabs.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="maui.Tabs"
xmlns:android="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;assembly=Microsoft.Maui.Controls"
android:TabbedPage.ToolbarPlacement="Bottom"
Title="Tabs">
</TabbedPage>
13 changes: 13 additions & 0 deletions src/ProfiledAot/src/maui/Tabs.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace maui;

public partial class Tabs : TabbedPage
{
public Tabs()
{
InitializeComponent();

Children.Add(new NavigationPage(new MainPage()) { Title = "Tab 1" });
Children.Add(new NavigationPage(new MainPage()) { Title = "Tab 2" });
Children.Add(new NavigationPage(new MainPage()) { Title = "Tab 3" });
}
}