Avalonia project
This commit is contained in:
307
src/GuiApp/FileTime.Avalonia/Views/MainWindow.axaml
Normal file
307
src/GuiApp/FileTime.Avalonia/Views/MainWindow.axaml
Normal file
@@ -0,0 +1,307 @@
|
||||
<Window
|
||||
x:Class="FileTime.Avalonia.Views.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="using:FileTime.Avalonia.ViewModels"
|
||||
Title="FileTime.Avalonia"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
InputElement.KeyDown="OnKeyDown"
|
||||
InputElement.KeyUp="OnKeyUp"
|
||||
|
||||
mc:Ignorable="d">
|
||||
<Grid
|
||||
x:Name="RootContainer"
|
||||
Background="{DynamicResource AppBackgroundBrush}">
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="250" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="10" Margin="10">
|
||||
<Grid RowDefinitions="Auto,Auto">
|
||||
|
||||
<TextBlock
|
||||
Margin="0,0,0,10"
|
||||
Classes="NormalText"
|
||||
Text="Drives" />
|
||||
|
||||
<ItemsRepeater
|
||||
Grid.Row="1"
|
||||
Items="{Binding RootDriveInfos}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Margin="0,5" ColumnDefinitions="20,*,Auto" RowDefinitions="Auto,Auto">
|
||||
<Image
|
||||
Grid.RowSpan="2"
|
||||
Width="20"
|
||||
Height="20"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Source="{SvgImage /Assets/material/folder.svg}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Classes="NormalText"
|
||||
Text="{Binding FullName}" />
|
||||
|
||||
<StackPanel HorizontalAlignment="Right"
|
||||
Grid.Column="2"
|
||||
Orientation="Horizontal"
|
||||
VerticalAlignment="Center">
|
||||
|
||||
<TextBlock Classes="SmallText" Text="{Binding Free, Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}">
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Classes="SmallText" Text=" / ">
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Classes="SmallText" Text="{Binding Size, Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}">
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
<ProgressBar
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="2"
|
||||
Maximum="{Binding Size}"
|
||||
Value="{Binding Used}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" RowDefinitions="Auto,*,Auto">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
|
||||
<Grid>
|
||||
<TextBlock
|
||||
Margin="10,5"
|
||||
Text="{Binding AppState.SelectedTab.CurrentLocation.Container.FullName}" />
|
||||
</Grid>
|
||||
|
||||
<ItemsControl
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
Items="{Binding Tabs}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Margin="10,0,0,0">
|
||||
<!--i:Interaction.Behaviors>
|
||||
<ic:DataTriggerBehavior
|
||||
Binding="{Binding IsSelected}"
|
||||
Value="True">
|
||||
<ic:ChangePropertyAction
|
||||
PropertyName="Background"
|
||||
Value="{DynamicResource ForegroundBrush}" />
|
||||
<ic:ChangePropertyAction
|
||||
PropertyName="Foreground"
|
||||
TargetObject="{Binding ElementName=Text}"
|
||||
Value="{DynamicResource ContainerBackgroundBrush}" />
|
||||
</ic:DataTriggerBehavior>
|
||||
<ic:DataTriggerBehavior
|
||||
Binding="{Binding IsSelected}"
|
||||
Value="False">
|
||||
<ic:ChangePropertyAction
|
||||
PropertyName="Background"
|
||||
Value="{DynamicResource ContainerBackgroundBrush}" />
|
||||
<ic:ChangePropertyAction
|
||||
PropertyName="Foreground"
|
||||
TargetObject="{Binding ElementName=Text}"
|
||||
Value="{DynamicResource ForegroundBrush}" />
|
||||
</ic:DataTriggerBehavior>
|
||||
</i:Interaction.Behaviors-->
|
||||
|
||||
<TextBlock
|
||||
VerticalAlignment="Center" Text="{Binding TabNumber}" />
|
||||
<TextBlock Margin="5,0,0,0"
|
||||
VerticalAlignment="Center" Text="{Binding Tab.CurrentLocation.Container.FullName}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
Margin="20">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="15*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="40*" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="45*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Grid>
|
||||
<ListBox
|
||||
Classes="ContentListView"
|
||||
Items="{Binding AppState.SelectedTab.Parent.Items}"
|
||||
SelectedItem="{Binding AppState.SelectedTab.CurrentLocation}" />
|
||||
</Grid>
|
||||
|
||||
<Rectangle
|
||||
Grid.Column="1"
|
||||
Width="1"
|
||||
Margin="0,10,0,10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
|
||||
<Grid Grid.Column="2">
|
||||
<ListBox
|
||||
x:Name="CurrentItems"
|
||||
IsTabStop="True"
|
||||
Items="{Binding AppState.SelectedTab.CurrentLocation.Items}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Hidden"
|
||||
SelectedItem="{Binding AppState.SelectedTab.SelectedItem, Mode=TwoWay}"
|
||||
Classes="ContentListView" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="CurrentEmpty"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
IsVisible="{Binding AppState.SelectedTab.CurrentLocation.Items.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
||||
Empty
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
|
||||
<Rectangle
|
||||
Grid.Column="3"
|
||||
Width="1"
|
||||
Margin="0,10,0,10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Stretch"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
|
||||
<Grid Grid.Column="4">
|
||||
<ListBox
|
||||
Classes="ContentListView"
|
||||
x:Name="ChildItems"
|
||||
Items="{Binding AppState.SelectedTab.ChildContainer.Items}"
|
||||
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}" />
|
||||
|
||||
<TextBlock
|
||||
x:Name="ChildEmpty"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
||||
Empty
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="2">
|
||||
<Grid IsVisible="{Binding AppState.ViewMode, Converter={StaticResource EqualityConverter}, ConverterParameter=RapidTravel}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Rectangle
|
||||
Height="1"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="30,10,10,10"
|
||||
Orientation="Horizontal">
|
||||
|
||||
<TextBlock
|
||||
Margin="0,0,30,0"
|
||||
Text="Rapid travel mode" />
|
||||
|
||||
<TextBlock Text="Filter " />
|
||||
|
||||
<TextBlock Text="{Binding AppState.RapidTravelText}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid IsVisible="{Binding NoCommandFound}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Rectangle
|
||||
Height="1"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="{DynamicResource ErrorBrush}"
|
||||
Text="No command found" />
|
||||
</Grid>
|
||||
|
||||
<Grid IsVisible="{Binding PossibleCommands.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Rectangle
|
||||
Height="1"
|
||||
Margin="10,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Fill="{DynamicResource ContentSeparatorBrush}" />
|
||||
|
||||
<ItemsControl
|
||||
Grid.Row="1"
|
||||
Items="{Binding PossibleCommands}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding KeysDisplayText}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
Reference in New Issue
Block a user