Added BAML support to avoid WPF application crash.