Questions tagged [freezable]

A WPF class which defines an object that has a modifiable state and a read-only (frozen) state. Classes that derive from Freezable provide detailed change notification, can be made immutable, and can clone themselves.

42 questions
49
votes
4 answers

In what scenarios does freezing WPF objects benefit performance greatly?

Many types in WPF derive from Freezable. It provides immutability to mutable POCO objects and, apparently, allows for improved performance in certain situations. Has anyone found that freezing objects within their WPF application has greatly…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
33
votes
1 answer

How to Freeze First Column of WPF DataGrid

I have a WPF DataGrid.. I want to freeze first column of that WPF DataGrid while horizontal scrlling.. My code is:
Avinash Singh
  • 2,697
  • 11
  • 44
  • 72
32
votes
2 answers

How can WPF objects deriving from Freezable be frozen in XAML?

Many types in WPF derive from Freezable. It provides immutability to mutable POCO objects and allows for improved performance in certain situations. So my question is, how can I freeze objects in XAML markup? (Note that I have posted a similar but…
Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
31
votes
3 answers

Workaround for WPF Freezable bug?

I've been hitting a really bad WPF bug recently. I think it's the same as this bug on Microsoft Connect. Our application targets .NET 4.0 Client Profile using Visual Studio 2010. Basically, when a ViewModel triggers a change to any property or…
will-mvn
  • 659
  • 1
  • 6
  • 10
22
votes
1 answer

Why is CompositeCollection not Freezable?

I am writing an application using the MVVM pattern. I am providing data to my view by setting my view's DataContext property to an instance of my ViewModel. Generally I just use Binding from there and go about my way. Recently, I tried to…
Anderson Imes
  • 25,500
  • 4
  • 67
  • 82
11
votes
1 answer

What is a parent freezable? What does this error mean?

I'm getting this error: Cannot use a DependencyObject that belongs to a different thread than its parent Freezable What does that even mean? Is it in English? Is the parent frozen, or is it just freezable? Any way to make a parent not…
mmr
  • 14,781
  • 29
  • 95
  • 145
6
votes
1 answer

How to freeze freezable objects that cannot be frozen

In my scenario I want to freeze a non changing BitmapCacheBrush before I want to render it in a background task. Unfortunately I receive the error "This Freezable cannot be frozen". Is there any workaround or hacky way freeze also not freezable…
Andreas
  • 3,843
  • 3
  • 40
  • 53
5
votes
3 answers

How do I create my own Freezable class?

I've tried MSDN but there is not an example for deriving from Freezable. Update: Yes in the MSDN there's an example with animations but it's too complicated. need something simpler to understand freezable.
Erez
  • 6,405
  • 14
  • 70
  • 124
5
votes
3 answers

How to debug this error when none of my code shows up in the stack?

I'm sometimes getting the following error in my application: Cannot use a DependencyObject that belongs to a different thread than its parent Freezable I know how to solve this kind of error, but in that case I have no idea where it is happening,…
Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
4
votes
1 answer

Using Pen with DynamicResource in style shared across multiple UI threads

I have a custom WPF control that has a dependency property of type Pen (used to style a dividing line within the control). The default value of this property is supposed to be a system color -- and if this default value is used, the control must…
Daniel
  • 15,944
  • 2
  • 54
  • 60
3
votes
1 answer

What is the difference between Freezable.Clone() & Freezable.CloneCurrentValue() methods

The documentation says Clone- "Creates a modifiable clone of the System.Windows.Freezable, making deep copies of the object's values. When copying the object's dependency properties, this method copies expressions (which might no longer resolve) but…
Nitesh
  • 2,681
  • 4
  • 27
  • 45
3
votes
1 answer

Changing the visibility of a frozen object?

I'm trying to optimize my WPF/VB.net program, and I'm considering freezing some objects. However, while I know that an object that is animated in any way cannot be frozen, I need to know...can you change the visibility of a frozen object? Thank you!
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
3
votes
2 answers

Automatically freeze wpf-objects built from templates

Is it right that wpf-objects that are freezable are freezed in any case automatically if they are generated through a DataTemplate, ControlTemplate or a style?
HCL
  • 36,053
  • 27
  • 163
  • 213
3
votes
2 answers

Any "Gotchas" with using Freezable class outside of WPF?

I've been reading up on concurrency, and looking at things from a more "thread safe" point of view. WPF (or actually System.Windows.Freezable and others) has a freezable class, which can give "popsicle immutablity". Has anyone tried using this…
Bless Yahu
  • 1,331
  • 1
  • 12
  • 25
1
2 3