From 686476ca4e29c0595eff2062c86ed0153f8e9cd7 Mon Sep 17 00:00:00 2001 From: Jan Karger Date: Mon, 25 Sep 2017 17:24:36 +0200 Subject: [PATCH 1/2] Set effect directly as DynamicResource use po:Freeze="True" and x:Shared="False" for effect --- .../MahApps.Metro/Styles/Controls.PasswordBox.xaml | 9 +++------ .../MahApps.Metro/Styles/Controls.TextBox.xaml | 6 ++---- src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml | 2 ++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml index cb2e83783e..f2e12d223d 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml @@ -151,6 +151,7 @@ Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" + Effect="{DynamicResource WaitingForDataEffect}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> - - @@ -366,6 +365,7 @@ Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" + Effect="{DynamicResource WaitingForDataEffect}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> - - @@ -579,6 +577,7 @@ Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" + Effect="{DynamicResource WaitingForDataEffect}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> - - diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml index 91a31ebc82..7edd0d2673 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml @@ -67,6 +67,7 @@ Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" + Effect="{DynamicResource WaitingForDataEffect}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> - - @@ -290,6 +289,7 @@ Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" + Effect="{DynamicResource WaitingForDataEffect}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> - - diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml index 899ff20a53..c17d8d8ff2 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Shared.xaml @@ -13,6 +13,8 @@ Exponent="2" /> Date: Mon, 25 Sep 2017 23:05:04 +0200 Subject: [PATCH 2/2] Fix #2990 TextBox memory leak Remove the BitmapCache at AdornerDecorator.CacheMode which is causing the GPU memory leak if the app will be minimized --- docs/release-notes/1.6.0.md | 1 + .../Styles/Controls.PasswordBox.xaml | 16 +++++++--------- .../MahApps.Metro/Styles/Controls.TextBox.xaml | 9 +++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/release-notes/1.6.0.md b/docs/release-notes/1.6.0.md index 3bfd589650..1eb5e29e9f 100644 --- a/docs/release-notes/1.6.0.md +++ b/docs/release-notes/1.6.0.md @@ -80,3 +80,4 @@ More informations about the reason of this decision can be found here: - [#3054](https://github.com/MahApps/MahApps.Metro/issues/3054) WindowsSettingBehaviour broken after using ControlzEx - [#3028](https://github.com/MahApps/MahApps.Metro/issues/3028) SaveWindowPosition causes application to crash - [#3023](https://github.com/MahApps/MahApps.Metro/issues/3023) Custom Dialog Theme Issue +- [#2990](https://github.com/MahApps/MahApps.Metro/issues/2990) TextBox memory leak diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml index f2e12d223d..a67d89c15a 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.PasswordBox.xaml @@ -144,9 +144,6 @@ - - - - - - - - - + + + + + + + diff --git a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml index 7edd0d2673..3388d6e8b2 100644 --- a/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml +++ b/src/MahApps.Metro/MahApps.Metro/Styles/Controls.TextBox.xaml @@ -60,9 +60,6 @@ - - - - - - + + +