Yes!! Finally through chapter 1!!

Posted on

Its about time.  I think this is the 4th or 5th time trying to get through the book, and as mentioned before, something would crop up which prevented me from going through even the first chapter.  The last of which was an entirely different project taking up all my time – which is to say, something entirely unrelated besides by the fact that I was attempting to get through the book just before I started on said project.

So finally – I’ve gotten past the 1st chapter.  The universe has apparently concurred with me and my attempts to further my knowledge.

Yes!

Onward to chapter 2.

Closing textblocks inside open tags

Posted on

From my experience, I always kick myself every time I do something like the following:

<TextBlock Text="Bogus Text" />

The reason I kick myself is that I find by closing a tag like this, I’m essentially shooting myself in the foot before I get very far.  If I close a tag now, within the same line as I open it, I run the risk of having to break it out, and then do a </TextBlock> later.

Yes, this is just an additional step, but if I have a whole lot of conditions within this, I’ll find myself losing my place very quickly.  Instead, I’ll seperate the command – for just in case.  It sets up the markup for future additions.

Example:

<TextBlock Text="Bogus Text">
</TextBlock>

Preparing for the future saves you on time later.  Oh – reasons I mention this – again, from Victor’s book.  He’s having you create, just to test the application to verify that Visual Studios created it without flaws, a simple Text Block with “FOO” as the text.  Yes, it’s there just to test the application and verify that its functional.  However, if you’re in the habit of always always creating things for the future, you hardly ever have to think about what you’re doing when performing something as simple as the creation of a textblock.  Those habits tend to pay off in the long run.  If you do things “the lazy way” most of the time, and properly only when the time calls for it, you’re likely to accidentally slip into your lazy mode and have to correct yourself every single time you put the fingers to the keyboard.

Need I mention this “right way now” mindset applies to every other aspect of life?

Disabling design view in Visual Studios

Posted on

For those that missed my blog earlier today, I am going through the Victor Gaudioso’s book on Blend 2, and one of the first things he has you do is create your application, not in blend, but in Visual Studios.  He makes quite a few valid points why he does it this way – the theme around these points centers around cleanliness of the markup and code – of which I can thoroughly identify with.  My greatest pet-peeve about coming into projects in the middle is that most things that I encounter are done half-*ss and sloppy instead of being done cleanly, properly, and legibly.  The typical user won’t see the code, but for those who will have to come in after the initial work is done, doing things correctly the first time, saves a company in the long run.

So before I get myself into even more of a rant on that note, I’ll stop myself and just say that I concur with Victor.  Cleaner is better.

The next thing he has you do is create the specific type of WPF application, move it to a c: directory folder (c:/ ?  Why?! ) and then goes into removing the design view by having you “Open with…” the document and open it in XML view.

… Why?

The easier way which allows you to retain the nice color distinctions which are by default – and in many cases, turned off when viewing in XML view – is to just click the little “-” button right above the designer.  Now, I’ll take it a step further and move the design view to nest below my code view, and then minimize, which just gives the ability to view if you click on the design tab.

Why go through the “open with”, which takes away a tiny level of functionality?  It may be tiny – miniscule, in fact, but I like that functionality, dangit!

So I’m skipping his step here.  For those who are interested in following me along on my trip through this book, I’d recommend that you just minimize the design view and have the code-view take up the screen.