Funny stuff.  I’m part way through chapter 7 – however far I am, I honestly don’t know.  Who’s counting anyway?

Excerpt from wherever the heck I am in chapter 7:

“… Earlier in this section, you learned that it is best practice to put all of your Styles in a ResourceDictionary, and you even learned how to do that.  So, why did I have you create your Button control Style inside of your Window1.xaml if it is not best practice to do so? …”

Most coming upon this would think that he was going to mention why it might be a strong point where best practice doesn’t always mean “always practice”.  But nope, his next line is:

“… Did I make a mistake?  Actually, yes I did…”

Most of the times mistakes allow someone to observe things from a perspective that they otherwise wouldn’t have seen something had they done it correctly.  Instead of covering that up or fixing it, he decided to use it and write that he’s using it for us to learn how to fix something of this nature.

I can see how this might commonly occur too – especially when using an interface like Blend – it would be a matter of accidentally not clicking the correct radial.  Quite likely, when doing things quickly.

Regardless of that – I found it amusing to read.

Edit: to save on having yet another frackin’ post here spamming twitter and facebook, I thought I’d add to this post since its so closely related to the above content.

Just after the comment, Victor delves into fixing the issue where someone has placed the style mistakenly within the xaml document instead of in the ResourceDictionary.

A point which is not mentioned which I find incredibly useful (though sometimes buggy – blame it on the application being a beta) is the use of split view.  Especialy when working with huge chunks of XAML and I’m not wanting to go into Visual Studio.  It has a really nice feature in blend’s split view.

So for those who are following, give this a try.  Doesn’t matter what you’re working on – if youhaven’t anything, just create a new project and add something – anything – to the workspace.

Now click on the tab labeled “Split” which you can find on the upper right of the screen.  Now click on an item within the Objects and Timeline menu.  Notice how the XAML for that item is highlighted within the XAML pane of your split view.

I find this to be quite useful.

This site uses Akismet to reduce spam. Learn how your comment data is processed.