public void Execute(object parameter) { var temp = (FrameworkElement)parameter; switch (temp?.Name) { case "BtnRegion": viewModel.SelectedViewModel = new RegionViewModel(); break; case "BtnEmployee": viewModel.SelectedViewModel = new EmployeeViewModel(); break; case "BtnSettings": viewModel.SelectedViewModel = new SettingViewModel((MainViewModel)viewModel); break; case "BtnParcel": viewModel.SelectedViewModel = new ParcelViewModel(); break; case "BtnWarehouse": viewModel.SelectedViewModel = new WarehouseViewModel(); break; case "BtnTransport": viewModel.SelectedViewModel = new TransportViewModel(); break; case "BtnHome": viewModel.SelectedViewModel = new HomeViewModel(); break; } viewModel.BlackAndWhiteLayout(viewModel.IsBlack); }