多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  阅读(210)  评论(0)    收藏  举报