Maximizing MetroWindow doesn't work with AllowsTransparency="True"
See original GitHub issueDescribe the bug
When MetroWindow
has AllowsTransparency="True"
then maximizing it via click on Maximize button, double-click on titlebar, or context menu Maximize click doesn’t work.
To Reproduce Steps to reproduce the behavior:
- Create
MetroWindow
withAllowsTransparency="True"
- Try to maximize the window
Expected behavior The window is properly maximized.
Screenshots https://i.imgur.com/wPIaKrA.png This is how the window looks after an attempt to maximize (window content is in top left corner, but it doesn’t respond to anything except dragging by the titlebar to remove maximization).
Environment(please complete the following information):
- MahApps.Metro version v1.6.5, v2.0.0-alpha0660
- OS: Win10 1909
- .NET Framework 4.6.1, .NET Core 3.0
Repo
I’ve created the repo to follow the guidelines https://github.com/skel35/MetroWindowMaximizeBugRepro, but the repro is very simple:
<mah:MetroWindow x:Class="NetCoreRepro.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525"
AllowsTransparency="True"
Background="White">
<Grid />
</mah:MetroWindow>
Additional context
Maximizing works properly if I drag the titlebar to the top edge of the screen.
I’d appreciate if you can recommend any workaround to this issue.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Goodmorning everyone, first of all, congratulations for the enormous work that you are carrying out.
Also I had problems with “AllowsTransparency”, I solved, surely in a non elegant and completed way, with the following code:
If the question is addressed to me, I don’t use WindowsFormHost. I don’t like mixing different technologies. The project from which I extracted the code is native WPF with MahApps.Metro 1.6.5. I have not found any stability problems, but as already highlighted I have no experience with the WindowsFormHost control.