Wednesday, September 26, 2007

iHave iPod

My iPod touch arrived today so in the tradition of documenting the unwrapping, I took a few photos.
The box... quite small.

Nice box. Attractive. Can you feel the excitement???!

First glimpse... could it be? ... love at first sight?

Hungry iPod. It wants to be fed.

Her first feed. Pretty soon she'll be on solids.

Ok so I've had my new iPod for what... a few hours now. I've twittered on it. Surfed the web (the keyboard takes some getting used to but I don't see it being a real problem.) I've played a bit of a movie, a few songs and just generally looked around. I've copied a bunch of my cartoons onto it and am REALLY impressed with the photo album viewing. Flick the photo and it shoots off to the side and the next picture zooms on. Rotating the screen is impressive to watch too. Really nice feature, that auto screen rotate. I've got some podcasts on there too, and I've only used up about 3 or 4Gb out of the 16Gb.
I wasnt worried about the 16Gb size limit... its a big jump up from my 2Gb on my JasJam, and most of my songs are crap anyway. This will give me an opportunity to cull the crap ones and delete them.

The only downside I've seen so far is it gets covered with greasy fingerprints. It comes with a soft polish cloth, but no case. A case would have been useful but no doubt there will be iPod touch skins soon (if there isnt already). Bluetooth would have been nice for my headphones...

The verdict... I'm in love.

Tuesday, September 11, 2007

Pants WPF Error

Thanks Patrick for the post.

<Style x:Key="DisplayOnly" TargetType="{x:Type TextBox}"   BasedOn="{StaticResource {x:Type Control}}">
  <Setter Property="Control.BorderThickness" Value="0,0,0,0" />
  <Setter Property="TextBox.IsReadOnly" Value="True" />
  <Setter Property="Control.Background" Value="Transparent"/>
<Style x:Key="DateDueStyle" BasedOn="{StaticResource DisplayOnly}">
  <Setter Property="Control.Foreground" Value="Red"/>
  <Setter Property="Control.FontWeight" Value="Bold"/>

Trying to base a style on another style, was giving me the rather cryptic error;
{"Cannot convert the value in attribute 'Style' to object of type 'System.Windows.Style'. Can only base on a Style with target type that is base type 'IFrameworkInputElement'. Error at object 'System.Windows.Controls.TextBox' in markup file 'xxx;xamlfile.xaml' Line 111 Position 47."}

I found Patrick's post (Linked top of this post) and initially was going to move the DisplayOnly style stuff into the local DateDueStyle style. But that wasn’t right, I wanted the DisplayOnly to remain where it was (It's in a different assembly and gets loaded into the ResourceDictionary).

Adding a TargetType fixed the problem. So it looks like the TargetStyle does not come down to your style when you use BasedOn. The real problem was that it wasnt set.

<Style x:Key="DateDueStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource DisplayOnly}">
  <Setter Property="Control.Foreground" Value="Red"/>
  <Setter Property="Control.FontWeight" Value="Bold"/>