0

当用户单击最大化按钮时,我正在尝试最大化窗口。问题是我使用的方法在最大化时将窗口减半:

在此处输入图像描述

这是我使用的方法:

void OnStateChanged(object sender, EventArgs args)
{
    if (WindowState == WindowState.Minimized)
    {
        if (Messenger.Option.showlearnetlogo)
        {
            Logo.Visibility = Visibility.Hidden;
            this.Title = Properties.Resources.MainView_OnStateChanged_Learnet_Communicator;
        }

        for (int i = App.Current.Windows.Count - 1; i >= 0; i--)
        {
            if (App.Current.Windows[i].IsActive)
                App.Current.Windows[i].WindowState = WindowState.Minimized;
        }
    }
    else if (WindowState == WindowState.Maximized)
    {
        if (prevwinstate == WindowState.Minimized)
            WindowState = WindowState.Normal;

        m_storedWindowState = WindowState;
    }
    else
    {
        if (Messenger.Option.showlearnetlogo)
        {
            this.Title = "";
            Logo.Visibility = Visibility.Visible;
        }

        m_storedWindowState = WindowState;
    }

    prevwinstate = WindowState;
}

是什么导致了这种情况,有没有办法解决最大化问题?

4

0 回答 0