private void BtRefresh_Click(object sender, RoutedEventArgs e) { if (tb_Currency.IsSelected) { CurrencySearchControl.ResetSearchControl(); CurrencyModel = new CurrencyModel(this); } else if (tb_CurrencyExchangeRate.IsSelected) { CurrencyExchangeRateSearchControl.ResetSearchControl(); CurrencyExchangeRateModel = new CurrencyExchangeRateModel(this); } }
private void TbPage_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!(e.Source is TabControl)) { return; } if (tb_Currency.IsSelected) { if (CurrencyModel == null) { CurrencyModel = new CurrencyModel(this); } } if (tb_CurrencyExchangeRate.IsSelected) { if (CurrencyExchangeRateModel == null) { CurrencyExchangeRateModel = new CurrencyExchangeRateModel(this); } } }