private void btnClick(object sender, RoutedEventArgs e) { Button btn = sender as Button; if (btn == null) { throw new ArgumentException(); } else { switch (btn.Name) { case "stackpanelBtn": StackPanelWindow stackpanel = new StackPanelWindow(); stackpanel.Show(); break; case "dockBtn": DockWindow dockwindow = new DockWindow(); dockwindow.Show(); break; case "gridBtn": GridWindow gridWindow = new GridWindow(); gridWindow.Show(); break; case "gridsplitterBtn": GridSplitterWindow gridsplitterWindow = new GridSplitterWindow(); gridsplitterWindow.Show(); break; } } }
private void BtnGrid_Click(object sender, RoutedEventArgs e) { GridWindow gridWindow = new GridWindow(); gridWindow.Show(); }