The MediaElement – Quick comment

Posted on

The very beginning of chapter 6 in Victor Gaudioso’s book on Blend 2 discusses the MediaElement and goes into details regarding Independent mode.  Towards the end of this, he explains why one might decide to have the URI called in C# instead of XAML, using what essentially is an example of a typical media player – such as Winamp or Windows Media Player, where the application is programmed to look for the information after the user has given it input.  In his example, it was by dragging a video from the user’s My Documents, into the player, and the player interacts in such a way where it not only plays this content, knows its location, but also displays data which is stored within this media file.

Well towards the end, he explains that this cannot be done via XAML because the XAML is only rendered upon loading the application once, by default. 

At the very end of the section is a line:

“Technically XAML can be changed on a XAML EventTrigger, but that is beyond the scope of this book.”

I find this comment to be interesting.  Many – too many in fact – books that I’ve read start out with the obtuse beginning proclamation which has been used far longer than my own existance, “This book will tell you everything you need to know… ”  *twitch*

That statement immediately reminds me of one which I have in my memory from childhood.  We were purchasing the family’s first computer.  It was an Acer Intel Inside Pentium.  The salesman’s comment (I’m sure many of you may already know where I’m going with this) was that the computer was so advanced that we won’t need another.  Ever.  The hard drive will never run out of space.  The memory is so advanced that nobody’s computer will be as fast as our’s.

*twitch*

Back to Victor’s comment in his book.  The fact that this comment is even here, is a sign of the times.  People of the current times are more often than not aware that the possibility of the infinite where something has an end is nill.  There will always be more after something has “an end”.  If there is an end, one must conclude that there is more outside of the scope of the said object.

It truly wasn’t that long ago that many would be ashamed to even mention that something exists outside of their creation.  Its nice to see the changing times.

Handyman Toolkit

Posted on

By the end of Chapter 5 of the book, I’ve discovered that yes, you can learn how to use this software without the assistance of a book, but had I been able to obtain this book a year ago when I started tinkering with Blend during my spare time, I would have greatly benefited from having this “in my back pocket” sort to speak.

The biggest confusion factor which I had when cutting myself off of Adobe products, cold turkey, to force myself to learn how to use Design and Blend, was the “when do I use the stackpanel over wrap panel?” or “Should I make this a canvas or a grid?”. Plus there was the creation of something primarily vector instead of part raster and part vector – that bit is something that illustrator gurus will likely not have any problems with, but most who design for the web tend to take preference to Photoshop – and only on occasion delve into primarily vector bases.

Now, the intent of this chapter was to get you familiar with the Layout elements and the unique attributes each layout element presents, however, there are underlying instructions which would assist a raster-based designer into being more comfortable with the ideas and ease when using vector shapes. They’re not that different to create and have the added scalability that raster(bitmap based) images just cannot do due to their innate nature.

In any event, the entire chapter is essentially “This is what X is, how about we apply this to give you hands-on experience with X”. We went over the following: Border, Canvas, DockPanel, Grid, Scroll Viewer, StackPanel, UniformGrid, ViewBox, and WrapPanel layout elements.

By the end of the chapter, the application is like a circus of vendors in graphical format. Victor is sure to mention in his book that he’s well aware of the lack of space towards the end.

Without further ado, I present my circus:

Click to view full sized image
Click to view full sized image

Inheritance – classes

Posted on

Chapter 4 of Victor’s book talks about XAML, C# and scratches at the surfave of both of these, including general information to make sure that the reader is able to follow further in the book regarding OOP(Object Oriented Programming) and in the subject regarding inheritance, he’s talking about superclasses and how the parent and children classes inherit the superclass in which they reside. He goes further into the analogies of how these work, and asks one to contemplate the pain of an inverse situation. He uses the example of fruit.

A superclass of “Fruit” as he describes, being that fruit is an edible container with the seeds of a plant inside. Oranges, Apples, etc. being children of the “Fruit” parent. In the case of inheritance, if Oranges and Apples are under the superclass of “Fruit” then both Apples and Oranges “know” that they are edible containers with seeds of their own plant. There is no need to “program” that individually when they are set as child-classes. If they were not set up as child classes, then one would have to individually tell each one, programatically, the properties of a fruit.

The inverse of this situation is one which I have encountered far too often – with much frustration, at that.

Many applications used – and still in very heavy use today, were often built reactionarily (… is that even a word?). What I mean by this is – there was a demand, and so came the birthing of some application or another. Every addition to this application was created as a reaction to a need.

Now, that doesn’t really sound bad on the surface. However, the reality of this is … not always good.
My day-after-new years-eve mind is having a difficult time coming up with a good example which would be easy to use, but the only things that I’m coming up with are so convoluted that most would get lost without diagrams.

Cleaning something of that nature up is much like many things – it might often just be easier to not even try to fix it and instead to start from scratch. This type of thing… I put up there with having a complex multi-page web-based application which has its styling willy nilly across the span of 200 aspx pages, 18 stylesheets and let’s not even talk about the markup styling done directly in the structure.

3DImage – a video of the lab

Posted on

Depending on the project and the visuals, I felt that it would be beneficial to not only blog about the experience while going through the book, but to give further visuals for those who are following this blog – perhaps it will assist those in making their decision as to which books might be good – so here is a youtube video of one of the very first things which you are walked through doing in Victor Gaudioso’s book on Expression Blend 2.  This is at the very end of chapter 3 and is pretty easy to do.  I took it a step further than explained, but if you are following along in the book, you’ll notice that nothing that I have done here is outside the scope of information that has been explained through the first few chapters.  To reword that: If you’ve never used MS Expression Blend before, you could use the knowledge gained up to this point to emulate what is done in this video.

Alt-commands in namespace – call me confused

Posted on

I’m going through the lab at the end of Chapter 3 of Victor’s book – a recap of the steps until now are basically thus:

Create new project, tell the project to include an image in its solution, open the solution into the workspace and  convert it to a 3d object, then rename it to 3DImage.

What Blend automatically does when renaming it, is apply an underscore at the beginning of the name and after the attempt to ‘correct’ this, it reverts back to _3DImage.

In my previous experiences with blend(its actually been a few months since I’d played around in Blend, so I’m truely beginning to wonder if I’m mixing this functionality up with something else), the use of the underscore (_) before any letter or number has been a nice way to allow for the UI to apply an alt shortcut (hotkey).

For example, if I were creating my own browser (if you ever decide to go through some of the more introductory C# development tutorials provided with Visual Studios, the creation of an internet browsing application is something you’ll likely go through.  Visual studios makes it pretty simple to accomplish this type of application), I’d set the menus “File” “Edit” “View” “History” etc. to have hotkeys for those who are interesting in accessing these menus with their keyboard instead of mouse.  To do so, I’d name them “_File” “_Edit” “_View” “Hi_story”, etc.

This will result in the menus appearing in the application as such:

File  Edit  View  History

These would make each item accessible by holding the alt-key down while hitting whichever character is underlined.

So its interesting that Blend is automatically placing an underscore at the beginning of the name.  Alternatively, I recall in the process of designing an interface (which I’m redesigning, but will eventually have available here on Facing Blend) having troubles whenever using a number in my namespace.  It wouldn’t build the application.  However, when replacing the number for the word (1 replaced for One), it would build.

Perhaps this is blend’s self-protection?

Chapter 3 – The Pan Tool

Posted on

I’m nearly through chapter 3 and I feel the need to take note here in the blog of a few points which I keep finding, forgetting, and finding again – which he mentions in this chapter.

The double-clicking of the Pan tool.

Far too often when I’m working on UI, I zoom in very closely on my objects to make sure that everything is lining up, every detail is perfected, and often I find the answer to the, “I’m not quite sure why, but that doesn’t look quite right – can’t put my finger on it, I just know that its not right.” by zooming in.

All of that sounds great – detail oriented being a rule of thumb of mine, however, there’s 1 issue with zooming in: It often is difficult to get to OTHER objects without zooming out, locating item, and the zooming back in.

Well Expression blend has a nifty thing with their pan tool.  When you double-click on it, your view will center on whatever object it is that you’re clicked upon in you objects bar.

When I’m not remembering that this functionality is there, it drives me nuts trying to remember what it is that I did in the past to make quick moving w/o zooming out.  Hopefully making note of it here will keep it more permanently in my mind.

Btw, if you’re lost – I’m going through Victor Gaudioso’s book on Microsoft Expression Blend and blogging as I go.