private void TabMainDetails_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (TabMainDetails != null) { if (TabMainDetails.SelectedIndex == 1) { _dyedOrderViewModel.GetFabricInventSumWithBatches(); } } }