Here is the situation: I have an editor app, that edits some hierarchical data. The data itself is held in ViewModel class, and View class is responsible to reflect changes in ViewModel. The main part of the View is ContentControl. When data changes in ViewModel, a hierarchical structure of controls is (re)generated and top-level control becomes the Content of the ContentControl. Of course, those hierarchical controls have bindings.
Now it's time to close the editor. ViewModel reacts to command and clears the data. PropertyChanged is raised and the View is ready to react: it attempts to do

myContentControl.Content = null;


But this is where the pitfall is: WPF detaches hieararchy of controls from ContentControl's visual tree and re-evaluates bindings. But the data is already destroyed! 

What should I do? Why WPF updates bindings on controls that go out of visual tree? Of course I can do additional check for nulls, but is there a way not to do binding at all on half-dead controls?


Question: How to display zero value as blank cell in mac numbers 3.1
Answer: The easiest way is to use "Conditional Highlighting..." found under the "Format" menu.

Select the cell you want to have blank as zero then select "Conditional Highlighting" you then set a highlight when the cell is equal to zero. Choose  "Custom Highlighting" at the bottom of the style list and then you can set the text colour to white. A "blank" cell on zero.