Re: C# question: How do you delete a Grid object
- From: Alun Harford <devnull@xxxxxxxxxxxxxxxxx>
- Date: Sat, 10 Nov 2007 20:42:39 +0000
Liz wrote:
<dongarbage@xxxxxxxxxxx> wrote in message news:1194718368.893261.240650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm building an application (WPF) and I have a Panel in the
application which will be populated dynamically with objects of the
type Grid, TextBox, etc. For simplicity, let's say I'm just adding and
deleting Grid objects. I can add the objects easily by creating Grid
objects. The problem I have is that I don't know how to delete the
objects.
How do you delete a Grid object? I'd prefer to not have to
turn the "visible" switch off and wait for the garbage collector to
come around.
You always have to wait for the garbage collector to come around;
That's not entirely true. You can use stackalloc to allocate memory on the stack (away from the garbage collector).
It's good if you frequently need to allocate moderately large arrays of objects. Garbage collection hurts in that situation.
Alun Harford
.
- Follow-Ups:
- References:
- C# question: How do you delete a Grid object
- From: dongarbage
- Re: C# question: How do you delete a Grid object
- From: Liz
- C# question: How do you delete a Grid object
- Prev by Date: Re: difference c# 2.0 C# 3.0
- Next by Date: Re: Constructor parameter list
- Previous by thread: Re: C# question: How do you delete a Grid object
- Next by thread: Re: C# question: How do you delete a Grid object
- Index(es):
Relevant Pages
|