Added additional check for type in AppBarToggleItemCommand.OnAttached