Caliburn-Micro / Caliburn.Micro

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
http://caliburnmicro.com/
MIT License
2.8k stars 778 forks source link

IWindowManager change window state #807

Closed Fanom2813 closed 2 years ago

Fanom2813 commented 2 years ago

Hi, i'm trying to maximize my Caliburn.Micro Window but it is not working , how can i set WindowState without showWindow again in ShaellViewModel

thank you

vb2ae commented 2 years ago

If ShellViewModel is the startup view model you do something like this to Maximize the form.

   protected override void OnViewLoaded(object view)
    {
        base.OnViewLoaded(view);
        Application.Current.MainWindow.WindowState = WindowState.Maximized;
    }
Fanom2813 commented 2 years ago

worked !