/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Views/Properties/MainPropertiesPage.xaml
158 строк
5 KB
yair100
Code Quality: Implemented sidebar control in Properties Window (#18692)
09 июл 2026, 17:19
Не верифицирован
09 июл 2026, 17:19
b6681a5
Код
Авторство
О чём код?
<!-- Copyright (c) Files Community. Licensed under the MIT License. --> <vm:BasePropertiesPage x:Class="Files.App.Views.Properties.MainPropertiesPage" 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:controls="using:Files.App.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:vm="using:Files.App.ViewModels.Properties" Background="{ThemeResource App.Theme.BackgroundBrush}" DataContext="{x:Bind MainPropertiesViewModel, Mode=OneWay}" HighContrastAdjustment="None" KeyDown="Page_KeyDown" Loaded="Page_Loaded" SizeChanged="Page_SizeChanged" mc:Ignorable="d"> <vm:BasePropertiesPage.Resources> <ResourceDictionary Source="ms-appx:///Styles/PropertiesStyles.xaml" /> </vm:BasePropertiesPage.Resources> <Grid x:Name="RootGrid"> <Grid.RowDefinitions> <RowDefinition Height="36" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <!-- Title bar --> <Grid x:Name="TitlebarArea"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <!-- Backward Navigation Button --> <Button x:Name="BackwardNavigationButton" Grid.Column="0" Width="40" Height="32" Margin="4,4,0,0" Background="Transparent" BorderBrush="Transparent" Command="{x:Bind MainPropertiesViewModel.DoBackwardNavigationCommand, Mode=OneWay}" CommandParameter="{x:Bind}" IsEnabled="{x:Bind MainContentFrame.CanGoBack, Mode=OneWay}" ToolTipService.ToolTip="{helpers:ResourceString Name=Back}"> <Button.Resources> <ResourceDictionary> <StaticResource x:Key="ButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" /> <StaticResource x:Key="ButtonBorderBrushDisabled" ResourceKey="SystemControlTransparentBrush" /> </ResourceDictionary> </Button.Resources> <AnimatedIcon x:Name="BackAnimatedIcon"> <AnimatedIcon.Source> <animatedvisuals:AnimatedBackVisualSource /> </AnimatedIcon.Source> <AnimatedIcon.FallbackIconSource> <SymbolIconSource Symbol="Back" /> </AnimatedIcon.FallbackIconSource> </AnimatedIcon> </Button> <!-- Title Text Area --> <Border x:Name="TitleDragArea" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <TextBlock x:Name="TitlebarFileNameTextBlock" Margin="4,4,48,0" VerticalAlignment="Center" Style="{StaticResource App.Theme.CaptionTextBlockStyle}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap"> <Run Text="{helpers:ResourceString Name=Properties}" /> </TextBlock> </Border> </Grid> <!-- Main Sidebar --> <controls:SidebarView x:Name="PropertiesSidebar" Grid.Row="1" CanResizePane="False" ItemInvoked="PropertiesSidebar_ItemInvoked" MenuItemsSource="{x:Bind MainPropertiesViewModel.FlatNavigationItems, Mode=OneWay}" OpenPaneLength="200" SelectedItem="{x:Bind MainPropertiesViewModel.SelectedNavigationItem, Mode=OneWay}"> <controls:SidebarView.InnerContent> <Grid Margin="0,0,-8,0" Background="{ThemeResource LayerFillColorDefaultBrush}" BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" BorderThickness="1,1,0,0" CornerRadius="8,0,0,0"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="52" /> </Grid.RowDefinitions> <!-- Frame --> <Frame x:Name="MainContentFrame" /> <!-- Save/Cancel buttons --> <Grid Grid.Row="1" Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}" BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" BorderThickness="0,1,0,0"> <StackPanel Margin="12,0,12,0" HorizontalAlignment="Right" Orientation="Horizontal" Spacing="12"> <Button x:Name="SaveChangesButton" Width="96" Command="{x:Bind MainPropertiesViewModel.SaveChangedPropertiesCommand, Mode=OneWay}" Content="{helpers:ResourceString Name=Save}" Style="{StaticResource AccentButtonStyle}" /> <Button x:Name="CancelChangesButton" Width="96" Command="{x:Bind MainPropertiesViewModel.CancelChangedPropertiesCommand, Mode=OneWay}" Content="{helpers:ResourceString Name=Cancel}" /> </StackPanel> </Grid> </Grid> </controls:SidebarView.InnerContent> </controls:SidebarView> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="NavigationStates"> <VisualState x:Name="Narrow"> <VisualState.Setters> <Setter Target="PropertiesSidebar.DisplayMode" Value="Compact" /> </VisualState.Setters> </VisualState> <VisualState x:Name="Wide"> <VisualState.Setters> <Setter Target="PropertiesSidebar.DisplayMode" Value="Expanded" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Grid> </vm:BasePropertiesPage>