Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing a user control with events.
Message
De
19/03/2008 16:37:23
 
 
À
19/03/2008 14:56:31
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01303552
Message ID:
01303626
Vues:
14
>Boy this section is quiet, I'm beginning to feel like only Viv and me are playing with WPF.

Hi,
Actually it's only you :-{
I'm stuck re-hashing some VFP - probably until the end of the month but after that it should be pretty WPF intensive for me....

> Well at least I finally feel like I'm out of the brain dead phase starting to get a rough idea of what I'm doing. The learning curve on this seemed steeper than most of the languages I've learned. But I'm beginning to really like it, and in some ways it's closer to VFP for me than WinForms was.
>
>This question probably has the same answer for WPF and WinForms.
>
>I'm using a TabControl and using tabControl.Items.Remove(tabItem) to close the content of the tabs.
>
>That should be the last reference to the the TabItem and its content, except for events.
>
>Do I also need to -= remove the events to get the TabItem to be released from memory?
>
>Should I -= the events anyways, or is it unnecessary?

As you suggest I don't think this is a WPF (or even WinForms) specific issue - it's a generalised .NET thing. My understanding is that there is no need to unhook handlers (unless you specifically want to stop handling the event in question). OTOH I can't remember where that 'understanding' came from. :-{

>Is there something else I should be doing to release the TabItem and it's content?

No Dispose() so I'd assume you just let garbage collection take its course..

BTW have you come across any good WPF books? I've got the 'Unleashed' which is OK. Also I seem to remember that Apress (which I generally like) had one due out about now (but I haven't got round to checking whether it's actually available...)
Best,
Viv
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform