locked
xaml Page and xaml page in the component DISPOSE

    Question

  • Hi,

    I can't xaml page dispose how do it dispose

    thanks

    Friday, February 28, 2014 5:37 PM

Answers

  • Memory management is done via garbage collection.

    Dispose is not really part of memory management: it allows bypassing memory management to immediately get rid of non-memory resources. Xaml objects don't have such resources beyond those which are dealt with by the garbage collector.

    Where you need Dispose is on objects which maintain things like file handles that you need to deterministically close without waiting for the garbage collector.

    Dispose is needed in WinForms because WinForms Controls are backed by native Win32 controls which have HWNDs that need to be destroyed out of band from the garbage collector. This isn't the case for Xaml controls.

    Tuesday, March 04, 2014 12:20 AM
    Owner

All replies

  • You don't need to dispose Xaml pages.

    --Rob

    Saturday, March 01, 2014 1:57 AM
    Owner
  • thanks mr.Rob
    how is doing memory management

    Sunday, March 02, 2014 12:35 PM
  • Memory management is done via garbage collection.

    Dispose is not really part of memory management: it allows bypassing memory management to immediately get rid of non-memory resources. Xaml objects don't have such resources beyond those which are dealt with by the garbage collector.

    Where you need Dispose is on objects which maintain things like file handles that you need to deterministically close without waiting for the garbage collector.

    Dispose is needed in WinForms because WinForms Controls are backed by native Win32 controls which have HWNDs that need to be destroyed out of band from the garbage collector. This isn't the case for Xaml controls.

    Tuesday, March 04, 2014 12:20 AM
    Owner