dotnet / dotnet/docs-maui

Unable to resize window as described in Mac Catalyst

Open
#2,904 0 comments 0 reactions 0 assignees View on GitHub
:watch: Not Triaged dotnet-maui/subsvc dotnet-mobile/svc Pri2
Dominant language
No language data
Stars
282
Forks
265
Avg merge
2d 2h
Merged PRs (30d)
19

Description

### Type of issue

Code doesn't work

### Description

[Enter feedback here]

The [Position and size a Window](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/window?view=net-maui-9.0#position-and-size-a-window) section was [relatively recently updated](https://github.com/dotnet/docs-maui/commits/main/docs/user-interface/controls/window.md) to say this works on Mac Catalyst now.

I am unable to get that to work.

Based on the doc, it certainly looks like this code belongs in the `App.xaml.cs` file.

Either the documentation is unclear (imo) or the feature does not yet work/is limited to a version of MAUI that I'm not using, though I believe I'm on the latest.

```
namespace MauiApp3
{
public partial class App : Application
{
public App()
{
InitializeComponent();
}

protected override Window CreateWindow(IActivationState? activationState)
{
return new Window(new AppShell())
{
Width = 500,
Height = 800,
X = 10,
Y = 10
};
}
}
}
```

### Page URL

https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/window?view=net-maui-9.0

### Content source URL

https://github.com/dotnet/docs-maui/blob/main/docs/user-interface/controls/window.md

### Document Version Independent Id

36572dea-ae73-4dbb-913f-6cf0152de382

### Platform Id

664ddda4-2743-5a9f-0fa4-3217bf64b7c9

### Article author

@davidbritch

### Metadata

* ID: 36572dea-ae73-4dbb-913f-6cf0152de382
* PlatformId: 664ddda4-2743-5a9f-0fa4-3217bf64b7c9
* Service: **dotnet-mobile**
* Sub-service: **dotnet-maui**

[Related Issues](https://github.com/dotnet/docs-maui/issues?q=is%3Aissue+is%3Aopen+36572dea-ae73-4dbb-913f-6cf0152de382)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.