All you need to do is change the parent class of ImageAdvanceCarousel to be UserControl instead of Window. You can't have nested windows, which is what you are doing. Make sure you update the XAML as well, so that the root of the XAML is UserControl instead of Window.