mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-13 18:16:49 -07:00
Do not collapse Update Rates button in a transient state (#619)
* Do not collapse Update Rates button in a transient state * Address PR feedback and add animation to everything affected by IsCurrencyLoadingVisible
This commit is contained in:
parent
80912a33d0
commit
f6f864c88c
2 changed files with 90 additions and 26 deletions
|
@ -291,12 +291,17 @@ void UnitConverter::SetDefaultFocus()
|
|||
|
||||
void UnitConverter::CurrencyRefreshButton_Click(_In_ Object ^ /*sender*/, _In_ RoutedEventArgs ^ /*e*/)
|
||||
{
|
||||
if (Model->NetworkBehavior == NetworkAccessBehavior::OptIn)
|
||||
// If IsCurrencyLoadingVisible is true that means CurrencyRefreshButton_Click was recently called
|
||||
// and is still executing. In this case there is no reason to process the click.
|
||||
if (!Model->IsCurrencyLoadingVisible)
|
||||
{
|
||||
m_meteredConnectionOverride = true;
|
||||
}
|
||||
if (Model->NetworkBehavior == NetworkAccessBehavior::OptIn)
|
||||
{
|
||||
m_meteredConnectionOverride = true;
|
||||
}
|
||||
|
||||
Model->RefreshCurrencyRatios();
|
||||
Model->RefreshCurrencyRatios();
|
||||
}
|
||||
}
|
||||
|
||||
void UnitConverter::OnDataContextChanged(_In_ FrameworkElement ^ sender, _In_ DataContextChangedEventArgs ^ args)
|
||||
|
@ -320,15 +325,16 @@ void UnitConverter::OnIsDisplayVisibleChanged()
|
|||
{
|
||||
if (Model->IsCurrencyLoadingVisible)
|
||||
{
|
||||
VisualStateManager::GoToState(this, L"CurrencyLoadingState", false);
|
||||
StartProgressRingWithDelay();
|
||||
}
|
||||
else
|
||||
{
|
||||
HideProgressRing();
|
||||
|
||||
if (m_isAnimationEnabled && Model->IsCurrencyCurrentCategory && !Model->CurrencyTimestamp->IsEmpty())
|
||||
if (Model->IsCurrencyCurrentCategory && !Model->CurrencyTimestamp->IsEmpty())
|
||||
{
|
||||
TimestampFadeInAnimation->Begin();
|
||||
VisualStateManager::GoToState(this, L"CurrencyLoadedState", m_isAnimationEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue