/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/UserControls/NavigationToolbar.xaml
646 строк
27 KB
yair100
Feature: Updated sidebar icons (#18705)
15 июл 2026, 02:41
Не верифицирован
15 июл 2026, 02:41
3789e75
Код
Авторство
О чём код?
<!-- Copyright (c) Files Community. Licensed under the MIT License. --> <UserControl x:Class="Files.App.UserControls.NavigationToolbar" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals" xmlns:contract8Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,8)" xmlns:controls="using:Files.App.Controls" xmlns:converters="using:Files.App.Converters" xmlns:converters1="using:CommunityToolkit.WinUI.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dataitems="using:Files.App.Data.Items" xmlns:datamodels="using:Files.App.Data.Models" xmlns:helpers="using:Files.App.Helpers" xmlns:items="using:Files.App.Data.Items" xmlns:keyboard="using:Files.App.UserControls.KeyboardShortcut" xmlns:local="using:Files.App.UserControls" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:triggers="using:CommunityToolkit.WinUI" xmlns:uc="using:Files.App.UserControls" xmlns:ucs="using:Files.App.UserControls.StatusCenter" xmlns:vm="using:Files.App.ViewModels.UserControls" x:Name="NavToolbar" Loading="NavToolbar_Loading" mc:Ignorable="d"> <UserControl.Resources> <ResourceDictionary> <converters:NullToTrueConverter x:Key="NullToFalseConverter" Inverse="True" /> <converters:NullToVisibilityCollapsedConverter x:Key="NullToVisibilityCollapsedConverter" /> <converters1:BoolNegationConverter x:Key="BoolNegationConverter" /> <converters:VisibilityInvertConverter x:Key="VisibilityInvertConverter" /> <converters1:BoolToObjectConverter x:Key="SearchSuggestionGlyphConverter" FalseValue="" TrueValue="" /> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="ms-appx:///UserControls/KeyboardShortcut/KeyboardShortcut.xaml" /> <ResourceDictionary Source="ms-appx:///Styles/StatusCenterInfoBadgeStyles.xaml" /> <ResourceDictionary> <SolidColorBrush x:Key="ButtonBorderBrushDisabled" Color="Transparent" /> <SolidColorBrush x:Key="ButtonBackgroundDisabled" Color="Transparent" /> <SolidColorBrush x:Key="AppBarButtonBackgroundPointerOver" Color="{ThemeResource ButtonBackgroundPointerOver}" /> <Style x:Key="AddressToolbarButtonStyle" BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button"> <Setter Property="Padding" Value="0" /> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="Width" Value="36" /> <Setter Property="Height" Value="32" /> <Setter Property="Foreground" Value="{ThemeResource App.Theme.IconBaseBrush}" /> </Style> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> <Grid Height="48" Padding="4,0,4,0" Background="{ThemeResource App.Theme.AddressBar.BackgroundBrush}" ColumnSpacing="4"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <!-- Listary Integration --> <Grid Width="0" Height="0"> <!-- Contains the current path --> <TextBox AutomationProperties.AutomationId="CurrentPathGet" Text="{x:Bind ViewModel.PathControlDisplayText, Mode=OneWay}" /> <!-- Modifies the current path --> <TextBox x:Name="CurrentPathSetTextBox" AutomationProperties.AutomationId="CurrentPathSet" TextChanged="{x:Bind ViewModel.CurrentPathSetTextBox_TextChanged, Mode=OneWay}" /> </Grid> <!-- Page Navigation Actions --> <StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="4"> <ToggleButton x:Name="SidebarPaneToggleButton" Width="36" Height="32" Padding="0" x:Load="{x:Bind IsSidebarPaneOpenToggleButtonVisible, Mode=OneWay}" AutomationProperties.Name="ToggleSidebarPane" Background="Transparent" BorderBrush="Transparent" IsChecked="{x:Bind MainPageViewModel.IsSidebarPaneOpen, Mode=TwoWay}" ToolTipService.ToolTip="{helpers:ResourceString Name=ToggleSidebar}"> <AnimatedIcon Width="14"> <AnimatedIcon.Source> <animatedvisuals:AnimatedGlobalNavigationButtonVisualSource /> </AnimatedIcon.Source> <AnimatedIcon.FallbackIconSource> <SymbolIconSource Symbol="GlobalNavigationButton" /> </AnimatedIcon.FallbackIconSource> </AnimatedIcon> </ToggleButton> <Button x:Name="Back" AccessKey="B" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.FullDescription="{x:Bind Commands.NavigateBack.Description, Mode=OneWay}" AutomationProperties.Name="{x:Bind Commands.NavigateBack.Label, Mode=OneWay}" Command="{x:Bind Commands.NavigateBack, Mode=OneWay}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{x:Bind Commands.NavigateBack.LabelWithHotKey, Mode=OneWay}"> <FontIcon FontSize="14" Glyph="{x:Bind Commands.NavigateBack.Glyph.BaseGlyph, Mode=OneTime}" /> <Button.ContextFlyout> <MenuFlyout x:Name="BackHistoryFlyout" AreOpenCloseAnimationsEnabled="False" Opening="BackHistoryFlyout_Opening" Placement="BottomEdgeAlignedLeft" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollMode="Auto"> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> <Setter Property="MaxHeight" Value="400" /> <!-- Workaround for https://github.com/files-community/Files/issues/13078 --> <Setter Target="HighContrastAdjustment" Value="None" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </Button.ContextFlyout> </Button> <Button x:Name="FlyoutButton" LosingFocus="NavigationButtonOverflowFlyoutButton_LosingFocus" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{helpers:ResourceString Name=SeeMore}" Visibility="Collapsed"> <FontIcon FontSize="14" Glyph="" /> <Button.Flyout> <MenuFlyout Placement="BottomEdgeAlignedLeft"> <MenuFlyoutItem Command="{x:Bind Commands.NavigateForward, Mode=OneWay}" Text="{x:Bind Commands.NavigateForward.Label, Mode=OneWay}"> <MenuFlyoutItem.Icon> <FontIcon Glyph="{x:Bind Commands.NavigateForward.Glyph.BaseGlyph, Mode=OneTime}" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> <MenuFlyoutItem Command="{x:Bind Commands.NavigateUp, Mode=OneWay}" Text="{x:Bind Commands.NavigateUp.Label, Mode=OneWay}"> <MenuFlyoutItem.Icon> <FontIcon Glyph="{x:Bind Commands.NavigateUp.Glyph.BaseGlyph, Mode=OneTime}" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> <MenuFlyoutItem Command="{x:Bind Commands.RefreshItems, Mode=OneWay}" Text="{x:Bind Commands.RefreshItems.Label, Mode=OneWay}"> <MenuFlyoutItem.Icon> <FontIcon Glyph="{x:Bind Commands.RefreshItems.Glyph.BaseGlyph, Mode=OneTime}" /> </MenuFlyoutItem.Icon> </MenuFlyoutItem> </MenuFlyout> </Button.Flyout> </Button> <Button x:Name="Forward" AccessKey="F" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.FullDescription="{x:Bind Commands.NavigateForward.Description, Mode=OneWay}" AutomationProperties.Name="{x:Bind Commands.NavigateForward.Label, Mode=OneWay}" Command="{x:Bind Commands.NavigateForward, Mode=OneWay}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{x:Bind Commands.NavigateForward.LabelWithHotKey, Mode=OneWay}"> <FontIcon FontSize="14" Glyph="{x:Bind Commands.NavigateForward.Glyph.BaseGlyph, Mode=OneTime}" /> <Button.ContextFlyout> <MenuFlyout x:Name="ForwardHistoryFlyout" AreOpenCloseAnimationsEnabled="False" Opening="ForwardHistoryFlyout_Opening" Placement="BottomEdgeAlignedLeft" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollMode="Auto"> <MenuFlyout.MenuFlyoutPresenterStyle> <Style TargetType="MenuFlyoutPresenter"> <Setter Property="MaxHeight" Value="400" /> <!-- Workaround for https://github.com/files-community/Files/issues/13078 --> <Setter Target="HighContrastAdjustment" Value="None" /> </Style> </MenuFlyout.MenuFlyoutPresenterStyle> </MenuFlyout> </Button.ContextFlyout> </Button> <Button x:Name="Up" AccessKey="U" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.FullDescription="{x:Bind Commands.NavigateUp.Description, Mode=OneWay}" AutomationProperties.Name="{x:Bind Commands.NavigateUp.Label, Mode=OneWay}" Command="{x:Bind Commands.NavigateUp, Mode=OneWay}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{x:Bind Commands.NavigateUp.LabelWithHotKey, Mode=OneWay}"> <FontIcon FontSize="14" Glyph="{x:Bind Commands.NavigateUp.Glyph.BaseGlyph, Mode=OneTime}" /> </Button> <Button x:Name="Refresh" AccessKey="R" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.Name="{x:Bind Commands.RefreshItems.Label, Mode=OneWay}" Command="{x:Bind Commands.RefreshItems, Mode=OneWay}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{x:Bind Commands.RefreshItems.LabelWithHotKey, Mode=OneWay}"> <FontIcon FontSize="14" Glyph="{x:Bind Commands.RefreshItems.Glyph.BaseGlyph, Mode=OneTime}" /> </Button> </StackPanel> <!-- Omnibar --> <controls:Omnibar x:Name="Omnibar" Grid.Column="1" x:Load="{x:Bind ViewModel.LoadOmnibar, Mode=OneWay}" CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}" IsFocusedChanged="Omnibar_IsFocusedChanged" ModeChanged="Omnibar_ModeChanged" PreviewKeyDown="Omnibar_PreviewKeyDown" QuerySubmitted="Omnibar_QuerySubmitted" TextChanged="Omnibar_TextChanged"> <controls:OmnibarMode x:Name="OmnibarPathMode" IconOnActive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Path}, IsFilled=True}" IconOnInactive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Path}, IconType=Outline}" IsDefault="True" ItemsSource="{x:Bind ViewModel.PathModeSuggestionItems, Mode=OneWay}" ModeName="{x:Bind Commands.EditPath.LabelWithHotKey, Mode=OneWay}" PlaceholderText="{helpers:ResourceString Name=OmnibarPathModeTextPlaceholder}" Text="{x:Bind ViewModel.PathText, Mode=TwoWay}" TextMemberPath="Path"> <controls:OmnibarMode.ContentOnInactive> <controls:BreadcrumbBar x:Name="BreadcrumbBar" EllipsisButtonToolTip="{helpers:ResourceString Name=BreadcrumbBarEllipsisButtonToolTip}" ItemClicked="BreadcrumbBar_ItemClicked" ItemDropDownFlyoutClosed="BreadcrumbBar_ItemDropDownFlyoutClosed" ItemDropDownFlyoutOpening="BreadcrumbBar_ItemDropDownFlyoutOpening" ItemsSource="{x:Bind ViewModel.PathComponents, Mode=OneWay}" RootItemChevronToolTip="{helpers:ResourceString Name=BreadcrumbBarRootChevronButtonToolTip}" RootItemToolTip="{helpers:ResourceString Name=Home}"> <controls:BreadcrumbBar.RootItem> <Image Width="16" Height="16" Source="/Assets/FluentIcons/SidebarSections/Home.png" /> </controls:BreadcrumbBar.RootItem> <controls:BreadcrumbBar.ItemTemplate> <DataTemplate x:DataType="dataitems:PathBoxItem"> <controls:BreadcrumbBarItem AllowDrop="True" AutomationProperties.AccessibilityView="Content" AutomationProperties.Name="{x:Bind Title, Mode=OneWay}" ChevronToolTip="{x:Bind ChevronToolTip, Mode=OneWay}" Content="{x:Bind Title, Mode=OneWay}" DataContext="{x:Bind}" DragLeave="BreadcrumbBarItem_DragLeave" DragOver="BreadcrumbBarItem_DragOver" Drop="BreadcrumbBarItem_Drop" IsChevronVisible="{x:Bind IsChevronVisible, Mode=OneWay}" RightTapped="BreadcrumbBarItem_RightTapped" /> </DataTemplate> </controls:BreadcrumbBar.ItemTemplate> </controls:BreadcrumbBar> </controls:OmnibarMode.ContentOnInactive> <controls:OmnibarMode.ItemTemplate> <DataTemplate x:DataType="datamodels:OmnibarPathModeSuggestionModel"> <TextBlock Text="{x:Bind DisplayName, Mode=OneWay}" /> </DataTemplate> </controls:OmnibarMode.ItemTemplate> </controls:OmnibarMode> <controls:OmnibarMode x:Name="OmnibarCommandPaletteMode" IconOnActive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Commands}, IsFilled=True}" IconOnInactive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Commands}, IconType=Outline}" IsAutoFocusEnabled="True" ItemsSource="{x:Bind ViewModel.OmnibarCommandPaletteModeSuggestionItems, Mode=OneWay}" ModeName="{x:Bind Commands.OpenCommandPalette.LabelWithHotKey, Mode=OneWay}" PlaceholderText="{helpers:ResourceString Name=OmnibarCommandPaletteModeTextPlaceholder}" Text="{x:Bind ViewModel.OmnibarCommandPaletteModeText, Mode=TwoWay}" TextMemberPath="Text" UpdateTextOnSelect="False"> <controls:OmnibarMode.ItemTemplate> <DataTemplate x:DataType="dataitems:NavigationBarSuggestionItem"> <Grid Padding="0,0,4,0" ColumnSpacing="12"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <Grid Grid.Column="0" Width="16" Height="16"> <Viewbox Width="16" Height="16" Visibility="{x:Bind Glyph, Converter={StaticResource NullToVisibilityCollapsedConverter}, Mode=OneWay}"> <FontIcon Foreground="{ThemeResource App.Theme.IconBaseBrush}" Glyph="{x:Bind Glyph, Mode=OneWay}" /> </Viewbox> <controls:ThemedIcon Style="{x:Bind ThemedIconStyle, Mode=OneWay}" Visibility="{x:Bind ThemedIconStyle, Converter={StaticResource NullToVisibilityCollapsedConverter}, Mode=OneWay}" /> <Image Source="{x:Bind ActionIconSource, Mode=OneWay}" /> </Grid> <!-- Primary Title --> <TextBlock x:Name="PrimaryDisplayBlock" Grid.Column="1" VerticalAlignment="Center" Foreground="{ThemeResource TextFillColorPrimaryBrush}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"> <Run FontWeight="Normal" Text="{x:Bind PrimaryDisplayPreMatched, Mode=OneWay}" /><Run FontWeight="Bold" Text="{x:Bind PrimaryDisplayMatched, Mode=OneWay}" /><Run FontWeight="Normal" Text="{x:Bind PrimaryDisplayPostMatched, Mode=OneWay}" /> </TextBlock> <!-- Keyboard Shortcuts --> <keyboard:KeyboardShortcut x:Name="RightAlignedKeyboardShortcut" Grid.Column="2" VerticalAlignment="Center" HotKeys="{x:Bind HotKeys, Mode=OneWay}" /> </Grid> </DataTemplate> </controls:OmnibarMode.ItemTemplate> </controls:OmnibarMode> <controls:OmnibarMode x:Name="OmnibarSearchMode" IconOnActive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Search}, IsFilled=True}" IconOnInactive="{controls:ThemedIconMarkup Style={StaticResource App.ThemedIcons.Omnibar.Search}, IconType=Outline}" IsAutoFocusEnabled="True" ItemsSource="{x:Bind ViewModel.OmnibarSearchModeSuggestionItems, Mode=OneWay}" ModeName="{x:Bind Commands.Search.LabelWithHotKey, Mode=OneWay}" PlaceholderText="{x:Bind ViewModel.OmnibarSearchModePlaceholder, Mode=OneWay}" Text="{x:Bind ViewModel.OmnibarSearchModeText, Mode=TwoWay}" UpdateTextOnSelect="False"> <controls:OmnibarMode.ItemTemplate> <DataTemplate x:DataType="datamodels:SuggestionModel"> <Grid ColumnSpacing="8" Tag="{x:Bind ItemPath}"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid Grid.Column="0" Width="16" Height="16" Tag="ItemImage"> <Border x:Name="IconArea" x:Load="{x:Bind LoadFileIcon, Mode=OneWay}"> <Image Width="16" Height="16" Source="{x:Bind FileImage, Mode=OneWay}" Stretch="Uniform" /> </Border> <FontIcon x:Name="EmptyIconGlyph" x:Load="{x:Bind NeedsPlaceholderGlyph, Mode=OneWay}" FontSize="14" Glyph="{x:Bind IsRecentSearch, Mode=OneTime, Converter={StaticResource SearchSuggestionGlyphConverter}}" /> <Viewbox x:Name="ShortcutGlyphElement" Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" x:Load="{x:Bind IsShortcut}"> <controls:ThemedIcon Style="{StaticResource App.ThemedIcons.Shortcut}" /> </Viewbox> </Grid> <StackPanel Grid.Column="1" VerticalAlignment="Center"> <TextBlock Text="{x:Bind Name, Mode=OneWay}" /> <TextBlock FontSize="12" Foreground="{ThemeResource TextFillColorSecondaryBrush}" Text="{x:Bind Description, Mode=OneWay}" Visibility="{x:Bind DescriptionVisibility}" /> </StackPanel> </Grid> </DataTemplate> </controls:OmnibarMode.ItemTemplate> </controls:OmnibarMode> </controls:Omnibar> <!-- Right Side Action Buttons --> <StackPanel x:Name="RightSideActionsStackPanel" Grid.Column="2" Orientation="Horizontal" Spacing="4"> <!-- Shelf Pane --> <ToggleButton x:Name="ShelfPaneToggleButton" Width="36" Height="32" Padding="0" x:Load="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=OneWay}" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.Name="{x:Bind Commands.ToggleShelfPane.Label, Mode=OneWay}" Background="Transparent" BorderBrush="Transparent" IsChecked="{x:Bind Commands.ToggleShelfPane.IsOn, Mode=TwoWay}" ToolTipService.ToolTip="{x:Bind Commands.ToggleShelfPane.LabelWithHotKey, Mode=OneWay}"> <controls:ThemedIcon Width="16" Height="16" Style="{StaticResource App.ThemedIcons.Shelf}" /> </ToggleButton> <!-- Status Center --> <Button x:Name="ShowStatusCenterButton" Padding="0" AccessKey="T" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.Name="{helpers:ResourceString Name=StatusCenter}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{helpers:ResourceString Name=StatusCenter}" Visibility="{x:Bind ViewModel.ShowStatusCenterButton, Mode=OneWay}"> <Grid Margin="-16"> <controls:ThemedIcon x:Name="StatusCenterIcon" Width="16" Height="16" Style="{StaticResource App.ThemedIcons.StatusCenter}" Visibility="{x:Bind OngoingTasksViewModel.ShowProgressRing, Converter={StaticResource VisibilityInvertConverter}, Mode=OneWay}" /> <ProgressRing x:Name="MedianOperationProgressRing" HorizontalAlignment="Center" VerticalAlignment="Center" AutomationProperties.Name="{helpers:ResourceString Name=StatusCenterProgressRing}" IsIndeterminate="False" Visibility="{x:Bind OngoingTasksViewModel.ShowProgressRing, Mode=OneWay}" Value="{x:Bind OngoingTasksViewModel.AverageOperationProgressValue, Mode=OneWay}" /> <InfoBadge x:Name="StatusInfoBadge" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{x:Bind OngoingTasksViewModel.ShowProgressRing, Mode=OneWay}" Value="{x:Bind OngoingTasksViewModel.InfoBadgeValue, Mode=OneWay}" /> </Grid> <Button.Flyout> <Flyout contract8Present:ShouldConstrainToRootBounds="False" AutomationProperties.Name="{helpers:ResourceString Name=StatusCenter}" Opened="{x:Bind OngoingTasksViewModel.OnStatusCenterFlyoutOpened, Mode=OneWay}" Placement="BottomEdgeAlignedRight"> <Flyout.FlyoutPresenterStyle> <Style TargetType="FlyoutPresenter"> <Setter Property="Padding" Value="0" /> <Setter Property="CornerRadius" Value="{StaticResource OverlayCornerRadius}" /> </Style> </Flyout.FlyoutPresenterStyle> <ucs:StatusCenter x:Name="OngoingTasksControl" Width="400" MinHeight="120" MaxHeight="500" x:FieldModifier="public" IsTabStop="True" /> </Flyout> </Button.Flyout> </Button> <!-- Update The Files App Button When An Update Available --> <Button x:Name="UpdateAppButton" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" x:Load="{x:Bind ViewModel.IsUpdateAvailable, Mode=OneWay}" AccessKey="1" AccessKeyInvoked="Button_AccessKeyInvoked" AutomationProperties.Name="{helpers:ResourceString Name=UpdateFiles}" Command="{x:Bind ViewModel.UpdateCommand, Mode=OneWay}" IsEnabled="{x:Bind ViewModel.IsUpdating, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" Style="{StaticResource AddressToolbarButtonStyle}" ToolTipService.ToolTip="{helpers:ResourceString Name=UpdateFiles}"> <Grid> <!-- Icon --> <controls:ThemedIcon x:Name="UpdateIcon" Width="16" Height="16" x:Load="{x:Bind ViewModel.IsUpdating, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}" IsFilled="True" Style="{StaticResource App.ThemedIcons.v4.AppUpdateAvailable}" /> <!-- Progress --> <ProgressRing x:Name="UpdateProgressRing" Width="20" Height="20" x:Load="{x:Bind ViewModel.IsUpdating, Mode=OneWay}" IsIndeterminate="{x:Bind ViewModel.IsUpdateProgressIndeterminate, Mode=OneWay}" Value="{x:Bind ViewModel.UpdateProgress, Mode=OneWay}" /> </Grid> </Button> </StackPanel> <!-- Status Center TeachingTip --> <TeachingTip x:Name="StatusCenterTeachingTip" Title="{helpers:ResourceString Name=OngoingTasksTeachingTip/Title}" IsOpen="False" Subtitle="{helpers:ResourceString Name=OngoingTasksTeachingTip/Subtitle}" Target="{x:Bind ShowStatusCenterButton}" /> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="NavigationStates"> <VisualState x:Name="Narrow"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="0" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="FlyoutButton.Visibility" Value="Visible" /> <Setter Target="Forward.Visibility" Value="Collapsed" /> <Setter Target="Up.Visibility" Value="Collapsed" /> <Setter Target="Refresh.Visibility" Value="Collapsed" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Wide"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="540" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="FlyoutButton.Visibility" Value="Collapsed" /> <Setter Target="Forward.Visibility" Value="Visible" /> <Setter Target="Up.Visibility" Value="Visible" /> <Setter Target="Refresh.Visibility" Value="Visible" /> </VisualState.Setters> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="RightActionsGroup"> <VisualState> <VisualState.Setters> <Setter Target="RightSideActionsStackPanel.Margin" Value="0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="StatusButtonVisible"> <VisualState.StateTriggers> <triggers:IsEqualStateTrigger Value="{x:Bind ViewModel.ShowStatusCenterButton, Mode=OneWay}" To="True" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="RightSideActionsStackPanel.Margin" Value="0,0,4,0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="ShelfButtonVisible"> <VisualState.StateTriggers> <triggers:IsEqualStateTrigger Value="{x:Bind ViewModel.ShowShelfPaneToggleButton, Mode=OneWay}" To="True" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="RightSideActionsStackPanel.Margin" Value="0,0,4,0" /> </VisualState.Setters> </VisualState> <VisualState x:Name="UpdateButtonVisible"> <VisualState.StateTriggers> <triggers:IsEqualStateTrigger Value="{x:Bind ViewModel.IsUpdateAvailable, Mode=OneWay}" To="True" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="RightSideActionsStackPanel.Margin" Value="0,0,4,0" /> </VisualState.Setters> </VisualState> </VisualStateGroup> <VisualStateGroup x:Name="StatusIconStates"> <VisualState x:Name="TasksSuccess"> <VisualState.StateTriggers> <triggers:CompareStateTrigger Comparison="Equal" Value="{x:Bind OngoingTasksViewModel.InfoBadgeState, Mode=OneWay}" To="0" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="MedianOperationProgressRing.Background" Value="{ThemeResource SystemFillColorSuccessBrush}" /> <Setter Target="StatusInfoBadge.Style" Value="{StaticResource SuccessIconInfoBadgeStyle}" /> </VisualState.Setters> </VisualState> <VisualState x:Name="TasksOnging"> <VisualState.StateTriggers> <triggers:CompareStateTrigger Comparison="Equal" Value="{x:Bind OngoingTasksViewModel.InfoBadgeState, Mode=OneWay}" To="1" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="MedianOperationProgressRing.Foreground" Value="{ThemeResource SystemFillColorAttentionBrush}" /> <Setter Target="MedianOperationProgressRing.Background" Value="{ThemeResource SubtleFillColorSecondaryBrush}" /> <Setter Target="StatusCenterIcon.Visibility" Value="Collapsed" /> </VisualState.Setters> </VisualState> <VisualState x:Name="TasksFailure"> <VisualState.StateTriggers> <triggers:CompareStateTrigger Comparison="Equal" Value="{x:Bind OngoingTasksViewModel.InfoBadgeState, Mode=OneWay}" To="2" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="MedianOperationProgressRing.Foreground" Value="{ThemeResource SystemFillColorAttentionBrush}" /> <Setter Target="MedianOperationProgressRing.Background" Value="{ThemeResource SubtleFillColorSecondaryBrush}" /> <Setter Target="StatusCenterIcon.Visibility" Value="Collapsed" /> </VisualState.Setters> </VisualState> <VisualState x:Name="TasksCompletionWithFailure"> <VisualState.StateTriggers> <triggers:CompareStateTrigger Comparison="Equal" Value="{x:Bind OngoingTasksViewModel.InfoBadgeState, Mode=OneWay}" To="3" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="MedianOperationProgressRing.Background" Value="{ThemeResource SystemFillColorCriticalBrush}" /> <Setter Target="StatusCenterIcon.Visibility" Value="Collapsed" /> <Setter Target="StatusInfoBadge.Style" Value="{StaticResource CriticalIconInfoBadgeStyle}" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Grid> </UserControl>