Skip to content

Commit 4377054

Browse files
committed
Add CancelCountdown feature and button
Added a CancelCountdown command to stop the countdown and reset the refresh button's accent state. Introduced a CancelCountdownButton in the UI, bound to the command, with conditional visibility and a tooltip for canceling auto-refresh.
1 parent 56a7a98 commit 4377054

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

Simple Icon File Maker/Simple Icon File Maker/ViewModels/MainViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ public void SizeCheckboxTapped()
280280
CheckIfRefreshIsNeeded();
281281
}
282282

283+
[RelayCommand]
284+
public void CancelCountdown()
285+
{
286+
StopCountdown();
287+
RefreshButtonIsAccent = false;
288+
}
289+
283290
[RelayCommand]
284291
public async Task RefreshPreviews()
285292
{

Simple Icon File Maker/Simple Icon File Maker/Views/MainPage.xaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,18 @@
431431
</MenuFlyout>
432432
</Button.ContextFlyout>
433433
</Button>
434+
<Button
435+
x:Name="CancelCountdownButton"
436+
Height="32"
437+
MinWidth="32"
438+
Padding="8,0"
439+
HorizontalAlignment="Center"
440+
VerticalAlignment="Center"
441+
Command="{x:Bind ViewModel.CancelCountdownCommand}"
442+
ToolTipService.ToolTip="Cancel auto-refresh"
443+
Visibility="{x:Bind ViewModel.IsCountdownActive, Converter={StaticResource BoolVis}, Mode=OneWay}">
444+
<FontIcon FontSize="12" Glyph="&#xE711;" />
445+
</Button>
434446
<TextBlock
435447
VerticalAlignment="Center"
436448
Style="{StaticResource BodyStrongTextBlockStyle}"

0 commit comments

Comments
 (0)