public ContentAdorner(UIElement adornedElement, ModernPopup child) : base(adornedElement) { this.children = new VisualCollection(this); this.contentPresenter = new ContentPresenter { Content = child }; this.children.Add(this.contentPresenter); }
protected virtual DialogResult Show(DialogViewModel viewModel) { var result = Application.Current.Dispatcher.Invoke( () => { var window = Application.Current.MainWindow as ModernWindow; if (window == null) { return(DialogResult.None); } var dialog = new ModernPopup { DataContext = viewModel }; return(dialog.RunDialog(window, this, viewModel)); }, DispatcherPriority.Background); return(result); }