Skip to content

Commit

Permalink
Enable badge for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Nice3point committed Dec 25, 2023
1 parent 9e8b34c commit f42b3f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 10 additions & 2 deletions RevitLookup/Views/RevitLookupView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@
TargetPageType="{x:Type pages:SettingsView}"
Icon="{rl:SymbolIcon Settings24}" />
<rl:NavigationViewItem
x:Name="AboutFooterItem"
Content="About"
TargetPageType="{x:Type pages:AboutView}"
Icon="{rl:SymbolIcon Info24}" />
Icon="{rl:SymbolIcon Info24}">
<rl:NavigationViewItem.InfoBadge>
<rl:InfoBadge
x:Name="AboutItemBadge"
Severity="Attention"
Margin="0 6 6 0"
Visibility="Collapsed"
Style="{DynamicResource DotInfoBadgeStyle}" />
</rl:NavigationViewItem.InfoBadge>
</rl:NavigationViewItem>
</rl:NavigationView.FooterMenuItems>
<rl:NavigationView.Header>
<rl:BreadcrumbBar
Expand Down
8 changes: 3 additions & 5 deletions RevitLookup/Views/RevitLookupView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public RevitLookupView(
snackbarService.DefaultTimeOut = TimeSpan.FromSeconds(3);

RestoreSize(settingsService);
SetupIcons(updateService);
SetupBadges(updateService);
ApplicationThemeManager.Apply(_settingsService.Theme, _settingsService.Background);
}

Expand Down Expand Up @@ -90,12 +90,10 @@ private void RestoreSize(ISettingsService settingsService)
EnableSizeTracking();
}

private void SetupIcons(ISoftwareUpdateService updateService)
private void SetupBadges(ISoftwareUpdateService updateService)
{
if (updateService.State != SoftwareUpdateState.ReadyToDownload) return;

var symbolIcon = (SymbolIcon) AboutFooterItem.Icon!;
symbolIcon.Symbol = SymbolRegular.ArrowCircleDown24;
AboutItemBadge.Visibility = Visibility.Visible;
}

public void EnableSizeTracking()
Expand Down

0 comments on commit f42b3f4

Please sign in to comment.