Just set islightdismissenabled property true for control. If popup is enabled and user clicks any where else the popup will be automatically disappeared.
The error comes when you include winrt component in your project. To remove the error open project file of both the components and change the value of $(Platform)'== to make common in both project. I came out with error after changing the value from AnyCPU to x86.