This is a migrated thread and some comments may be shown as answers.

XAML Brushes and memory leaks

3 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 18 Jan 2012, 09:48 AM
Hi,
why are Telerik brushes in XAML-Code not froozen? Potential memory leak?
More here: http://blogs.msdn.com/b/jgoldb/archive/2008/02/04/finding-memory-leaks-in-wpf-based-applications.aspx 

3 Answers, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 23 Jan 2012, 03:14 PM
Hello,

Do you experience a memory leak? They are not frozen so we can change them at Runtime. You should be able to freeze them by setting the MetroColors.PalletteInstance.Freeze(); Also in WPF4.0 they will be frozen once the "new MetroTheme()" is instantiated.

Kind regards,
Pana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Ioan
Top achievements
Rank 1
answered on 24 May 2012, 12:38 PM
Hi, 
I'm in .NET 4.0 and because now ressources are freezed, I get this exception "This Freezable cannot be frozen". What I want to do is use a static brush declared like this:

<SolidColorBrush x:Key="BasicBrush" telerik:MetroColors.Color="Basic" />

in an animation.

Apparently .NET calls the Freeze() method without checking first that the brush has already been freezed.

Update: 

This did not happen in a previous version. The current version that generates this exception is 
'RadControls for WPF Q1 2012 SP1'.



0
Ioan
Top achievements
Rank 1
answered on 24 May 2012, 12:49 PM
Just wanted to let you know I found a possible solution to my problem (the freezable exception) by declaring brushes a little bit differently (I inspired myself from this telerik page):
<SolidColorBrush x:Key="BasicBrush" Color="{Binding Source={StaticResource MetroColors}, Path=Palette.BasicColor}" />
Tags
General Discussions
Asked by
Christian
Top achievements
Rank 1
Answers by
Pana
Telerik team
Ioan
Top achievements
Rank 1
Share this question
or