It’s no secret, I love XAML. I write XAML, I talk about XAML, I dream in XAML. Sometimes that’s true – especially in the middle of a project. Sometimes people misconstrue that I don’t like HTML as a result, but as a father of three daughters, I can assure you picking favorites isn’t a requirement – even if I have a favorite. But as a Metro developer, there are some things XAML developers should know that will save them serious time. I wish I had this list to start!
Look, this blog is not about complaining. There is no time for that. We need to get building. This is about saving XAML developers time by letting them know the deltas between their previous XAML development experience and what to expect in Metro. Metro XAML is new, right? Yeah – it’s still in beta as I write this. WPF is a decade old and SL is half that. They have a head start and Metro XAML is winding up. In the meantime, I let’s help each other save time.
- The binding Mode is not TwoWay by default. OneWay is, even for TextBoxes. That means Mode=TwoWay needs to become something you type by default. Otherwise, you might start thinking that simple binding does not work when it really works just fine.
- The ImageBrush’s TileMode is missing because TileBrush is missing. The RadialGradientBrush and VisualBrush are missing. You can burn hours looking for these (like I did). As a result, you will be using more images than you typically would in your designs.
- There is no ability to PriorityBinding or MultiBinding in Metro (this was also true in SL). Combine that with missing StringFormat and TargetNullValue, though, and you will be using more converters than you might otherwise. Leverage MVVM for formatting, too.
- Like Silverlight, Loaded is the only RoutedEvent supported in EventTriggers. The error when trying any other event is confusing. In the end, it means most of your animation will be handled through VisualStates more than animating the style.
Read the rest of the article at http://blog.jerrynixon.com/2012/07/8-quirks-windows-8-xaml-developers.html
Contributed by Jerry Nixon at http://blog.jerrynixon.com/2012/07/8-quirks-windows-8-xaml-developers.html