Всплывающее окно WPF и проблема WindowsFormsHost

Для последнего корпоративного приложения я работал над этим, должен был обработать известную сумму CSV - несколько месяцев назад - я использовал SuperCSV в SourceForge и нашел его простым, устойчивым и без проблем.

6
задан DigitalRoss 15 September 2009 в 16:51
поделиться

2 ответа

I've had many problems with the defacto-standard popups in WPF, because they are in fact a new window with their own handle. This means if you drag your application around the screen, the popup stays put (it doesn't move with your window). It also means your popup has some strange behaviors and doesn't interact with your application in ways other controls normally do.

I've created 2 decorator classes to address this problem:

PopupDecorator.cs and TimeoutPopupDecorator.cs

It's pretty simple to use:

  1. Add a namespace declaration for the new popup classes. i.e.

    xmlns:dday_wpf="clr-namespace:DDay.WPF"

  2. Surround the area you want the popup to be able to be displayed with the decorator. i.e.

    ... contents of popup go here ... ... contents of panel go here ...

It works pretty much identically to a normal Popup from that moment on.

This may not solve all your problems, but hopefully it helps.

2
ответ дан 17 December 2019 в 20:34
поделиться

Это немного похоже на мою проблему с запуском немодального элемента управления winform из формы WPF.

Ознакомьтесь с моим вопросом Почему мое текстовое поле WPF "вроде" доступно только для чтения? .

Справедливость, основанная на том, что Дуг сказал о всплывающих окнах, являющихся окном с собственным дескриптором, делает это применимо.

0
ответ дан 17 December 2019 в 20:34
поделиться
Другие вопросы по тегам:

Похожие вопросы: