I understand that XCode supports AutoSave for remembering window position. I see it freely documented.
What about Xamarin Forms 5, when the platform is macOS?
This is some of my code, if it helps:
public class AppDelegate : FormsApplicationDelegate
{
NSWindow window;
public AppDelegate()
{
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
window = new NSWindow(rect, style, NSBackingStore.Buffered, false)
{
Title = "Elderly and Infirm Rota",
TitleVisibility = NSWindowTitleVisibility.Visible
};
InstallApplicationFiles();
}
Update
In the comments I also referred to limiting the size of the window. I have now worked out that bit (NSWindow.MinSize
):
NSWindow window;
public AppDelegate()
{
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;
var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
window = new NSWindow(rect, style, NSBackingStore.Buffered, false)
{
Title = "Elderly and Infirm Rota",
TitleVisibility = NSWindowTitleVisibility.Visible,
MinSize = rect.Size
};
InstallApplicationFiles();
}
Now I have to address the window size / position and remembering it.