/// <summary> /// Смена вкладок при нажатии на кнопки меню /// </summary> /// <param name="sender">Объект</param> /// <param name="e">Событие</param> private void ClickOnViewBtn(object sender, RoutedEventArgs e) { pageContent.Children.Clear(); UserControl usc = null; if (((Button)sender as Button).Name == "driversViewBtn") { usc = new dbView("drivers"); DBConnect.tableName = "drivers"; } if (((Button)sender as Button).Name == "carsViewBtn") { usc = new dbView("cars"); DBConnect.tableName = "cars"; } if (((Button)sender as Button).Name == "trailersViewBtn") { usc = new dbView("trailers"); DBConnect.tableName = "trailers"; } if (((Button)sender as Button).Name == "cargoViewBtn") { usc = new dbView("drivers"); DBConnect.tableName = "cargo"; } pageContent.Children.Add(usc); }
private void backBut_Click(object sender, RoutedEventArgs e) { pageContent.Children.Clear(); UserControl usc = null; usc = new dbView("drivers"); pageContent.Children.Add(usc); }