private void BtRefresh_Click(object sender, RoutedEventArgs e) { if (tb_CusSupInfo.IsSelected) { CusSupInfoSearchControl.ResetSearchControl(); cusSupModel = new CustomerSupplierModel(this); } else if (tb_CusSupBank.IsSelected) { CusSupBankSearchControl.ResetSearchControl(); cusSupBank = new CustomerSupplierBankModel(this); } }
private void TbPage_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!(e.Source is TabControl)) { return; } else if (tb_CusSupInfo.IsSelected) { if (cusSupModel == null) { cusSupModel = new CustomerSupplierModel(this); } } else if (tb_CusSupBank.IsSelected) { if (cusSupBank == null) { cusSupBank = new CustomerSupplierBankModel(this); } } }