㈠ C# WPF: 鍦ㄤ竴涓紿椾綋涓婅劇疆涓涓鎸夐挳錛岀偣鍑昏繖涓鎸夐挳鏃訛紝鎵撳紑鏂扮獥浣撳苟鍏抽棴鍘熺獥浣擄紵
鐢℉ide銆傚傛灉鐢–olse鐨勮瘽錛屼綘鏂扮獥浣撶殑璧勬簮涔熶細琚閲婃斁錛屼篃灝辨病浜嗐
㈡ wpf錛屾湁涓淇濆瓨button錛屾墽琛屽悗杈撳叆鏁版嵁淇濆瓨錛屽叧闂錛屽啀嬈℃墽琛屽垯鏄劇ず鏄涓婃$殑鏁版嵁
棣栧厛闇瑕佹敞鎰忕殑涓鐐規槸 浣犳墍鎻忚堪鐨勫叧闂鏄 鍏抽棴搴旂敤紼嬪簭榪樻槸鍙鍏抽棴瀵硅瘽妗嗐傚傛灉鍙鍏抽棴瀵硅瘽妗嗭紝閭d箞浣犲彧闇瑕佸湪鍚庡彴瀹氫箟涓涓鏁版嵁闆嗗悎鎴栬呭彉閲忓幓瀛樺偍浣犻渶瑕佷繚瀛樼殑涓滆タ銆傛瘮濡備綘鍓嶅彴涓涓狣ataGrid錛屽畠鐨処temSource緇戝畾鍚庡彴涓涓鏁版嵁闆嗗悎銆備綘鍦ㄥ墠鍙板仛澧炲垹鏀癸紝鍏跺疄鏄瀵瑰悗鍙扮殑榪欎釜鏁版嵁闆嗗悎鍋氭搷浣溿傚綋浣犲叧闂紿楀彛鍐嶆墦寮榪欎釜紿楀彛鐨勮瘽錛孌ataGrid榪樻槸浼氭樉紺哄悗鍙扮殑榪欎釜ItemSource銆傚傛灉鍏抽棴鐨勬槸搴旂敤紼嬪簭鐨勮瘽錛岃繖灝辨秹鍙婂埌鏁版嵁鐨勮誨啓鎿嶄綔銆備綘鍙鑳藉皢鏁版嵁淇濆瓨鍦ㄦ湰鍦扮殑鏌愪釜鏂囦歡閲岋紙濡倄ml錛宼xt絳夛級涔熷彲鑳戒繚瀛樺湪鏁版嵁搴撻噷銆傝繖涓灝遍渶瑕佷綘鍦ㄥ悗鍙扮紪鐮佺浉鍏崇殑璇誨啓鎿嶄綔綾匯傜綉涓婃湁寰堝氱浉鍏寵祫婧愶紝浣犲彲浠ユ悳緔涓嬨
㈢ WPF涓璘serControl鎺т歡鐨勫叧闂
濡傛灉UserControl鏄鍚鍔ㄧ獥浣擄紝閭d箞鐩存帴 Application.Current.Shutdown();鍏抽棴紼嬪簭銆
濡傛灉浣滀負浣滀負鍏朵粬瀹瑰櫒鍐呯殑鎺т歡錛岄偅涔堥渶瑕佹壘鍒扮埗瀹瑰櫒錛岀劧鍚庣Щ闄ゆゆ帶浠躲備緥濡傜埗瀹瑰櫒鏄疓rid錛岄偅涔堥渶瑕丟rid.children,renmove(usercontrol)銆 鎴栬呴殣鈃忔帶浠訛紝UserControl銆俈isibility = visibility.Collapsed