Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing a user control with events.
Message
From
19/03/2008 16:37:23
 
 
To
19/03/2008 14:56:31
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01303552
Message ID:
01303626
Views:
15
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform