-
Notifications
You must be signed in to change notification settings - Fork 21
/
MauiProgram.cs
44 lines (39 loc) · 1.14 KB
/
MauiProgram.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Telerik.Maui.Controls.Compatibility;
// This is needed for the builder.ConfigureLifecycleEvents extensions method
using Microsoft.Maui.LifecycleEvents;
#if WINDOWS
// This is needed for the window.CenterOnScreen extensions method
using WinUIEx;
#endif
namespace MauiDemo
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseTelerik()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("telerikfontexamples.ttf", "telerikfontexamples");
});
#if WINDOWS
builder.ConfigureLifecycleEvents(events =>
{
events.AddWindows(wndLifeCycleBuilder =>
{
wndLifeCycleBuilder.OnWindowCreated(window =>
{
//Set size and center on screen using WinUIEx extension method
window.CenterOnScreen(1024,768);
});
});
});
#endif
return builder.Build();
}
}
}