Monday, December 29, 2008

WPF-Fading Background

Well, the project I'm working on has a few pretties in it; and it has a few tabs that will appear based upon click events on other tabs. Typically, these magically appearing tabs are generated in the primary working area of the application, yet in one scenario, the appearing tab needed to be in the secondary data (for lack of a better term) area of the application.

Since, this is effectively non-standard behavior from the application, I wanted to provide a nice visual cue on this happening. I wanted the background to appear one color, and then slowly fade to its standard color.

That would be a nice, visual cue about this new window opening. So, I went forth and tried to do it. My first attempt involved using a brush, and then just changing the opacity until it was transparent. That was utter fail. So, realizing that I wasn't as clever as I had hoped, I turned to my old friend Google.

Where I discovered a bit about Storyboards and ColorAnimation objects. Now, I'm not overtly familiar with WPF, and in fact there's quite a bit that I just don't know yet about it; but I was shocked at how easily this worked.

What I did was created 2 new SolidColorBrushes, one for the FROM color and one for the TO color. These two colors would be the beginning and ending state for the background of my control. I then shoved these into my ResourceDictionary so that a) I could easily find and manipulate them and b) utilize them elsewhere if needed.

Next, I went to the user control I was working with and created on it three new objects, a storyboard, and then two local brush objects.

Then in the method I had for loading the control and its data, I created a ColorAnimation object, cloned my two new brushes into my local brush objects, and then shoved them all together. I activated a timer, and when the timer expired, then I turned on the animation to begin the fade.

Lo, and behold, it worked! And it worked well. It's pretty, it works great as an indicator, all-in-all I was quite pleased with myself.

Anyways, the following two screencaps show the relevant code in question.



Enjoy.

Friday, December 26, 2008

eComic Flying Off The Shelf

Get eComicWell, at least proverbially--after all, there's no shelves involved over at CodePlex. Anyways, I'm ecstatic as I checked the download count and it was at 42 on Wednesday, but when I checked it this morning it was at 58. And that's just for this latest version.

I've yet to get a single comment or "issue" on the software, which I'm not sure if that's a good thing or a bad one. I mean the 58 downloads (half of which are the source code) means that there's some folks at least looking at my application.

But if no one is finding any issues, does that mean it's made right or does it mean that it's just not getting used.

For the record, eComic has had a total of 92 downloads (source and application).

I just wish I knew more about actual usage, and not just the downloads. I guess I could add in some "registration" nonsense during the install process, but that's just lame, and annoying.

Hopefully, I'll have a bit of time come the new year to add in some more functionality, as I'm still wanting to add in the "Reading List" function and give it the ability to create CBZ files.

Anyways, I just wanted to toss that out there, as I'm happy that something I made is getting used.

Monday, December 8, 2008

JC App take 2

Well, after a bit of an issue on the little application I tossed together to deal with PM Lists over at the forums for TheForce.Net, I quickly got another version of it cobbled together and out to Codeplex (available here).

Now, what issues you may ask? Well, first and foremost, was an installation error having to deal with an IEFrame.dll dependency (which I assume was from WATIN). Of secondary concern I had left a message box in there, which spat out the name during every pass of sending a PM.

But, I've got those dealt with (at least I didn't receive errors when installing), and I also made a few extra modifications to the little application. The Version change Log is thus:

  • Fixed Installer Issue
  • Added option to hide the browser window while app is working
  • Turned app into multi-threaded application
  • Cleaned up the Source code
  • Added a "waiting" animation while process is running
It's nice and simple, and hopefully easy to use.

Sunday, December 7, 2008

Another little WPF Application

Well, I've tossed out another itty-bitty WPF application, it's located here: Jedi Council PM List. And while my other application (eComic) is very specific in its user-base, this one makes eComic look like MS Word in its potential user-base.

It's basically designed to be used by a subset of the users of the Jedi Council forums (http://boards.theforce.net) to allow said users send their private messages as a PM List.

Of most interest is the fact that it is web site automation via WATIN. WATIN of course is designed for automated web testing, and is something that's needed for a couple of projects that are in the wings for me.

Blog Widget by LinkWithin