You shouldn't need to cast this? The case statements are all referring to the enum anyway, unless there's some nasty difference in how the compiler is viewing these.