I love my Visual Studio

Posted on

About a quarter of the way into Victor’s book on Blend 2, he’s stepping us through the changing of the window’s default styling to specific items as they are displayed within a listbox.

Well he mentions that Blend doesn’t allow you to edit this visually, however, you can change it in the XAML – so he directs you to click on the tab which allows access directly to the XAML code.

In this area, I discover a feeling as though the world is closing in on me. Sometimes everything blurs together and I’d like to just see what I want to work with. Call me spoiled, but I really – REALLY enjoy that functionality which is present within Visual Studio.

I used to be a notepad girl – did almost everything in notepad, and with that, I was just fine.

But then I was given this project that had several hundred individual .ASPX pages which hooked into a whole lot of other resources. It was nearly impossible to continue in my elitist notepad hugging.

So I took in a deep breath, gave in to all the hype that I kept hearing from others who were doing similar work and their constant prodding for me to give up notepad in favor of Visual Studio, and I downloaded the dang program.

… I fell in love.

I’m spoiled now. For the modifications of XAML, I very much prefer to pop into Visual Sudio – so I’m going to do that now instead of following the book’s direction.

Shhh… don’t tell anyone!


An example where I was doing it the hard way

Posted on

I’m a few pages in on chapter 7 of Victor Gaudioso’s book on Expression Blend. He’s talking about the creation of custom control templates.

Essentially – creating items such as list boxes, buttons, radial buttons, and other things that many applications use the default which windows provides (windows xp’s standards look different than windows vista’s so sometimes when looking at other blogs related to Blend, you’ll notice that the buttons are either more shiny or more plain – this is because they’re giving the windows system default buttons or listboxes. For many people, these types of things are so “usual” that they don’t even think about them. They just use them – such is how UI should be, in my opinion).

Instead of using the windows default, we’re going to customize these controls.

I didn’t have this book back when I was researching on how to do this. I couldn’t find much of any information on it except for a few example downloads of full control sets on the MSDN website. So what I started doing was locating exactly where the controls were pointing to, downloading the custom sets from MSDN, and then hand modifying various areas of xaml to determine what works where. Making things horrid colors so that they’d stand out.

This chapter is already shaping up to rewrite how I have been creating these custom control sets. WAY easier than what I was doing before.

Thank Goodness.

Media Player – a YouTube video of it

Posted on

The media player which Victor’s book steps you through on chapter 6 is complete.  I customized it a bit and added a back button, which was coded essentially as an inverse of the next button.

As far as the user experience elements, the play button plays, stop button stops, and pause button pauses, however, the pause button was set up as a toggle, so if it is pressed while paused, it will resume play.

Cool part that I feel I should mention is that all of the visual elements are done in XAML. The buttons appear to have been done in photoshop or illustrator, but they’re not. They’re 100% XAML code.

The limitations which I’m seeing are as follows:

The logic behind the next and back buttons are limited.  If you hit next to get to the next video, that works, however, you hit it again, and it doesn’t toggle back to the original – it just replays the 2nd video.

The same goes for the back.  If its on the first video and its playing, and you hit the back button again, it restarts the first video.

The last bit which somewhat makes me internally twitch, is that at this point, these buttons are functional, but they don’t appear to interact with the user.  I know – we’ll likely get there further into the book, but at the very moment, I just have to take my knowledge that they do actually do something and pretend that the interaction with the buttons is there in a, “Perhaps I blinked?” sort of way.  We’re not far enough through the book to start making further interactions, but in the interest of my own sanity, I told all of my buttons to change the cursor to the “Hand” so as to make them somewhat appear as if they were more than pretty pictures on a gradient.

Below is the video:

Note: This is second published video which displays an example of what can be accomplished as you’re going through this book on Blend 2. To view the first video posted click here.

Trying to confuse us?

Posted on

You get through the first 5 chapters, no problem.  Very basic stuff and then you get to hop into chapter 6 of the book and you are writing c#, creating custom buttons that actually do stuff, and having interactive media players.

I can recall  – maybe a year and a half ago? – a time when I spent hours searching for a media player which I can use for a few videos to play on a website.  Now I’m here, creating a media playing application – not quite web based, but still.  If you’re one who is able to get through design or basic coding tutorials, no problem – then I don’t see why you wouldn’t be able to get through this. 

Up through this point, I’ve created and wired up the buttons, “Play” “Stop” and “Pause” with the pause button having a boolean toggle applied to allow it to resume play if you click on the pause – while its paused.  Now we’re wiring up the “next” button. 

Though this is seriously tiny – in every other portion of the book, Victor has been fairly consistant, even to the point of having all but the first screenshot of “where are we saving this?” in a c:/Projects/WPFBookProjects/revised folder *cough*  – but he is now changing things on us!

We’ve been setting up this media player for the entire chapter, and compared to the other chapters gone through so far, this is the longest.  Up until now, he’s been using a video named, “tlc.wmv”.  Now all of a sudden, he’s too cool and needs to up the anny on it and use the infamous baby using an iPhone video.  Maybe its his own, and he’s naming it similar to the one on the web, maybe not – but come on!  What’d tlc.wmv do to warrant being replaced?!

Ok – I’m being a bit dramatic – I am, however, having a bit of fun with the creation of this application.  Once I’m done w/ this app, I’ll be sure to camtasia it like I did the basic keyframe animation from the end of chapter 3.

Discovery of the source for my video issues

Posted on

So I officially got stuck.

My XAML code was good and the tiny amount of c# was correct.  I tried a different video, tried a different format (wmv and then avi), I recreated the project, and hit a dead-end.  It would load the application, but there was no video to speak of and no runtime issues either.

So I took Victor up on his offer – I emailed him asking for assistance.  His response?  Call me – here’s the number.

If it weren’t for the fact that I have done the same when someone was going through a tutorial or guide that I’d created, I probably would have been stunned – possibly to the point of not calling, who knows.  But I’m used to telling others to do the very same, so I did just that – I called him.

So we went through the project together, but instead of coding the xaml by hand, we let Blend do it, and instead of setting it to manual, just to make sure that it would work at its default settings, to play on load, we tested it – to find the same result.  The program rendered – however – the video wasn’t present.

However, he was doing the project himself and his worked fine.  So I started to question my setup.  I’m actually doing all of this on a MacBook Pro – that’s right, a mac.  I run Parallels and up until now, I’ve had no issues with this setup.  Its been a pretty sweet setup, actually.

So I took my project, popped it onto my new shiny 8gig pen-pop sony thumb drive, and brought it to my PC which has Blend 2.5 on it.  Loaded up the project and… it ran perfectly.  Video was in tact.

So we did it again, this time starting it in Visual Studios, porting over to Blend and let the interface to the work for me – brought in the video, F5 and… nope.  No video.

Victor’s verdict as to “why”?  Perhaps its a discovered limitation of WPF – as of yet located until now.  For something as new as WPF – its quite likely that there are more.  When discovered, they get fixed fairly quickly, but at the moment, using virtualization, Windows likely does not have access to the GPU when virtualizing windows XP.

I wonder if the issue is present in Vista?

Creation of Media Element – Application runs, Video does not

Posted on

I’ll take a few other routes first before I start getting frustrated, but at the moment, I’m going through the first lab which is in Chapter 6 which has you working more closely in XAML and codebehind than the book has done up until this point, and its pretty darn simple, but I’m wondering if there’s something that I should be doing that I am not – perhaps its because my version of blend is 2.5 not 2.0.

In any event, I’m going through the steps, he has you hand-code the xaml to have the MediaElement, give it a name, set the LoadedBehavior to Manual, bring in a video source and modify its properties, then set in the codebehind for your element to play … and then F5 to debug.

Mine has no errors reported, but all I’m getting is the gradient which I set my Window background to.

:/