Files
LanMountainDesktop/LanMountainDesktop/Views/MainWindow.axaml
lincube eb066b53f1 Introduce render mode & static component previews
Add DesktopComponentRenderMode and thread the render mode through runtime context and creation APIs so controls can be created for library previews. Replace image-based preview system with static preview Controls: viewmodels and ComponentLibraryWindow now use PreviewControl, and ComponentPreviewImageService/related types and tests were removed. Add ComponentPreviewRuntimeQuiescer to attach/detach preview controls (stop timers, disable input) for safe static previews. Simplify component-library collapse state/presenter by removing transient expanded opacity handling. Update runtime registry, services, views and tests to support the new flow.
2026-04-29 19:43:29 +08:00

824 lines
54 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LanMountainDesktop.ViewModels"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:fi="using:FluentIcons.Avalonia"
xmlns:ic="using:FluentIcons.Avalonia"
xmlns:mi="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
xmlns:comp="using:LanMountainDesktop.Views.Components"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="1280"
d:DesignHeight="720"
x:Class="LanMountainDesktop.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
WindowState="FullScreen"
WindowDecorations="None"
CanResize="False"
UseLayoutRounding="True"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Background="Transparent"
TransparencyLevelHint="Transparent"
Title="LanMountainDesktop">
<Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext>
<Window.Styles>
<Style Selector="Border.taskbar-profile-popup-panel">
<Setter Property="Background" Value="{DynamicResource TaskbarProfilePopupSurfaceBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource TaskbarProfilePopupOutlineBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="26" />
<Setter Property="Padding" Value="16" />
<Setter Property="BoxShadow" Value="0 14 36 #2A000000" />
</Style>
<Style Selector="Border.taskbar-profile-popup-avatar">
<Setter Property="Background" Value="{DynamicResource TaskbarProfilePopupAvatarSurfaceBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource TaskbarProfilePopupOutlineBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="22" />
</Style>
<Style Selector="TextBlock.taskbar-profile-popup-primary">
<Setter Property="Foreground" Value="{DynamicResource TaskbarProfilePopupTextBrush}" />
</Style>
<Style Selector="TextBlock.taskbar-profile-popup-title">
<Setter Property="Foreground" Value="{DynamicResource TaskbarProfilePopupTextBrush}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style Selector="TextBlock.taskbar-profile-popup-action-text">
<Setter Property="Foreground" Value="{DynamicResource TaskbarProfilePopupTextBrush}" />
<Setter Property="FontSize" Value="14" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="mi|MaterialIcon.taskbar-profile-popup-action-icon">
<Setter Property="Foreground" Value="{DynamicResource TaskbarProfilePopupAccentBrush}" />
<Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style Selector="Button.taskbar-profile-popup-action">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="18" />
<Setter Property="Padding" Value="14,12" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="48" />
<Setter Property="Transitions">
<Transitions>
<BrushTransition Property="Background" Duration="{StaticResource FluttermotionToken.Duration.Fast}" />
<TransformOperationsTransition Property="RenderTransform" Duration="{StaticResource FluttermotionToken.Duration.Fast}" />
</Transitions>
</Setter>
</Style>
<Style Selector="Button.taskbar-profile-popup-action:pointerover">
<Setter Property="Background" Value="{DynamicResource TaskbarProfilePopupActionHoverBrush}" />
<Setter Property="RenderTransform" Value="scale(1.01)" />
</Style>
<Style Selector="Button.taskbar-profile-popup-action:pressed">
<Setter Property="Background" Value="{DynamicResource TaskbarProfilePopupActionPressedBrush}" />
<Setter Property="RenderTransform" Value="scale(0.985)" />
</Style>
</Window.Styles>
<Grid>
<Grid x:Name="DesktopPage"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X" Duration="{StaticResource FluttermotionToken.Duration.Intro}" Easing="0.05,0.75,0.10,1.00" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<Grid.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Page}" Easing="0.05,0.75,0.10,1.00" />
</Transitions>
</Grid.Transitions>
<Border x:Name="DesktopHost"
ClipToBounds="True"
Background="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid>
<Border x:Name="DesktopWallpaperLayer"
IsHitTestVisible="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="#FFF6F7F9" />
<Border x:Name="DesktopWallpaperImageLayer"
IsVisible="False"
IsHitTestVisible="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent" />
<Grid x:Name="DesktopGrid"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ShowGridLines="False">
<Border x:Name="DesktopPagesViewport"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="1"
Background="Transparent"
ClipToBounds="True"
BorderThickness="0"
PointerWheelChanged="OnDesktopPagesPointerWheelChanged">
<Grid>
<Grid x:Name="DesktopPagesHost"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X"
Duration="{StaticResource FluttermotionToken.Duration.Page}"
Easing="0.22,1,0.36,1" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<Grid x:Name="DesktopPagesContainer"
Grid.Column="0" />
<Border x:Name="LauncherPagePanel"
Grid.Column="1"
Classes="surface-translucent-panel"
ClipToBounds="False"
CornerRadius="36"
Padding="18">
<Grid RowDefinitions="Auto,*">
<StackPanel Spacing="4">
<TextBlock x:Name="LauncherTitleTextBlock"
FontSize="24"
FontWeight="SemiBold" />
<TextBlock x:Name="LauncherSubtitleTextBlock"
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}" />
</StackPanel>
<Grid Grid.Row="1"
Margin="0,12,0,0">
<ScrollViewer x:Name="LauncherRootScrollViewer"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<WrapPanel x:Name="LauncherRootTilePanel"
Orientation="Horizontal" />
</ScrollViewer>
<Grid x:Name="LauncherFolderOverlay"
IsVisible="False"
Background="{DynamicResource AdaptiveGlassOverlayBackgroundBrush}"
Opacity="{DynamicResource AdaptiveGlassOverlayOpacity}"
PointerPressed="OnLauncherFolderOverlayPointerPressed">
<Border x:Name="LauncherFolderPanel"
Classes="surface-solid-strong"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="464"
Height="384"
CornerRadius="24"
Padding="16,14,16,12">
<Grid RowDefinitions="Auto,*">
<TextBlock x:Name="LauncherFolderTitleTextBlock"
FontSize="15"
FontWeight="SemiBold"
HorizontalAlignment="Center"
Margin="0,0,0,10" />
<Grid x:Name="LauncherFolderGridPanel"
Grid.Row="1"
ColumnDefinitions="*,*,*,*"
RowDefinitions="*,*,*" />
</Grid>
</Border>
</Grid>
</Grid>
</Grid>
</Border>
</Grid>
<Canvas x:Name="DesktopEditDragLayer"
IsHitTestVisible="False" />
</Grid>
</Border>
<!-- 鐘舵€佹爮闃村奖灞?- macOS 椋庢牸鐨勫畬鏁撮槾褰卞甫 -->
<Border x:Name="StatusBarOverlay"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="1"
IsVisible="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Height="24"
ZIndex="0"
Margin="0,0,0,-24">
<Border.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%">
<GradientStop Color="#CC000000" Offset="0.0" />
<GradientStop Color="#66000000" Offset="0.3" />
<GradientStop Color="#00000000" Offset="1.0" />
</LinearGradientBrush>
</Border.Background>
</Border>
<Border x:Name="TopStatusBarHost"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="1"
Background="Transparent"
BorderThickness="0"
Padding="4"
ZIndex="2">
<Grid ColumnDefinitions="*,Auto,*">
<!-- 宸︿晶鐘舵€佹爮缁勪欢 -->
<StackPanel x:Name="TopStatusLeftPanel"
Grid.Column="0"
Orientation="Horizontal"
Spacing="6"
HorizontalAlignment="Left">
<comp:ClockWidget x:Name="ClockWidgetLeft"
IsVisible="False"
Margin="0" />
<comp:TextCapsuleWidget x:Name="TextCapsuleWidgetLeft"
IsVisible="False"
Margin="0" />
<comp:NetworkSpeedWidget x:Name="NetworkSpeedWidgetLeft"
IsVisible="False"
Margin="0" />
</StackPanel>
<!-- 涓棿鐘舵€佹爮缁勪欢 -->
<StackPanel x:Name="TopStatusCenterPanel"
Grid.Column="1"
Orientation="Horizontal"
Spacing="6"
HorizontalAlignment="Center">
<comp:ClockWidget x:Name="ClockWidgetCenter"
IsVisible="False"
Margin="0" />
<comp:TextCapsuleWidget x:Name="TextCapsuleWidgetCenter"
IsVisible="False"
Margin="0" />
<comp:NetworkSpeedWidget x:Name="NetworkSpeedWidgetCenter"
IsVisible="False"
Margin="0" />
</StackPanel>
<!-- 鍙充晶鐘舵€佹爮缁勪欢 -->
<StackPanel x:Name="TopStatusRightPanel"
Grid.Column="2"
Orientation="Horizontal"
Spacing="6"
HorizontalAlignment="Right">
<comp:ClockWidget x:Name="ClockWidgetRight"
IsVisible="False"
Margin="0" />
<comp:TextCapsuleWidget x:Name="TextCapsuleWidgetRight"
IsVisible="False"
Margin="0" />
<comp:NetworkSpeedWidget x:Name="NetworkSpeedWidgetRight"
IsVisible="False"
Margin="0" />
</StackPanel>
</Grid>
</Border>
<Border x:Name="BottomTaskbarContainer"
Classes="surface-translucent-island"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="1"
HorizontalAlignment="Stretch"
Margin="0"
CornerRadius="{DynamicResource DesignCornerRadiusLg}"
Padding="6">
<Grid ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="8">
<Border x:Name="TaskbarFixedActionsHost"
Grid.Column="0"
Background="Transparent"
BorderThickness="0">
<Grid ColumnDefinitions="Auto"
ColumnSpacing="8">
<Button x:Name="BackToWindowsButton"
Grid.Column="0"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnMinimizeClick">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="8">
<fi:FluentIcon x:Name="BackToWindowsIcon"
Icon="Window"
IconVariant="Regular" />
<TextBlock x:Name="BackToWindowsTextBlock"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}" />
</StackPanel>
</Button>
</Grid>
</Border>
<Border x:Name="TaskbarDynamicActionsHost"
Grid.Column="1"
Background="Transparent"
BorderThickness="0"
IsVisible="False">
<StackPanel x:Name="TaskbarDynamicActionsPanel"
Orientation="Horizontal"
Spacing="8" />
</Border>
<Border x:Name="TaskbarSettingsActionHost"
Grid.Column="2"
Background="Transparent"
BorderThickness="0">
<Grid>
<Button x:Name="TaskbarProfileButton"
Padding="0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnTaskbarProfileButtonClick">
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center">
<Border x:Name="TaskbarProfileAvatarBorder"
Background="{DynamicResource AdaptiveButtonHoverBackgroundBrush}"
BorderBrush="{DynamicResource AdaptiveDockGlassBorderBrush}"
BorderThickness="1"
CornerRadius="999"
ClipToBounds="True">
<Grid>
<Image x:Name="TaskbarProfileAvatarImage"
Stretch="UniformToFill"
IsVisible="False" />
<TextBlock x:Name="TaskbarProfileAvatarFallbackText"
Classes="taskbar-profile-popup-primary"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Text="U" />
</Grid>
</Border>
</Grid>
</Button>
<Popup x:Name="TaskbarProfilePopup"
Placement="TopEdgeAlignedRight"
IsLightDismissEnabled="True">
<Border x:Name="TaskbarProfilePopupPanel"
Classes="taskbar-profile-popup-panel"
Margin="0,0,0,10">
<Grid Width="340">
<Grid x:Name="TaskbarProfileMainPanel"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Fast}" />
</Transitions>
</Grid.Transitions>
<StackPanel Spacing="12">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<Border x:Name="TaskbarProfileHeaderAvatarBorder"
Classes="taskbar-profile-popup-avatar"
Width="44"
Height="44"
ClipToBounds="True">
<Grid>
<Image x:Name="TaskbarProfileHeaderAvatarImage"
Stretch="UniformToFill"
IsVisible="False" />
<TextBlock x:Name="TaskbarProfileHeaderAvatarFallbackText"
Classes="taskbar-profile-popup-primary"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Text="U" />
</Grid>
</Border>
<StackPanel Grid.Column="1"
VerticalAlignment="Center"
Spacing="2">
<TextBlock x:Name="TaskbarProfileDisplayNameTextBlock"
Classes="taskbar-profile-popup-title"
Text="User" />
</StackPanel>
</Grid>
<Border x:Name="TaskbarProfilePopupDivider"
Height="1"
Background="{DynamicResource TaskbarProfilePopupDividerBrush}" />
<Button x:Name="TaskbarProfileSettingsActionButton"
Classes="taskbar-profile-popup-action"
Click="OnOpenSettingsClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Settings" />
<TextBlock x:Name="TaskbarProfileSettingsActionTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Settings" />
</Grid>
</Button>
<Button x:Name="TaskbarProfileDesktopEditActionButton"
Classes="taskbar-profile-popup-action"
Click="OnOpenComponentLibraryClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Pencil" />
<TextBlock x:Name="TaskbarProfileDesktopEditActionTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Edit Desktop" />
</Grid>
</Button>
<Button x:Name="TaskbarProfilePowerActionButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerMenuEnterClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Power" />
<TextBlock x:Name="TaskbarProfilePowerActionTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Power" />
</Grid>
</Button>
</StackPanel>
</Grid>
<Grid x:Name="TaskbarProfilePowerPanel"
IsVisible="False"
Opacity="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Fast}" />
</Transitions>
</Grid.Transitions>
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X"
Duration="{StaticResource FluttermotionToken.Duration.Fast}"
Easing="0.22,1,0.36,1" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<StackPanel Spacing="8">
<Button x:Name="TaskbarPowerBackButton"
Classes="taskbar-profile-popup-action"
HorizontalAlignment="Left"
Click="OnPowerMenuBackClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="ArrowLeft" />
<TextBlock x:Name="TaskbarPowerBackTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Back" />
</Grid>
</Button>
<TextBlock x:Name="TaskbarPowerTitleTextBlock"
FontSize="16"
FontWeight="SemiBold"
Foreground="{DynamicResource TaskbarProfilePopupTextBrush}"
Text="Power" />
<Border Height="1"
Background="{DynamicResource TaskbarProfilePopupDividerBrush}" />
<Button x:Name="PowerShutdownButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerShutdownClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Power" />
<TextBlock x:Name="PowerShutdownTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Shutdown" />
</Grid>
</Button>
<Button x:Name="PowerRestartButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerRestartClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Refresh" />
<TextBlock x:Name="PowerRestartTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Restart" />
</Grid>
</Button>
<Button x:Name="PowerLogoutButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerLogoutClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="ExitToApp" />
<TextBlock x:Name="PowerLogoutTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Log Out" />
</Grid>
</Button>
<Button x:Name="PowerSleepButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerSleepClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="WeatherNight" />
<TextBlock x:Name="PowerSleepTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Sleep" />
</Grid>
</Button>
<Button x:Name="PowerLockButton"
Classes="taskbar-profile-popup-action"
Click="OnPowerLockClick">
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="12">
<mi:MaterialIcon Classes="taskbar-profile-popup-action-icon"
Kind="Lock" />
<TextBlock x:Name="PowerLockTextBlock"
Grid.Column="1"
Classes="taskbar-profile-popup-action-text"
Text="Lock Screen" />
</Grid>
</Button>
</StackPanel>
</Grid>
</Grid>
</Border>
</Popup>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</Grid>
<Border x:Name="ComponentLibraryWindow"
IsVisible="False"
Opacity="0"
Background="Transparent"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Width="620"
MinWidth="420"
MaxWidth="860"
Height="320"
MinHeight="260"
Margin="24,24,24,100"
PointerPressed="OnComponentLibraryWindowPointerPressed"
PointerMoved="OnComponentLibraryWindowPointerMoved"
PointerReleased="OnComponentLibraryWindowPointerReleased">
<Border.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Slow}" />
</Transitions>
</Border.Transitions>
<Border Classes="surface-translucent-strong"
CornerRadius="36"
Padding="14">
<Grid RowDefinitions="Auto,*"
RowSpacing="10">
<Grid ColumnDefinitions="*,Auto">
<TextBlock x:Name="ComponentLibraryTitleTextBlock"
VerticalAlignment="Center"
FontSize="16"
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="Widgets" />
<Button x:Name="CloseComponentLibraryButton"
Grid.Column="1"
Padding="8"
Width="32"
Height="32"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnCloseComponentLibraryClick">
<fi:SymbolIcon Classes="icon-s"
Symbol="Dismiss"
IconVariant="Regular" />
</Button>
</Grid>
<Border Grid.Row="1"
Classes="surface-translucent-panel"
CornerRadius="12"
Padding="14">
<Grid>
<!-- Category picker (outer) -->
<Grid x:Name="ComponentLibraryCategoriesView">
<Grid RowDefinitions="*">
<Border x:Name="ComponentLibraryCategoryViewport"
Background="Transparent"
ClipToBounds="True">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid x:Name="ComponentLibraryCategoryPagesHost"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<Grid x:Name="ComponentLibraryCategoryPagesContainer" />
</Grid>
</ScrollViewer>
</Border>
<TextBlock x:Name="ComponentLibraryEmptyTextBlock"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
Text="No components." />
</Grid>
</Grid>
<!-- Component picker (inner) -->
<Grid x:Name="ComponentLibraryComponentsView"
IsVisible="False"
RowDefinitions="Auto,*"
RowSpacing="10">
<Button x:Name="ComponentLibraryBackButton"
Grid.Row="0"
HorizontalAlignment="Left"
Padding="8,6"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnComponentLibraryBackClick">
<StackPanel Orientation="Horizontal" Spacing="8">
<fi:SymbolIcon Classes="icon-s" Symbol="ArrowLeft" IconVariant="Regular" />
<TextBlock x:Name="ComponentLibraryBackTextBlock"
VerticalAlignment="Center"
Text="Back" />
</StackPanel>
</Button>
<Grid Grid.Row="1"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="8">
<Button x:Name="ComponentLibraryPrevComponentButton"
Grid.Column="0"
Width="36"
Height="36"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="18"
Click="OnComponentLibraryPrevComponentClick"
IsVisible="False">
<fi:SymbolIcon Symbol="ChevronLeft"
IconVariant="Regular" />
</Button>
<Border x:Name="ComponentLibraryComponentViewport"
Grid.Column="1"
Background="Transparent"
ClipToBounds="True"
PointerPressed="OnComponentLibraryComponentViewportPointerPressed"
PointerMoved="OnComponentLibraryComponentViewportPointerMoved"
PointerReleased="OnComponentLibraryComponentViewportPointerReleased"
PointerCaptureLost="OnComponentLibraryComponentViewportPointerCaptureLost">
<Grid>
<Grid x:Name="ComponentLibraryComponentPagesHost"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X" Duration="{StaticResource FluttermotionToken.Duration.Page}" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<Grid x:Name="ComponentLibraryComponentPagesContainer" />
</Grid>
</Grid>
</Border>
<Button x:Name="ComponentLibraryNextComponentButton"
Grid.Column="2"
Width="36"
Height="36"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="18"
Click="OnComponentLibraryNextComponentClick"
IsVisible="False">
<fi:SymbolIcon Symbol="ChevronRight"
IconVariant="Regular" />
</Button>
</Grid>
</Grid>
</Grid>
</Border>
</Grid>
</Border>
</Border>
<Border x:Name="ComponentLibraryCollapsedChipHost"
IsVisible="False"
IsHitTestVisible="False"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Margin="0,0,0,88"
Padding="14,10"
CornerRadius="999"
Classes="surface-translucent-strong"
BorderBrush="{DynamicResource AdaptiveDockGlassBorderBrush}"
BorderThickness="1"
Opacity="0">
<Border.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Fast}" />
</Transitions>
</Border.Transitions>
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="10">
<fi:FluentIcon x:Name="ComponentLibraryCollapsedChipIcon"
Grid.Column="0"
Icon="Apps"
IconVariant="Regular"
Width="18"
Height="18"
VerticalAlignment="Center"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}" />
<TextBlock x:Name="ComponentLibraryCollapsedChipTextBlock"
Grid.Column="1"
VerticalAlignment="Center"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="Widgets" />
</Grid>
</Border>
</Grid>
</Window>