Button styles: MaterialDesignRaisedButton used with MahApps.Metro causes serious memory leak
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
未指定 repository 檔案或測試。先使用 MahApps.MetroWindow、MaterialDesignRaisedButton 和 ButtonProgressAssist 執行所提供的 WPF XAML 重現,然後在 4.7.1 版本下執行它,並將視窗最小化後還原,以確認記憶體行為;當記憶體洩漏獲得解釋且回報的情境不再重現時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Bug explanation
I found a problem, maybe a compatibility issue or a design bug, but I think it can be fixed. My WPF program uses MahApps, (<mah:MetroWindow...), in which I use a button control of MaterialDesignInXamlToolkit, the style of this button control is: MaterialDesignRaisedButton. When I run the program, everything seems to be fine, but immediately after I minimize the form, the memory increases at a rate of 1MB/s, and it won't stop, unless I restore this form that was just minimized, after restoring the memory immediately drop and return to normal levels. I know my question is about coming from two different places, (MahApps and MaterialDesignInXamlToolkit), but if I don't use MahApps(mah:MetroWindow), then, the above problem doesn't exist, everything works fine, also I tried several other Different styles of a similar button, only this style is found so far: MaterialDesignRaisedButton has this problem, the condition that triggers this problem is when the form is minimized.
**xaml code:
<mah:MetroWindow x:Class="WpfApp1.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:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="450" Width="800">
<Grid>
<StackPanel>
<Grid
Width="124">
<Button
Margin="2,0"
materialDesign:ButtonProgressAssist.IsIndeterminate="True"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="True"
materialDesign:ButtonProgressAssist.Value="-1"
Content="Indeterminate"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
Style="{StaticResource MaterialDesignRaisedButton}" />
</Grid>
</StackPanel>
</Grid>
</mah:MetroWindow>
I have captured two pictures. Figure 1 shows that after running the WPF program and minimizing it, the change of memory transmission at this time can be seen to be increasing

Figure 2 shows the memory changes after I restored the WPF program window that I just minimized. You can see that the memory has dropped rapidly and gradually returned to normal

Version
4.7.1
- 主要語言
- C#
- 星號
- 16.3k
- 分支
- 3.5k
- 平均合併
- 4 小時 25 分鐘
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
MaterialDesignInXAML/MaterialDesignInXamlToolkit 的其他 Issue
-
難度 1/5 1 小時以內 新手友好度 88/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4124 ·
維護者通常 1 天內回覆
-
MaterialDesignChoiceChipListBoxItem missing 'Path=Name' in GroupName binding causes selection conflict between ListBoxes可能已有人在做 @corvinsz 於 12 天前認領。 未關閉bug evaluation required
難度 1/5 1-3 小時 新手友好度 78/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4118 · 1 則留言 ·
維護者通常 1 天內回覆
-
enhancement up-for-grabs
難度 2/5 1-3 小時 新手友好度 68/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#2485 ·
維護者通常 1 天內回覆
-
enhancement evaluation required
難度 3/5 半天 新手友好度 30/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4120 · 1 則留言 ·
維護者通常 1 天內回覆
-
Add Semantic, Theme-Aware Colors可能已有人在做 @corvinsz 於 22 天前認領。 未關閉enhancement
難度 4/5 3-5 天 新手友好度 48/100
MaterialDesignInXAML/MaterialDesignInXamlToolkit#4114 · 1 個 reaction ·
維護者通常 1 天內回覆
查看 MaterialDesignInXAML/MaterialDesignInXamlToolkit 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
Natvs/Nt.Automaton#33 ·
-
enhancement
難度 2/5 1-3 小時 新手友好度 68/100
-
a-corriger documentation
難度 2/5 1-3 小時 新手友好度 82/100
christian-raj/S-Aloha#312 ·
-
ready-for-agent tech-debt
難度 1/5 1-3 小時 新手友好度 85/100
DigiBanks99/menlo#640 ·
維護者通常 1 天內回覆
-
ci
難度 1/5 1 小時以內 新手友好度 62/100
OpenTabletDriver/OpenTabletDriver#5283 ·
維護者通常 3 天內回覆