WPF用户控制问题!! (开关) [英] WPF user control problem!! (Switch)

查看:94
本文介绍了WPF用户控制问题!! (开关)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比如标题,想用WPF进行Windows程序页面切换,使用的方法是:

新用户控件之后,先清除然后再添加。



方法大致如下:

 System_Function.System_Function_Button SFB =  new  System_Function_Button(); 
system_function1_panel1.Children.Clear();
system_function1_panel1.Children.Add(SFB);





但经过多次切换页面(按钮反复触发Clear和Add )出现错误后,屏幕显示如下:

http://i.imgur.com/ N141GDB.png [ ^ ]



Windows将崩溃,解决〜

解决方案

Such as title, would like to do with WPF Windows program page switching, the method used is:
After new a user control, first to Clear and then Add.

Method approximately as follows:

System_Function.System_Function_Button SFB = new System_Function_Button();
system_function1_panel1.Children.Clear();
system_function1_panel1.Children.Add(SFB);



But after several switch pages (with the button repeatedly triggered Clear and Add) after an error, the screen that appears as follows:
http://i.imgur.com/N141GDB.png[^]

Windows will crash, solving ~

解决方案

这篇关于WPF用户控制问题!! (开关)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆