Archive for the ‘Uncategorized’ Category

Interesting solution to a WPF resource location issue

Wednesday, March 11th, 2009

Design-time is one of my hobbies, and I’ve been fooling around with the WPF designer ("Cider") lately.  I’ve been making adorners do interesting things for the most part and havent fooled around with property editors much, which makes me kind of useless for Blend.

A pattern I’ve been following involves structuring my projects with a folder for each control I’m providing support for.  Each folder has its own resource dictionary in a Resources.xaml file, and the Themes/Generic.xaml includes all of them as a merged resource dictionary.  It works great, but I recently had a problem, couldn’t find the solution, and now that I know what went wrong I want search engines to help others out.

My metadata was loaded correctly, but none of my templates were being applied to adorners.  I thought something was wrong with the merging of the resource dictionaries, so I tried moving a template into Generic.xaml; no dice.  Nothing I did seemed to be making the project pick up the template.  I set up some small proof-of-concept projects, and couldn’t find anything visibly different about what was wrong.  The end of the day arrived and I decided I’d just delete the project and try again tomorrow.

Tomorrow became today, and the project was magically working.  I called a coworker over to witness the event, and he began to point at my project.  "Why do you need that junk in Properties; it’s a class library and you won’t use application settings and resources?"  I agreed; yesterday I’d deleted them too.  In fact, early today I had deleted all of them but our source control decided they were important and resurrected them.  I’m glad it did.

It turns out that in AssemblyInfo.cs, which I clicked on for kicks, there is a ThemeInfoAttribute that tells the project where to find the non-themed and themed resources.  If it’s not there, whatever is supposed to look for Generic.xaml doesn’t look there.  Oops.  When I deleted AssemblyInfo.cs, I broke the theming!

So, if you’re depending on themed or non-themed resources in WPF, don’t delete AssemblyInfo.cs!  Or, if you do, make sure to apply an assembly-level ThemeInfoAttribute somewhere else.  Don’t waste half a day like I did!

Testing Source code posting

Friday, March 6th, 2009

Supposedly there’s a markup element for posting code on WordPress blogs.  This is just a test; I’m actually planning some big posts and it will determine if I use the blog or just link to a static page.

public void DoSomething()
{
     MethodCall();
}

Welp, either I did something wrong or WordPress lied to me. I’ll try upgrading this weekend.

*Update:* Turns out I needed to manually install this syntax highlighter.

What I hate about the web these days

Thursday, September 25th, 2008

Let’s assume that I’m looking for information on some fringe programming topic that doesn’t have a lot of pages with content.  It might be something like the new D3DImage class in WPF that allows you to render DirectX content on a WPF surface, and whether there’s a way to make it work with the XNA framework and thereby avoid having to write managed code (not all shops have people proficient in writing managed code.)

So I ask Google to tell me what it knows about this; looks like a few results, right?  The first two I see are a The Code Project article and the MSDN documentation, which seems like a pretty good first two results.  Buried in the results is a forum post with a user asking about using SlipDx with the D3DImage.  The rest of the results are nothing but blog posts, forum posts, and news posts with nothing but "Dr. WPF wrote an article about this, here’s the link:"

Isn’t Google supposed to be smart?  Why can’t it filter out blog entries with non-ad content of less than 20 words?  I have to wade through a sea of these blog posts which are nothing more than internet trash to find any articles about what I’m interested in.

Snarky Comment of the $timeperiod

Friday, April 25th, 2008

I read Jeff Atwood’s Coding Horror as frequently as he posts material.  Like many blogs, the true entertainment value comes from the comments.  I saw this one today:

$40 for SmartFtp. $40 for Winzip. Multiply by all the small tools you need. I won’t even begin to get to get into real development tools like Visual Studio. Windows developers seem to be made of money. One of the reasons I got out of the Windows world a decade ago was the cash I was shelling out just to stay current.

I’m particularly fond of the "Windows developers seem to be made of money" part.  It expresses surprise that somehow, people who develop on Windows have a lot of money to spend on tools.  The viewpoint of astonishment implies that, as a non-Windows developer, the writer does not have very much money and is curious why people who develop for Windows have more money than he does.  Hmmm…

I’m not implying there’s more money to be made on either side of the war, just that I wish people weren’t stupid about their jabs at the other side.  There’s tons of free FTP utilities for Windows; one was mentioned in the very post this user commented on.  I haven’t used Winzip for at least 5 years because the zip support built into Windows is adequate for me, and 7-zip is useful for when I encounter a file that’s not a zip file for whatever reason.  Visual Studio is a nicety but SharpDevelop is just fine and free; a decent coder should be able to get by with Notepad in emergencies anyway.  The poster’s main points are:

  1. All Windows development tools cost money.
  2. Windows developers can afford the tools because they have a lot of money compared to non-Windows developers.

The first one is false.  The second depends on your definition of "a lot" and "Windows developer", but doesn’t do much to encourage me to hug a Penguin in the near future.

Consumer Satisfaction

Sunday, April 20th, 2008

I want to pat Activision support on the back since I complained yesterday.  I emailed their tech support with my problem and was told I’d get a response within two business days.  I pretty much expected this to mean 3 weeks or so.  They answered within 6 hours on a weekend.  I am very pleased with this experience.  If anyone from Activision reads this, you have my compliments on your tech support.

I don’t think it’s the disc anymore because after letting everything sit for a few hours I’m not having any problems with the game.  I’m thinking my Wii’s on the fritz and maybe it needs a cleaning.  I wonder if there’s even a cleaning kit for the Wii?

The game itself is pretty cool.  The reviews seem to complain that it doesn’t bring very much new to the GH series, but that leads me to ask what exactly new we need.  I bought it to play a rhythm and timing game that plays rock music, and this is what the game delivers.  I fail to see how you could be disappointed.

Finally

Wednesday, September 5th, 2007

Looks like I finally got my site set up again; it will take a while for me to repopulate everything but it’s good to have a site once more.