When registering .NET applications programmatically with io.Connect Desktop, you can control the initial window size on first launch, while still allowing users to resize the window freely afterward, with their custom sizing preserved for subsequent openings.
How
Use WithWindowOptionsModifier on the IApplicationDefinitionBuilder to set the initial screen bounds when registering your app via RegisterAppFactoryAsync or RegisterWPFApp:
IApplicationDefinitionBuilder::WithWindowOptionsModifier(gwo => gwo.WithScreenBounds(...))
Once the user manually resizes the window, io.Connect Desktop will preserve the user-defined size on subsequent launches as part of its default layout behavior.
Notes
- The
WithWindowOptionsModifiermethod requires io.Connect.NET 1.35.0 or later. - If you try setting window bounds inside the
Initializemethod ofTick42.AppManager.IGlueAppHandleusingglueWindow.Update(MoveResize(...))it will also set the window size. But the set size will be applied at every opening, not just the first time. Moving the window in the initialize state does not work as the system will place it in the proper position according to the layout (or the default position).