Skip to content

Showing any Window before Main Window causes Left and Right window commands not work properly. #2635

@amithasan

Description

@amithasan

I have added a splash screen window to a mahapps metro application with a progress ring. The splash screen is shown and closed before the main window is shown using the following code.

protected async override void OnStartup(System.Windows.StartupEventArgs e)
    {
        //Other code

        MainWindow mainWindow = new MainWindow();

        SplashScreen sp = new SplashScreen();
        sp.Show();
        await Task.Delay(3000);
        sp.Close();

        mainWindow.Show();

        //Other code
    }

Splash screen is shown correctly but the main window’s RightWindowCommands and LeftWindowCommands are not working correctly. Maybe styles and data binding of WindowCommands are not working. For example, a button icon on the left is not visible and a button icon on right is visible but data binding is not working.

However, If the main window is showed first then everything works as expected.

Environment

  • MahApps.Metro v1.2.4
  • Windows 10
  • Visual Studio 2015
  • .NET Framework 4.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions