开发者

clearing all usercontrol in the wpf window

开发者 https://www.devze.com 2023-01-06 17:59 出处:网络
How to clear all usercontrols in the wpf window. in runtime i added 开发者_JS百科dynamic usercontrols in my wpf window, when i refresh, i want to clear all those and need to load again. so how i can c

How to clear all usercontrols in the wpf window. in runtime i added 开发者_JS百科dynamic usercontrols in my wpf window, when i refresh, i want to clear all those and need to load again. so how i can clear all usercontrols in my page.??


The Window class itself has a single child which you can clear by setting the Content property to null. If you added the controls to a Panel, such as a Grid or Canvas, then you can clear them by calling the Clear method on the Children property:

myCanvas.Children.Clear();
0

精彩评论

暂无评论...
验证码 换一张
取 消