I've been working on a WPF project in Visual Studio 2010 and I came across a problem where Visual Studio would crash when I used the Document Outline while editing an XAML in the Design view. There seems to be several ways of solving this but all the methods seem to involve code either as a separate class such as a ViewModelLocator or in a code-behind using GetIsInDesignMode. Here is a solution that uses (mostly) XAML. First, create a new ViewModel class that is a stub or mock. This class will also allow you to have some design-time data that won't crash Visual Studio. Then implement the following XAML to select between your main ViewModel and your mock ViewModel. The Blend XML Namespace ("d") is marked as Ignorable (only available during design-time) then AlternateContent is used to select the MockViewModel if the "d" namespace is available (design-time) and fallback to the MainViewModel (run-time).
I've finally had some free time to work on the Label Sphere. The new version should correctly color the labels according to your blog's color scheme on Chrome, Firefox, and IE 8. The new version has not been added to the Blogger gallery yet, but when it does get added I will post an update. To use the new version, add a new gadget to your blog, select "Add your own" and use the following URL
A reader pointed out that my Label Sphere wasn't working as advertised. I took a look at both our blogs and they both looked fine, then I realized it must be a browser issue. I looked again with Firefox and sure enough the labels were all stacked on each other at the bottom of the gadget. I made the mistake of only testing in one browser (Google Chrome). The issue with Firefox was that the label container was collapsing, then JavaScript got a very small height for the container which resulted in a very small sphere. To keep the container from collapsing I added the following to the style of the container (as stated in the link): overflow: hidden; width: 100%;
For the sake of completeness I checked the Label Sphere using IE8 on my gf's computer (the only IE I can get on Arch Linux is IE6 and I've decided I don't want to support IE6) and sure enough IE8 had a JavaScript error about "Object doesn't support this property or method". This error occurred while…
Comments