Skip to content

Commit 18335f2

Browse files
committed
OxyplotMauiSample: fix a warning
'Application.MainPage.set' is obsolete: 'This property is deprecated. Initialize your application by overriding Application.CreateWindow rather than setting MainPage. To modify the root page in an active application, use Windows[0].Page for applications with a single window. For applications with multiple windows, use Application.Windows to identify and update the root page on the correct window. Additionally, each element features a Window property, accessible when it's part of the current window.'
1 parent 114f3a4 commit 18335f2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
namespace OxyplotMauiSample
1+

2+
namespace OxyplotMauiSample
23
{
34
public partial class App
45
{
56
public App()
67
{
78
InitializeComponent();
8-
MainPage = new AppShell();
9+
}
10+
11+
protected override Window CreateWindow(IActivationState activationState)
12+
{
13+
return new Window(new AppShell());
914
}
1015
}
1116
}

0 commit comments

Comments
 (0)