I fixed it by replacing "this.Windows" with "Shell.Current.Window"
The cause is unknown but may be due to application problems:
await Shell.Current.GoToAsync...
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using below environment to create windows desktop app + Maui / Net 7 + Windows 10
I need to set the size for each screen, for example: + LoginPage : width (400), height(650) + MenuPage : width (600), height(800)
I have referred to the link creation settings below: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/windows
However, for "LoginPage" it is OK but "MenuPage" gives an error: "Object reference not set to an instance of an object."
Below is my "MenuPage" source and the error that occurs at the line "this.Window.Width = width;"
public partial class Index : ContentPage
{
publicIndex()
{
InitializeComponent();
}
protected override void OnAppearing()
{
try
{
base.OnAppearing();
const int width = 800;
const int height = 600;
this.Window.Width = width;
this.Window.Height = height;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
I want to ask is there any way to set the size for each page?
I fixed it by replacing "this.Windows" with "Shell.Current.Window"
The cause is unknown but may be due to application problems:
await Shell.Current.GoToAsync...