323 lines
16 KiB
XML
323 lines
16 KiB
XML
<Window
|
|
x:Class="FileTime.GuiApp.Views.MainWindow"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:corevm="using:FileTime.App.Core.ViewModels"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="using:FileTime.GuiApp.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:FileTime.GuiApp.ViewModels"
|
|
xmlns:config="using:FileTime.GuiApp.Configuration"
|
|
Title="FileTime"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
x:CompileBindings="True"
|
|
x:DataType="vm:IMainWindowViewModelBase"
|
|
Background="Transparent"
|
|
ExtendClientAreaToDecorationsHint="True"
|
|
Icon="/Assets/filetime.ico"
|
|
InputElement.KeyDown="OnKeyDown"
|
|
Opened="OnWindowOpened"
|
|
TransparencyLevelHint="Blur"
|
|
mc:Ignorable="d">
|
|
<Design.DataContext>
|
|
<vm:MainWindowViewModel />
|
|
</Design.DataContext>
|
|
|
|
<Grid Background="{DynamicResource AppBackgroundBrush}">
|
|
<Grid
|
|
x:DataType="vm:MainWindowViewModel"
|
|
IsVisible="{Binding Loading, Converter={x:Static BoolConverters.Not}}">
|
|
<Grid
|
|
ColumnDefinitions="250,*"
|
|
RowDefinitions="Auto,*">
|
|
<Grid PointerPressed="HeaderPointerPressed">
|
|
<Rectangle Fill="#01000000" />
|
|
<TextBlock
|
|
Margin="15,10"
|
|
Text="{Binding Title}" />
|
|
</Grid>
|
|
|
|
<Grid
|
|
Grid.Column="1"
|
|
PointerPressed="HeaderPointerPressed">
|
|
<Rectangle Fill="#01000000" />
|
|
|
|
<StackPanel
|
|
Margin="20,10"
|
|
Orientation="Horizontal">
|
|
<!-- local:PathPresenter DataContext="{Binding AppState.SelectedTab^.CurrentLocation^.FullName.Path,Converter={StaticResource PathPreformatter}}"/ -->
|
|
<TextBlock
|
|
Foreground="{StaticResource AccentBrush}"
|
|
Text="{Binding AppState.SelectedTab^.CurrentSelectedItem^.DisplayNameText}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<Grid
|
|
Grid.Row="1"
|
|
Grid.Column="1"
|
|
RowDefinitions="Auto,40,*,Auto">
|
|
|
|
<ItemsControl
|
|
Grid.Row="1"
|
|
Items="{Binding AppState.Tabs}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid RowDefinitions="Auto,1">
|
|
<StackPanel
|
|
Margin="20,0,20,0"
|
|
Orientation="Horizontal">
|
|
|
|
<TextBlock
|
|
VerticalAlignment="Center"
|
|
Text="{Binding TabNumber, StringFormat=({0})}" />
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding CurrentLocation^.Name}" />
|
|
</StackPanel>
|
|
|
|
<Rectangle
|
|
Grid.Row="1"
|
|
Fill="{DynamicResource ForegroundBrush}"
|
|
IsVisible="{Binding IsSelected^}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<Grid
|
|
Grid.Row="2"
|
|
Margin="20,0,0,0">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="15*" />
|
|
<ColumnDefinition Width="10" />
|
|
<ColumnDefinition Width="40*" />
|
|
<ColumnDefinition Width="10" />
|
|
<ColumnDefinition Width="45*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<ListBox
|
|
x:CompileBindings="False"
|
|
AutoScrollToSelectedItem="True"
|
|
Classes="ContentListView"
|
|
IsTabStop="True"
|
|
Items="{Binding AppState.SelectedTab^.ParentsChildrenCollection.Collection}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="corevm:IItemViewModel">
|
|
<local:ItemView
|
|
ShowAttributes="False"
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Stretch" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<Rectangle
|
|
Grid.Column="1"
|
|
Width="1"
|
|
Margin="0,10,0,10"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Stretch"
|
|
Fill="{DynamicResource ContentSeparatorBrush}" />
|
|
|
|
<Grid
|
|
Grid.Column="2"
|
|
RowDefinitions="Auto,*">
|
|
<Grid IsVisible="{Binding AppState.SelectedTab^.CurrentLocation^.IsLoading^}">
|
|
<Image
|
|
Width="40"
|
|
Height="40"
|
|
Classes="LoadingAnimation"
|
|
Source="{SvgImage /Assets/loading.svg}" />
|
|
</Grid>
|
|
<ListBox
|
|
x:Name="CurrentItems"
|
|
Grid.Row="1"
|
|
x:CompileBindings="False"
|
|
AutoScrollToSelectedItem="True"
|
|
Classes="ContentListView"
|
|
IsTabStop="True"
|
|
Items="{Binding AppState.SelectedTab^.CurrentItemsCollection.Collection}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="corevm:IItemViewModel">
|
|
<local:ItemView
|
|
HorizontalAlignment="Stretch"
|
|
HorizontalContentAlignment="Stretch" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<TextBlock
|
|
x:Name="CurrentEmpty"
|
|
Grid.Row="1"
|
|
Margin="10"
|
|
HorizontalAlignment="Center"
|
|
x:CompileBindings="False"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource ErrorBrush}"
|
|
IsVisible="{Binding AppState.SelectedTab^.CurrentItemsCollection.Collection.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">
|
|
<Grid
|
|
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildrenCollection.Collection, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}">
|
|
<ListBox
|
|
x:Name="ChildItems"
|
|
x:CompileBindings="False"
|
|
AutoScrollToSelectedItem="True"
|
|
Classes="ContentListView"
|
|
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildrenCollection.Collection.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}"
|
|
Items="{Binding AppState.SelectedTab^.SelectedsChildrenCollection.Collection}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="corevm:IItemViewModel">
|
|
<local:ItemView />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<TextBlock
|
|
x:Name="ChildEmpty"
|
|
Margin="10"
|
|
HorizontalAlignment="Center"
|
|
x:CompileBindings="False"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource ErrorBrush}"
|
|
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildrenCollection.Collection.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
|
Empty
|
|
</TextBlock>
|
|
</Grid>
|
|
|
|
<Grid
|
|
IsVisible="{Binding AppState.SelectedTab^.SelectedsChildrenCollection, Converter={x:Static ObjectConverters.IsNull}, ConverterParameter=0, FallbackValue=False}"
|
|
RowDefinitions="Auto, Auto">
|
|
<TextBlock
|
|
Margin="0,0,0,10"
|
|
HorizontalAlignment="Center"
|
|
Foreground="{DynamicResource ErrorBrush}"
|
|
Text="There were some errors while opening container."
|
|
TextWrapping="Wrap" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding AppState.SelectedTab^.CurrentSelectedItem^.BaseItem.Exceptions^}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock
|
|
Margin="5,0,5,10"
|
|
Text="{Binding Converter={StaticResource ExceptionToStringConverter}}" />
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="3">
|
|
<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 AppState.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}" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding AppState.PossibleCommands}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate x:DataType="config:CommandBindingConfiguration">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="200" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<TextBlock Text="{Binding KeysDisplayText}" />
|
|
<TextBlock Grid.Column="1"
|
|
Text="{Binding Command, Converter={StaticResource CommandToCommandNameConverter}}" />
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
<!-- Borders -->
|
|
|
|
</Grid>
|
|
|
|
<Grid IsVisible="{Binding Loading}">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Image
|
|
Width="128"
|
|
Height="128"
|
|
Source="/Assets/filetime.ico" />
|
|
<TextBlock
|
|
Margin="50"
|
|
HorizontalAlignment="Center"
|
|
Text="Loading..." />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window> |