public bool ShowOptions(OptionsCollectionViewModel viewModel) { var window = new OptionsWindow(); window.DataContext = viewModel; window.Icon = BitmapFrame.Create(new Uri("pack://application:,,,/CalDavSynchronizer;component/Resources/ApplicationIcon.ico")); ElementHost.EnableModelessKeyboardInterop(window); viewModel.RequestBringIntoView += delegate { window.BringIntoView(); }; return(window.ShowDialog().GetValueOrDefault(false)); }