0

Сan't maximize window when using MahApps.Metro window, the size does not change. Example of my window:

<controls:MetroWindow x:Class="Example.View.HelpView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:uc="clr-namespace:Example.UserControls"
        WindowStartupLocation="CenterScreen"
        mc:Ignorable="d" 
        Height="843" 
        Width="1258" 
        WindowStyle="None" Background="Transparent">
</controls:MetroWindow>

Edit

I created button for this and trying to change the state as follows:

private void UserControl_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
    Window _window = Window.GetWindow(this);
    if (_window.WindowState == WindowState.Maximized)
    {
        _window.WindowState = WindowState.Normal;
    }
    else
    {
        _window.WindowState = WindowState.Maximized;
    }
}

Edit

When I expand the window to full screen, it behaves as follows, takes up the same space as in normal mode, but the rest of the window is locked

enter image description here

1 Answers1

0

lastly do you try this :) I think "_window" not seting correctly now

xaml
        <controls:MetroWindow 
               x.name="MetroWindow"
    </controls:MetroWindow>
c#
Window _window = MetroWindow;

or

c#

    Window _window = (Window)sender;