Re: C# question: How do you delete a Grid object



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
.



Relevant Pages

  • Re: C# question: How do you delete a Grid object
    ... Controls in WPF do not implement IDisposable, so this isn't a feasible solution. ... "Liz" wrote in message ... type Grid, TextBox, etc. ... turn the "visible" switch off and wait for the garbage collector to ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# question: How do you delete a Grid object
    ... type Grid, TextBox, etc. ... For simplicity, let's say I'm just adding and ... deleting Grid objects. ... You always have to wait for the garbage collector to come around; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# question: How do you delete a Grid object
    ... so what do we do in WPF? ... type Grid, TextBox, etc. ... turn the "visible" switch off and wait for the garbage collector to ... You always have to wait for the garbage collector to come around; ...
    (microsoft.public.dotnet.languages.csharp)
  • Derived Type Pointer Allocation Issue
    ... end type grid ... allocate memory properly. ... Fortran Compiler. ... up, plenty of heap and stack space made available, 200,000,000 in all. ...
    (comp.lang.fortran)
  • Re: Derived Type Pointer Allocation Issue
    ... troubleshooting. ... end type grid ... allocate memory properly. ... Fortran Compiler. ...
    (comp.lang.fortran)