多button事件处理

        private void ButtonClick(object sender, RoutedEventArgs e)
        {            
            Button cmd = (Button)e.OriginalSource; 
            Type type = this.GetType(); 
            Assembly assembly = type.Assembly;     
            Window win = (Window)assembly.CreateInstance(  type.Namespace + "." + cmd.Content);
            win.ShowDialog();
        }

posted @ 2017-07-08 20:42  wzjhoutai  阅读(207)  评论(0编辑  收藏  举报