Skip to content

Commit 13c0772

Browse files
committed
Have user code return the built MauiApp
Instead of returning the builder.
1 parent 5b2b656 commit 13c0772

File tree

34 files changed

+54
-54
lines changed

34 files changed

+54
-54
lines changed

src/Compatibility/ControlGallery/src/Core/Startup.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ public static class MauiProgram
1010
{
1111
internal static bool UseBlazor = false;
1212

13-
public static MauiAppBuilder CreateAppBuilder()
13+
public static MauiApp CreateMauiApp()
14+
{
15+
var builder = CreateMauiAppBuilder();
16+
return builder.Build();
17+
}
18+
19+
public static MauiAppBuilder CreateMauiAppBuilder()
1420
{
1521
var builder = MauiApp.CreateBuilder();
1622
builder

src/Compatibility/ControlGallery/src/WinUI/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ public App()
1616
InitializeComponent();
1717
}
1818

19-
protected override MauiAppBuilder CreateAppBuilder() => WinUIMauiProgram.CreateAppBuilder();
19+
protected override MauiApp CreateMauiApp() => WinUIMauiProgram.CreateMauiApp();
2020
}
2121
}

src/Compatibility/ControlGallery/src/WinUI/WinUIStartup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery.WinUI
1818
{
1919
public class WinUIMauiProgram
2020
{
21-
public static MauiAppBuilder CreateAppBuilder()
21+
public static MauiApp CreateMauiApp()
2222
{
2323
var builder = MauiProgram.CreateAppBuilder();
2424

@@ -34,7 +34,7 @@ public static MauiAppBuilder CreateAppBuilder()
3434
})
3535
.OnActivated(WinUIPageStartup.OnActivated)));
3636

37-
return builder;
37+
return builder.Build();
3838
}
3939
}
4040

src/Compatibility/ControlGallery/src/iOS/AppDelegate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public string GetTestCloudDevice()
103103
[Register("AppDelegate")]
104104
public partial class AppDelegate : MauiUIApplicationDelegate
105105
{
106-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
106+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
107107

108108
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
109109
{

src/Controls/samples/Controls.Sample.Droid/MainApplication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handl
1313
{
1414
}
1515

16-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
16+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1717
}
1818
}

src/Controls/samples/Controls.Sample.MacCatalyst/AppDelegate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ namespace Sample.MacCatalyst
1313
[Register("AppDelegate")]
1414
public class AppDelegate : MauiUIApplicationDelegate
1515
{
16-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
16+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1717
}
1818
}

src/Controls/samples/Controls.Sample.Profiling/Platforms/Android/MainApplication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handl
1212
{
1313
}
1414

15-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
15+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1616
}
1717
}

src/Controls/samples/Controls.Sample.Profiling/Platforms/MacCatalyst/AppDelegate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace Maui.Controls.Sample.Profiling
66
[Register("AppDelegate")]
77
public class AppDelegate : MauiUIApplicationDelegate
88
{
9-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
9+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1010
}
1111
}

src/Controls/samples/Controls.Sample.Profiling/Platforms/iOS/AppDelegate.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ namespace Maui.Controls.Sample.Profiling
66
[Register("AppDelegate")]
77
public class AppDelegate : MauiUIApplicationDelegate
88
{
9-
protected override MauiAppBuilder CreateAppBuilder() => MauiProgram.CreateAppBuilder();
9+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1010
}
1111
}

src/Controls/samples/Controls.Sample.Profiling/Startup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Maui.Controls.Sample.Profiling
99
{
1010
public static class MauiProgram
1111
{
12-
public static MauiAppBuilder CreateAppBuilder()
12+
public static MauiApp CreateMauiApp()
1313
{
1414
var appBuilder = MauiApp.CreateBuilder();
1515

@@ -20,7 +20,7 @@ public static MauiAppBuilder CreateAppBuilder()
2020
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
2121
});
2222

23-
return appBuilder;
23+
return builder.Build();
2424
}
2525
}
2626
}

0 commit comments

Comments
 (0)