Changed FrameworkElement to DependencyObject
Merge pull request #1508 from Dotnetifier/FlyoutCloseFix

Flyout close fix