Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WPF Popup - Form Moved
Message
De
03/03/2008 04:38:25
 
 
À
02/03/2008 22:45:14
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01295934
Message ID:
01298100
Vues:
52
>I thought the same about the shortcomings of needing code in any form that uses the control.
>I tried the 'StaysOpen' idea on a simple popup and (apart from the need for the extra click which you witnessed) it worked consistently so maybe your control could be tweaked somehow.
>
>Another possiblility (not tested):
>Create a subclass of ElementHost to hold the WPF control. In its constructor you could then use FindForm() to get a reference to the WinForm and hook up the Forms Move event (etc) to code in the WPF control to close the popup.
>
>The problem with that is that even if it solves for Winforms the problem still exists in a WPF environment. I'm not sure what the advantage of using the CreateRootPopup as per the example is - have you tried the simpler approach of just using your control as content of a popup? Of course, there may be no advantage there either - but at least it's simpler to comprehend :-}
>
>Regards,
>Viv

>
>I decided to rewrite my main application as a WPF application. I don't have all that much invested in libraries yet. And I tend to do a few scrap it all and rewrites when I'm learning. I think this is my third, so I'm getting close :-)
>
>Once that's done, I should be able to drill down to the form or use the application.current.windows collection to get the event I need.

In WPF (if you're happy to have the popup close) all you should need is a simple:
<Popup  StaysOpen="False">
    <MyControl />
</Popup>
>
>The element host would be sweet for adding some WPF to a winform app. But if I'm going to go all WPF then I might as well go WPF from the ground up.
>
>Thanks for all your help on this! It is greatly appreciated.

Not much help. But I learned things,
Best,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform