c# - GetAdornerLayer mysteriously returning null -


I am using only one bit of code for many issues without any problems, but now I Mysteriously I am receiving NullRerefenceException s with the following:

  this.Loaded + = delegate {deleteBrush = new DeleteBrushAdorner (background); Edgar Lair al = Edner Laure.GateAdnerner Layer (background); Al.Add (deleteBrush); // blank ref here ?? };  

background is just a border element.

I have two ideas that this might be the reason). Switching to .Net 4.0, and b) In the above element (which is UserControl ), enter a ItemsControl < By giving examples of / code>

Strangely it does not happen at all times, and it will be difficult to predict when it will happen, so it is not reliable.

Docs to specify:

If there is no adder layer If you meet, then the law does a reverse return.

So my guess is that there is no anunderender layer .. do you have any reason to believe that this should not be the case? What is the guarantee that you are currently relying on that the visual tree will have a fluffy layer?


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -