Facing Blend

Facing the blend between design, work, and family

Posts Tagged ‘ WPF ’

I don’t like giving bad reviews, but when I sent my email in RSVPing a chair at an event called, “XAMLFest” I was expecting to have so much XAML that I’d feel as if I was being assaulted with confetti thrown everywhere – XAML confetti.  Unfortunately, that’s not what we(myself and the other attendees) got.  Instead, we experienced a whole lot of WPF and Silverlight, and I’d gauge about 1/3 of the entire thing was XAML, and most of that third was in the second day.  So for those who did not return after the disheartening first day, they missed out on the bulk of the XAML related content.

If you’re interested in more details, please read on:

Yesterday evening was the ending of the 2 day event, XAML Fest.

This 2 day event boasted through its name a full 2 days of XAML in concentrated form.  After personally attending this event, I’d like to propose a change to the name to “WPF Fest” or something to that effect.

The first day primarily focussed on the model of M-V-VM.  There are links all over the web regarding this, so if you’re curious about this, a google search will guide you in the right direction.  The first day we were knee-deep in c# between the constructors, creating multiple new classes which referenced each other, and having these tie into 5 lines of XAML.  By the end of this day, I was thoroughly frustrated.  Not that I don’t enjoy more information, alternative ideals, and learning more C#, but I’m at this point wondering why this thing is being called “XAMLFest”.  I will mention that towards the end of day 1, there was a bit more touched upon by way of walking us through the interface of Expression Blend and the construct of XAML files.

The second day was Silverlight centered and in as much, quite a lot paralleled the first day, however, there was a considerable level of XAML done in comparison to the first day, including the integration of our silverlight application with a 3rd party control called Blacklight, which is a very nice set of controls made available for download on Codeplex that really were pretty awesome.

After lunch, we dove a lot deeper into the workings of expression blend, customizing buttons and other controls which come with expression blend.  We challenged the blend presentor with questions that he wasn’t exactly comfortable with, but showed us regardless.  The interaction and enjoyment from those in the room definitely escalated during this part of the event, and from there on that tone continued to the end.

So at least it ended with a bang.

I would like to mention that it was definitely worth attending.  There were a few things that I discovered I was doing (as usual) the more difficult way.  Now I have a bit of restructuring to do in a way of preserving the integrety and bringing down pageload time – 2 things that I am always trying to improve upon.

If I were to letter-grade this event, I’d give it a C+

The most recent group meeting with the Seattle Developer / Designer Interaction group was great – I think one of the most fun that we’ve had so far.

One of those attending was development Evangelist, Mithun Dhar, who mentioned to us the 2 upcoming XamlFest training events occuring next month.

I can’t help myself – 2 days of uninturupted training and colaboration with others who are interested in development and design working in WPF and Silverlight?

My email has been sent in to RSVP a spot – especially w/ mention that there are only 50 seats available!

Ok, so if you’re visiting and interested as well, here are a few links with information:

http://blogs.msdn.com/usisvde/archive/2009/01/22/designers-developers-ramp-up-with-februrary-xamlfest-events-across-the-usa.aspx

http://blogs.msdn.com/MithunD/

The skinny that you’ll find there is this:

Redmond & Portland both are hosts to XamlFest in the Pacific Northwest.  There are other areas that have these events as well, but I’m just going to talk about the 2 which are close to my home.  The Redmond, Washington one is the 16th and 17th (Monday and Tuesday) of February, and Portland, Oregon one is on the 19th and the 20th (Thursday and Friday).

If you wish to join, RSVP asap – seating is limited and I mean quite limited. 

The email addresses are fairly obvious which is for which, so I’m going to just list them both below:

xamlfest-redmond@live.com

xamlfest-portland@live.com

All who attend will obtain a copy of Expression Studio and Visual Studio 2008 Pro.

January 8, 2009 | No comments | Facing Blend

Screensaver

I ran across a site which offers to anyone who is interested, a template for Visual Studio which assists in the creation of Screensavers.

The site is Scorbs.com. The link takes you straight to the blog about the WPF screen saver template.

In any event, I just wanted to do something really simple – so I took about an hour and a half and the YouTube video shows the creation.

The youtube video doesn’t really do it justice, unfortunately, but here it is:

Update: Someone mentioned something which I hadn’t considered – this wouldn’t be a good screensaver to use on a system which actually needs a screensaver, such as plasma screens, as the rotating “viewer ball” would become burned into the screen.

Update with Copy for your downloading pleasure:
http://www.facingblend.com/blog/ProjectUploads/nLighten.zip

This will be the first time I’ve done something like this – so if you run into issues, please let me know.
Please note: After you unzip the files, you’ll need to rename setup.exe to setup.scr

This thing that I’ve been talking about all day which has been driving me up the into a wall is finally in a state that is viewable.

Its a basic set of 3D text and a shape, neither of which is “rendered” in the way that many are used to when thinking of using 3D modeling tools, instead, its been kept somewhat raw but in an interesting way – its all kept as code – XAML to be exact.  It includes environmental factor code to allow for lighting and color variations when the text “interacts” with the lightsource.

I don’t know enough to know if it can be used in a way where multiple sources of light are present, but at this point, I’m pretty impressed at the power of XAML.

The below video is a camtasia recording of the “application” such as it is.  The button is set up, not with a trigger to start (which could have easily been set), but by a c# method.

The only thing that I would do differently is to have the button reset the storyboard to 0 (zero) on mouseDown which should allow for the storyboard to “rewind” and replay.

I’m wondering if it would be something where it would detect the place of the animation – such as  if the storyboard is greater than 0, then reset to 0.

I’m digging around google and have posted on the WPF MSDN forums to see if I can find an answer.

Anyway, here’s the video:

It wasn’t a real hole – it was a well painted brick with great perspective – I’ll just walk around the wall.

The program which I was using unfortunately wasn’t spitting out the xaml for the entire thing that I was viewing. It had the perspectives and the object and its name, but none of the factors regarding angles, colors, shades, textures, or any of that.

So I resorted back to just using what Victor gives in his example on his website and have played around with that. Since I wasn’t able to create the objects, I figured I should at least work for it – right?

So I went through the xaml and hand-changes the aweful red/brown/pink color that his “WPF” was at. At least he’s going w/ the theme presented by the cover this time.

So I modified the “WPF” and turned it into a nice shiny blue but retained the gold hoop which is behind it.

Here’s the fun part – now that the 3D element has been created, I can modify it in Blend. The 2 objects can either be modified as a unit or individually, and that’s QUITE a lot of fun.

So I’m somewhat going outside the boundries of this chapter. Not by much, but a little. Its fun to see what “this button does”.

Anyway, when I have the entire exercise completed, I’ll camtasia it for all of you viewing the blog and put it up on youtube. :D

I’ve finally completed chapter 2 (didn’t take very long – lots and lots of comments though… ) and I would have to say that I am happy with the book so far.

It maintains my first impressions – that the author is talking to me as opposed to writing a book.  I have a very difficult time getting through books which are so “technical manual” that the words start meshing together like someone who hasn’t a clue how to enunciate.

The final product from chapter 2′s “lab” also included something about triggers that I didn’t know.  I’ve been hand-coding triggers with my very limited knowledge of C# when I could have been using blend to do it all for me.

My conclusion: This book will likely fill in far more blanks than I imagined, when chapter 2 has already brought me to an easier way to do things… though I’m the type of person who somehow always manages to learn something the more difficult way and at some point after, often WAY after, I locate a much quicker, simpler, and easier way to do that same something.

Makes one highly appreciative when you go about learning things that way.

Onward to chapter 3.

There is no possible way to actually get through and locate every single error and discrepency in a book. The hundreds of times the author and editors comb through the book and modify things – by the end, I’m sure the entire team feels dog-tired.

However, I’m someone going through the book and using it. My job is to be snobbish, accusatory and unappreciative, as well as blissfully ignorant of the high levels of iterations and reiterations that went into said book. Oh, and I’m supposed to say things like, “I could have spotted this from a mile away” or something to that effect.  I cannot forget the most important part: I must have a high level of grammatical and spelling errors to give a level of poetic irony.

I hate doing things that I’m “supposed” to do.

But I will point out 1 mistake/discrepency here and well – I’ll likely point out the others which I come across because its fun that I spotted it and its even MORE fun to tell that I spotted it.

Anyway, in Chapter 2 you’re requested on page 35 to modify your TextBlock size to w: 400px h:100px and in the screenshot of the program where you make these changes, the comments below the screenshot example read:

“Figure 2-19. Changing the Width and Height of your [TextBlock] to 400 and 100, respectively”

Then later, after modifying the foreground colors to be nearly jab-my-eyeballs-out gradients (sorry, I’m not a fan of the standard use of green-white-red gradients for the purpose of tutorials and teaching material. I find that practice to be abhorrent and if you’re going to really go after something that is easily observed, why not go all the way towards horrible colors instead of half way? Use neon pinks or something, it would match the book’s cover too! I hate pink, but going along w/ the theme presented from the cover, let’s take it home all the way, man!! Consistency! Consistency!), you encounter on page 38 the line:

“Because you set your [TextBlock] to the Width of 600 and a Height of 100…”

Wait, I did what?

I didn’t set my text block to a width of 600 – I set it to a width of 400. *twitch*

Ok, its fairly minor, but I’ll go ahead and change my TextBlock to 600 since you said that I already did. Maybe he’s just trying to use “The Secret” on the readers?

Edit: Just after posting this, I continued and almost immediately stopped because I was trying to as closely emulate his “lab” by using the same font-type.  He has in his picture the font-type of “Segoe UI”.  At first glance, that is likely not an issue.  However, when looking through my own listing of fonts, I’m finding that I don’t have said font.  I’m going to make a guess at where this font came from: One of his recent clients!!  I could be wrong, but w/ it having the label of “UI”, I would be willing to guess that this might be the name of the font which is named to assist with quick-reference, and “UI” designates where that font is used.  Woopsy!  The image of the font looks very very similar to Verdana but with slight modifications to make it almost DIN-Medium.

Going through Victor’s book – chapter 2 is fairly short, but the “lab” at the end of it, the typical “Hello World” which is seen, as he mentions in his book, in most every book or introductory guide to programming, application development, and other types – is already a bit obsolete with the releases of later versions and updates to Blend.

Please note: His “Hello World” is not anywhere nearly as boring as many.  He goes through a lot of the basic orientational-use of Blend including gradients, modifying colors, color stop properties, application window resizing, key-frame animations, quick-key uses, and more.  Its more than worth going through.

In his book, he indicates that gradients start out left-to-right, and instead modifies things to go top to bottom.  Unless I’ve modified my default settings (which I don’t recall doing), mine is set exactly the opposite.  The “Gradient Brush” on mine starts from top to bottom, so several parts of the tutorial, including the very eye… catching *cringe* Christmas colored “Hello World”, which gradients from Red to White to Neon Green, will require you to rotate the gradient angle.   Remember, much like Adobe products, holding the shift-key down will maintain true-angles, which assists in obtaining an accurate rotation of exact 90¤.

I have to note that earlier, I asked the “Why?!” of the C: drive for locatino of projects.  I’m beginning to see why he has that as his choice.  For the purpose of this book, having everything held within a root “Projects” directory makes guiding those reading the book, quite easy.  Most who will be using this book who have different preferences will just place things wherever they want anyway, so it really doesn’t matter except for the use of guidance within the book where a person puts items, so long as they know where the file was placed.  Typical document saving 101.

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.