Whilst editing a WPF view, the XAML designer claimed it couldn’t display a child user control due to a null reference exception. Looking at the stack trace, I noticed a wonderfully named method…
Why would anyone want to create in instance slowly? Wouldn’t it have been better to have written a CreateInstanceReallyFast()
method?
Mind you, it explains a few things about the XAML designer in Visual Studio!
Hmm, all sorts of strange thoughts fill my head. I wonder what the XAML designer code really looks like…
public XamlDesigner() { if (!UserIsFedUpWaiting) { while (UserIsNotDrummingFingersOnTheDesk) { Thread.Sleep(5000); if (AlreadyDelayedMoreThanThirtySeconds()) { VisualStudioIsNotResponding = true; } } } DisplayRandomExceptionInDesignerWindow(); if (xamlDesigner.Exception.UserHasExpanded) { CrashVisualStudio(); } }
Ooh, aren’t I a cynic?
Ha ha that’s hilarious! I’m not a programmer but know enough code to understand that. Your blog looks like a lot of fun!