Thursday, September 2, 2010

Changes in x:Array in WPF 4.0

It's been a while, but I thought I'd post the results of a subtle bug I fixed while migrating my app to WPF 4.0. I'm mentioning it because many blogs out there discuss x:Array as a way of creating a static list that you can bind against. There's also a fair amount of confusion because Microsoft started talking about XAML2009 which actually isn't really supported in WPF 4.0 unless you're doing dynamic loading of XAML pages.
What's important to know is that x:Array no longer leaves your Array as an ArrayExtension. Instead, in WPF 4, the array is converted on the fly into a CLR native array of the type your specify in the Type argument.
So if you define something like this in your control Resources block:
<x:Array x:Key="WidgetList" Type="{x:Type local:Widget}" ... />
Then be aware that the result is a Widget[], not an ArrayExtension object.

Read more...

Friday, June 26, 2009

WPF: Sorting Sets of Simple Strings

I've been doing a fair bit of WPF coding recently, and it's a compelling experience. The thing is, it isn't easy, and I think that surprises some people. Part of the reason for this is that the documentation still feels incomplete, in that undocumented kind of way. But the other reason is that it forces you to think very abstractly, all the time. If I were to think of a decent analogy, it would be one involving cooking: Coding in most UI toolkits is like cooking with lots of pre-made dishes (pre-cooked noodles, microwave dinners, pasta sauces out of the bottle.) Sure, you can make a decent meal, but the results are pretty predictable and maybe not that satisfying. Coding in WPF is like cooking with real ingredients - it can be challenging, and you can certainly mess up the results, but you can also whip up something fantastic.

Read more...

Friday, June 5, 2009

E3: Let's Get Physical

Seems like the latest E3 was full of surprises... or maybe not. With Nintendo's raging success in the video game market due to its unconvential Wii, you'd have to expect that both Microsoft and Sony would have to respond. They are now officially playing catch-up, and introduced their takes on the genre at the electronics tradeshow.
Microsoft gave a rather bold live demo of its newly acquired Project Natal, a smart camera that can motion-capture participants using a single camera device. This may sound like a gimmick, but the demos are surprising and effective. Included in the system are both image and voice recognition systems that are used to recognize the current user and interpret commands, respectively. I think the possibilities just for the social and device browsing features are pretty cool - built in voice and video chat, voice-activated, as well as being able to browse to your favourite downloaded media using hand motions. Kind of makes Minority Report seem a little clunky, actually.
Probably the most impressive demonstration of the technology is the Milo video, featuring Lionhead and Peter Molyneux.

Read more...

Thursday, May 21, 2009

I'm a Doctor, Jim, not a Horse Lord of Rohan!

I was reading an interview with JJ Abrams on aintitcool.com and had my mind blown. I knew the guy who played Bones in the fantastic new Star Trek film looked familiar, but I hadn't bothered to look him up.

Read more...

Thursday, May 7, 2009

KarmaTickle

What's the opposite of a Karma Slap? Good things happen to people who tip well. I took a cab today to pick up my car and left the cabby a $4 tip for a $19 ride, for no particular reason. I'd consider that a decent tip. As I was waiting for my car, the cabbie came back and dropped off a small brown bag I'd forgotten in the backseat. The weird thing is I thought I had checked that I had everything because I was also carrying my camera case and a chequebook. The package (which didn't look like much more than a work snack, honestly) actually contained some naturopathy pills, which I had just paid $50 for. So there you go.

The cabbie was obviously a good guy, but I'm guessing he's not turning the car around if I give him a twenty note on the nineteen dollar fare.

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP