草庐IT

c# - GetAdornerLayer 神秘地返回 null

我一直在为我的应用程序的多个版本使用相同的代码,没有任何问题,但我现在神秘地收到了包含以下内容的NullRerefenceException:this.Loaded+=delegate{deleteBrush=newDeleteBrushAdorner(background);AdornerLayeral=AdornerLayer.GetAdornerLayer(background);al.Add(deleteBrush);//nullrefhere??};background只是一个Border元素。我对可能导致它的两个想法是:a)切换到.NET4.0,以及b)将上述元素(它是Us

c# - 调试时如何去掉 "Go to live visual tree"/"Enable selection"/"Display layout adorners"覆盖?

如何在调试时删除带有3个图标的框? 最佳答案 只需取消选中工具->选项->调试->常规->为XAML启用UI调试工具->在应用程序中显示运行时工具。 关于c#-调试时如何去掉"Gotolivevisualtree"/"Enableselection"/"Displaylayoutadorners"覆盖?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/36727482/