Resource management when changing window content

前端 未结 2 1907
有刺的猬
有刺的猬 2021-01-19 05:22

First of all, I do not feel completely educated on how to navigate between multiple \"pages\" of a window.

For example, I have a Window called MainWindow. Inside of

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 05:31

    Instead of toggling visibility off and on, you should put a contentControl and switch it's contents to different UserControls.

    That way there's no reference to the UserControl that's offscreen, and you can handle memory issues better.

提交回复
热议问题