Google+ Badge

Monday, June 21, 2010

VS 2010 needs to be fixed

Not sure if a day can be much more frustrating. VS 2010 was my nemesis all day long today. I could load a project and run it without a problem but the WPF XAML designer refused to show it. Sure it showed it exactly once then I ran the program and it could never show it again. Said it could not find the only name space used in the entire project.

I am running Win7 / 64 bit. Tried the exact same thing on XP 32bit with no issues. Of course that is of little help to me. I will have to figure out some way to prove this to Microsoft I guess and hope there is a fix at some far off point in the future.

I spent most of the day figuring it was my fault as most programmers tend to do. Instead it looks like some OS / VS combination is at play.

Adding to the fun I spent the last part of the day trying to get all scrollbars to style the same way in XAML. Turns out it is a single line of XML to do it but searching the web to find that one line was not fun. Then after I got the one line it turns out the scrollbar XAML kicked out by our designer using Blend needed to be tweaked too. Will have to finish making that fully work tomorrow. We got a slider working pretty quickly, and I need to go back in and change code to use that globally instead of adjusting for every instance, but the scrollbar is more complex and thus causing new headaches.

Here is the final code line I needed. So many websites just list the code and not where it belongs in context:

<Window.Resources>
<!-- Pull in our styles via merge calls -->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles.xaml">
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<!-- Here is the magic section -->
<Style BasedOn="{StaticResource NewScrollBar}"
TargetType="{x:Type ScrollBar}">
</Style>
</ResourceDictionary>
</Window.Resources>