Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 960
CodeMouse92 Avatar asked Dec 09 '25 23:12

CodeMouse92


1 Answers

Freezing a Freezable object conceptually makes it immutable so an attempt to write to any writable properties should throw an exception, including Visibility. You can however implicitly affect a Freezable object's state by containing it in a non-freezable object. For example, you can use a Grid or any other Panel as a wrapper and toggle the Visibility of the container and it will affect the seemingly immutable frozen object indirectly. That being said, freezing doesn't really buy you very much efficiency-wise unless you are making quite a lot of copies of the object.

like image 165
Rick Sladkey Avatar answered Dec 11 '25 21:12

Rick Sladkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!