Changed resource markup extension to attached behaviors. Fixes #2