144 lines
7 KiB
XML
144 lines
7 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="using:LANCommander.Launcher.ViewModels.Components"
|
|
xmlns:converters="using:LANCommander.Launcher.Converters"
|
|
xmlns:svg="using:Avalonia.Svg.Skia"
|
|
x:Class="LANCommander.Launcher.Views.Components.LibrarySidebarView"
|
|
x:DataType="vm:LibrarySidebarViewModel">
|
|
|
|
<UserControl.Resources>
|
|
<converters:FilePathToBitmapConverter x:Key="FilePathToBitmapConverter" />
|
|
</UserControl.Resources>
|
|
|
|
<Border Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}">
|
|
<DockPanel>
|
|
<!-- Header -->
|
|
<Border DockPanel.Dock="Top" Padding="16,12" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
|
|
<DockPanel>
|
|
<Button DockPanel.Dock="Right"
|
|
Content="⟳"
|
|
Command="{Binding RefreshCommand}"
|
|
ToolTip.Tip="Refresh"
|
|
Padding="8,4" />
|
|
<svg:Svg Path="/Assets/logo.svg"
|
|
Height="28"
|
|
VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<!-- Navigation Buttons -->
|
|
<StackPanel DockPanel.Dock="Top" Margin="8,8,8,0">
|
|
<Button Command="{Binding ShowDepotCommand}"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Left"
|
|
Padding="12,10"
|
|
Margin="0,0,0,4"
|
|
Classes.selected="{Binding IsDepotSelected}">
|
|
<StackPanel Orientation="Horizontal" Spacing="12">
|
|
<TextBlock Text="🏪" FontSize="16" />
|
|
<TextBlock Text="Depot (All Games)" VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
|
|
<!-- Library Section Header -->
|
|
<Border DockPanel.Dock="Top" Padding="16,16,16,8">
|
|
<TextBlock Text="MY LIBRARY"
|
|
FontSize="11"
|
|
FontWeight="SemiBold"
|
|
Opacity="0.5" />
|
|
</Border>
|
|
|
|
<!-- Offline Mode Indicator -->
|
|
<Border DockPanel.Dock="Bottom"
|
|
Padding="8"
|
|
Background="#4A2D00"
|
|
IsVisible="{Binding IsOfflineMode}">
|
|
<DockPanel>
|
|
<Button DockPanel.Dock="Right"
|
|
Content="Go Online"
|
|
Command="{Binding GoOnlineCommand}"
|
|
Padding="8,4"
|
|
Background="#0E639C"
|
|
Foreground="White"
|
|
FontSize="11" />
|
|
<StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
|
|
<TextBlock Text="⚠" Foreground="#FFA500" FontSize="14" />
|
|
<TextBlock Text="Offline Mode"
|
|
Foreground="#FFA500"
|
|
FontSize="11"
|
|
FontWeight="SemiBold"
|
|
VerticalAlignment="Center" />
|
|
</StackPanel>
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<!-- Footer -->
|
|
<Border DockPanel.Dock="Bottom" Padding="8" Background="{DynamicResource SystemControlBackgroundChromeMediumBrush}">
|
|
<DockPanel>
|
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Spacing="4">
|
|
<Button Content="📴"
|
|
Command="{Binding GoOfflineCommand}"
|
|
ToolTip.Tip="Go Offline"
|
|
Padding="8,4"
|
|
IsVisible="{Binding !IsOfflineMode}" />
|
|
<Button Content="⚙"
|
|
Command="{Binding SettingsCommand}"
|
|
ToolTip.Tip="Settings"
|
|
Padding="8,4" />
|
|
<Button Content="Logout"
|
|
Command="{Binding LogoutCommand}"
|
|
Padding="8,4" />
|
|
</StackPanel>
|
|
<TextBlock Text="{Binding StatusMessage}"
|
|
Opacity="0.6"
|
|
FontSize="11"
|
|
VerticalAlignment="Center"
|
|
TextTrimming="CharacterEllipsis" />
|
|
</DockPanel>
|
|
</Border>
|
|
|
|
<!-- Loading Indicator -->
|
|
<Border DockPanel.Dock="Top"
|
|
IsVisible="{Binding IsLoading}"
|
|
Padding="16,8">
|
|
<TextBlock Text="Loading..." Opacity="0.6" FontSize="12" />
|
|
</Border>
|
|
|
|
<!-- Library Items List -->
|
|
<ListBox ItemsSource="{Binding Items}"
|
|
SelectedItem="{Binding SelectedItem}"
|
|
Padding="4"
|
|
Background="Transparent">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate DataType="vm:LibraryItemViewModel">
|
|
<StackPanel Orientation="Horizontal" Spacing="10" Margin="4,2">
|
|
<!-- Icon -->
|
|
<Border Width="24" Height="24"
|
|
CornerRadius="4"
|
|
ClipToBounds="True">
|
|
<Panel>
|
|
<Image Source="{Binding IconPath, Converter={StaticResource FilePathToBitmapConverter}}"
|
|
Stretch="UniformToFill"
|
|
IsVisible="{Binding HasIcon}" />
|
|
<Border Background="{DynamicResource SystemAccentColor}"
|
|
IsVisible="{Binding !HasIcon}">
|
|
<TextBlock Text="🎮"
|
|
FontSize="12"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" />
|
|
</Border>
|
|
</Panel>
|
|
</Border>
|
|
|
|
<!-- Title -->
|
|
<TextBlock Text="{Binding Title}"
|
|
VerticalAlignment="Center"
|
|
TextTrimming="CharacterEllipsis" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</DockPanel>
|
|
</Border>
|
|
</UserControl>
|