800 lines
30 KiB
XML
800 lines
30 KiB
XML
<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"
|
|
xmlns:interactions="using:FileTime.Core.Interactions"
|
|
xmlns:local="using:FileTime.Avalonia.Views"
|
|
xmlns:models="using:FileTime.Avalonia.Models"
|
|
Title="FileTime"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
Icon="/Assets/filetime.ico"
|
|
InputElement.KeyDown="OnKeyDown"
|
|
TransparencyLevelHint="Blur"
|
|
Background="Transparent"
|
|
ExtendClientAreaToDecorationsHint="True"
|
|
Opened="OnWindowOpened"
|
|
Closed="OnWindowClosed"
|
|
x:DataType="vm:MainPageViewModel"
|
|
x:CompileBindings="True"
|
|
mc:Ignorable="d">
|
|
|
|
<Grid Background="{DynamicResource AppBackgroundBrush}">
|
|
<Grid>
|
|
<Grid ColumnDefinitions="250,*" RowDefinitions="Auto,*" IsVisible="{Binding Loading, Converter={StaticResource BoolInverter}}">
|
|
|
|
<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.Container.FullName,Converter={StaticResource PathPreformatter}}"/>
|
|
<TextBlock
|
|
Text="{Binding AppState.SelectedTab.SelectedItem.Item.DisplayName}" Foreground="{StaticResource AccentBrush}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<Grid Grid.Row="1" RowDefinitions="Auto,Auto,Auto,Auto">
|
|
|
|
<Border CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="10" Margin="10">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<TextBlock
|
|
Margin="0,0,0,10"
|
|
Text="Drives" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding RootDriveInfos}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Classes="SidebarContainerPresenter" PointerPressed="OnHasContainerPointerPressed" Cursor="Hand">
|
|
<Grid Margin="0,5" ColumnDefinitions="Auto,*,Auto" RowDefinitions="Auto,Auto">
|
|
<Image
|
|
Grid.RowSpan="2"
|
|
Width="20"
|
|
Height="20"
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Center"
|
|
Source="{SvgImage /Assets/material/folder.svg}" />
|
|
|
|
<StackPanel
|
|
Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Stretch"
|
|
Orientation="Horizontal">
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding FullName}" />
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Classes="ExtraSmallText"
|
|
Text="{Binding Label}" IsVisible="{Binding Label,Converter={StaticResource IsNotEmptyConverter}}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
HorizontalAlignment="Right"
|
|
Grid.Column="2"
|
|
Orientation="Horizontal"
|
|
VerticalAlignment="Center">
|
|
|
|
<TextBlock Classes="SmallText" VerticalAlignment="Center" Text="{Binding Free, Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}">
|
|
</TextBlock>
|
|
|
|
<TextBlock Classes="SmallText" VerticalAlignment="Center" Text=" / ">
|
|
</TextBlock>
|
|
|
|
<TextBlock Classes="SmallText" VerticalAlignment="Center" Text="{Binding Size, Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}">
|
|
</TextBlock>
|
|
</StackPanel>
|
|
|
|
<ProgressBar
|
|
Margin="5,0,0,0"
|
|
Grid.Column="1"
|
|
Grid.ColumnSpan="2"
|
|
Grid.Row="1"
|
|
MinWidth="100"
|
|
HorizontalAlignment="Stretch"
|
|
Maximum="100"
|
|
Value="{Binding UsedPercentage}" />
|
|
</Grid>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="1" CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="0,10" Margin="10">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<TextBlock
|
|
Margin="10,0,10,10"
|
|
Text="Places" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding Places}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Classes="SidebarContainerPresenter" PointerPressed="OnHasContainerPointerPressed" Cursor="Hand">
|
|
<StackPanel Orientation="Horizontal" Margin="10,5" HorizontalAlignment="Stretch">
|
|
<Image
|
|
Width="20"
|
|
Height="20"
|
|
VerticalAlignment="Center"
|
|
Source="{Binding Container,Converter={StaticResource ItemToImageConverter}}" />
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="2" CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="0,10" Margin="10">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<TextBlock
|
|
Margin="10,0,10,10"
|
|
Text="Favorites" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding AppState.FavoriteElements}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Classes="SidebarContainerPresenter" PointerPressed="OnHasContainerPointerPressed" Cursor="Hand">
|
|
<StackPanel Orientation="Horizontal" Margin="10,5" HorizontalAlignment="Stretch">
|
|
<Image
|
|
Width="20"
|
|
Height="20"
|
|
VerticalAlignment="Center"
|
|
Source="{Binding Converter={StaticResource ItemToImageConverter}}" />
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="3" CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="0,10" Margin="10">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<TextBlock
|
|
Margin="10,0,10,10"
|
|
Text="History" />
|
|
|
|
<ItemsRepeater
|
|
Grid.Row="1"
|
|
Items="{Binding AppState.SelectedTab.History}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Classes="SidebarContainerPresenter" PointerPressed="OnHasContainerPointerPressed" Cursor="Hand">
|
|
<StackPanel Orientation="Horizontal" Margin="10,5" HorizontalAlignment="Stretch">
|
|
<Image
|
|
Width="20"
|
|
Height="20"
|
|
VerticalAlignment="Center"
|
|
Source="{Binding Container,Converter={StaticResource ItemToImageConverter}}" />
|
|
|
|
<TextBlock
|
|
Margin="5,0,0,0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding Name}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Border>
|
|
|
|
</Grid>
|
|
|
|
<Grid Grid.Column="1" Grid.Row="1" RowDefinitions="Auto,40,*,Auto">
|
|
<Grid>
|
|
<ItemsControl Items="{Binding AppState.TimelineCommands}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border MaxHeight="200" Background="{DynamicResource ContainerBackgroundColor}" CornerRadius="10" Padding="5" Margin="0,0,10,0">
|
|
<ScrollViewer>
|
|
<ItemsControl Items="{Binding ParallelCommands}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border BorderThickness="1" Classes="TimelineCommand" Classes.SelectedTimelineCommand="{Binding IsSelected}">
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding Name}"/>
|
|
<ProgressBar Margin="0,5,0,0" Maximum="100" Value="{Binding Progress^}"/>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
|
|
<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 Orientation="Horizontal" Margin="20,0,20,0">
|
|
|
|
<TextBlock
|
|
VerticalAlignment="Center" Text="{Binding TabNumber,StringFormat=({0})}" />
|
|
|
|
<TextBlock
|
|
VerticalAlignment="Center" Margin="5,0,0,0" Text="{Binding CurrentLocation.Container.Name}" />
|
|
|
|
<!--local:PathPresenter Margin="5,0,0,0" DataContext="{Binding CurrentLocation.Container.FullName}"/-->
|
|
</StackPanel>
|
|
|
|
<Rectangle Fill="{DynamicResource ForegroundBrush}" Grid.Row="1" 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>
|
|
|
|
<Grid>
|
|
<ListBox
|
|
x:CompileBindings="False"
|
|
Classes="ContentListView"
|
|
IsEnabled="False"
|
|
Items="{Binding AppState.SelectedTab.Parent.Items^}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<local:ItemView ShowAttributes="False"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Grid>
|
|
|
|
<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.Loading}">
|
|
<Image Width="40" Height="40" Source="{SvgImage /Assets/loading.svg}" Classes="LoadingAnimation"/>
|
|
</Grid>
|
|
<ListBox
|
|
Grid.Row="1"
|
|
x:Name="CurrentItems"
|
|
x:CompileBindings="False"
|
|
AutoScrollToSelectedItem="True"
|
|
IsTabStop="True"
|
|
Items="{Binding AppState.SelectedTab.CurrentLocation.Items^}"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
|
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
|
SelectedItem="{Binding AppState.SelectedTab.SelectedItem, Mode=TwoWay}"
|
|
Classes="ContentListView">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<local:ItemView HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch"/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<TextBlock
|
|
Grid.Row="1"
|
|
x:CompileBindings="False"
|
|
x:Name="CurrentEmpty"
|
|
Margin="10"
|
|
HorizontalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource ErrorBrush}"
|
|
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">
|
|
<Grid IsVisible="{Binding AppState.SelectedTab.ItemPreview, Converter={StaticResource IsNullConverter}}">
|
|
<Grid IsVisible="{Binding AppState.SelectedTab.ChildContainer,Converter={StaticResource IsNotNullConverter}}">
|
|
<ListBox
|
|
Classes="ContentListView"
|
|
IsEnabled="False"
|
|
x:Name="ChildItems"
|
|
x:CompileBindings="False"
|
|
Items="{Binding AppState.SelectedTab.ChildContainer.Items^}"
|
|
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items^.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<local:ItemView/>
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
|
|
<Grid
|
|
x:CompileBindings="False"
|
|
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items^.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
|
<TextBlock
|
|
x:Name="ChildEmpty"
|
|
Margin="10"
|
|
HorizontalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Foreground="{DynamicResource ErrorBrush}"
|
|
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Exceptions.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
|
|
Empty
|
|
</TextBlock>
|
|
|
|
<Grid
|
|
RowDefinitions="Auto, Auto"
|
|
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Exceptions.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
|
|
|
<TextBlock
|
|
Margin="0,0,0,10"
|
|
HorizontalAlignment="Center"
|
|
TextWrapping="Wrap"
|
|
Text="There were some errors while opening container."
|
|
Foreground="{DynamicResource ErrorBrush}" />
|
|
|
|
<ItemsRepeater Grid.Row="1" Items="{Binding AppState.SelectedTab.ChildContainer.Exceptions}">
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Margin="5,0,5,10" Text="{Binding, Converter={StaticResource ExceptionToStringConverter}}"/>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<Grid IsVisible="{Binding AppState.SelectedTab.ItemPreview, Converter={StaticResource IsNotNullConverter}}">
|
|
<TextBlock HorizontalAlignment="Center" Text="Don't know how to preview this item." IsVisible="{Binding AppState.SelectedTab.ItemPreview.Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.Unknown}}"/>
|
|
<TextBlock HorizontalAlignment="Center" Text="Empty" IsVisible="{Binding AppState.SelectedTab.ItemPreview.Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.Empty}}"/>
|
|
<ScrollViewer IsVisible="{Binding AppState.SelectedTab.ItemPreview.Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.Text}}">
|
|
<TextBox
|
|
IsReadOnly="True"
|
|
x:CompileBindings="False"
|
|
Text="{Binding AppState.SelectedTab.ItemPreview.TextContent}" />
|
|
</ScrollViewer>
|
|
<Grid
|
|
IsVisible="{Binding AppState.SelectedTab.ItemPreview.Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.SearchContainer}}"
|
|
ColumnDefinitions="Auto,*"
|
|
RowDefinitions="Auto,Auto">
|
|
<TextBlock Text="Name" Margin="0,0,10,20" VerticalAlignment="Top"/>
|
|
<ItemsControl Grid.Column="1" x:CompileBindings="False" Items="{Binding AppState.SelectedTab.ItemPreview.ItemNameParts}" VerticalAlignment="Top">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<TextBlock
|
|
Text="{Binding Text}"
|
|
TextDecorations="{Binding TextDecorations}"/>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<TextBlock Margin="0,0,10,0" Grid.Row="1" Text="Path"/>
|
|
<local:PathPresenter Grid.Column="1" Grid.Row="1" x:CompileBindings="False" DataContext="{Binding AppState.SelectedTab.ItemPreview.RealtiveParentPath,Converter={StaticResource PathPreformatter}}"/>
|
|
</Grid>
|
|
<Grid
|
|
IsVisible="{Binding AppState.SelectedTab.ItemPreview.Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.SearchElement}}"
|
|
ColumnDefinitions="Auto,*"
|
|
RowDefinitions="Auto,Auto">
|
|
<TextBlock Text="Name" Margin="0,0,10,20" VerticalAlignment="Top"/>
|
|
<ItemsControl Grid.Column="1" x:CompileBindings="False" Items="{Binding AppState.SelectedTab.ItemPreview.ItemNameParts}" Margin="0,0,0,20">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<TextBlock
|
|
Text="{Binding Text}"
|
|
TextDecorations="{Binding TextDecorations}"/>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<TextBlock Margin="0,0,10,0" Grid.Row="1" Text="Path"/>
|
|
<local:PathPresenter Grid.Column="1" Grid.Row="1" x:CompileBindings="False" DataContext="{Binding AppState.SelectedTab.ItemPreview.RealtiveParentPath,Converter={StaticResource PathPreformatter}}"/>
|
|
</Grid>
|
|
|
|
<Grid
|
|
DataContext="{Binding AppState.SelectedTab.ItemPreview}"
|
|
RowDefinitions="Auto, Auto"
|
|
x:Name="SizeContainerPreview"
|
|
IsVisible="{Binding Mode, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static models:ItemPreviewMode.SizeContainer}}">
|
|
<ItemsControl
|
|
Margin="0,0,0,30"
|
|
x:CompileBindings="False"
|
|
Items="{Binding TopItems^}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid>
|
|
<Grid.Width>
|
|
<MultiBinding Converter="{StaticResource ItemSizeToSizeConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding/>
|
|
<Binding ElementName="SizeContainerPreview" Path="DataContext.TopItems^"/>
|
|
<Binding ElementName="SizeContainerPreview" Path="Bounds.Width"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</Grid.Width>
|
|
|
|
<Rectangle HorizontalAlignment="Stretch">
|
|
<Rectangle.Fill>
|
|
<MultiBinding Converter="{StaticResource ItemSizeToBrushConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding/>
|
|
<Binding ElementName="SizeContainerPreview" Path="DataContext.Items^"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left">
|
|
<TextBlock Classes="SmallText" Margin="0,5,0,2" Text="{Binding Name}">
|
|
<TextBlock.Foreground>
|
|
<MultiBinding Converter="{StaticResource ItemSizeToForegroundBrushConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding/>
|
|
<Binding ElementName="SizeContainerPreview" Path="DataContext.Items^"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</TextBlock.Foreground>
|
|
</TextBlock>
|
|
<TextBlock Classes="SmallText" Margin="0,2,0,5" Text="{Binding Size,Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}">
|
|
<TextBlock.Foreground>
|
|
<MultiBinding Converter="{StaticResource ItemSizeToForegroundBrushConverter}">
|
|
<MultiBinding.Bindings>
|
|
<Binding/>
|
|
<Binding ElementName="SizeContainerPreview" Path="DataContext.Items^"/>
|
|
</MultiBinding.Bindings>
|
|
</MultiBinding>
|
|
</TextBlock.Foreground>
|
|
</TextBlock>
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<ItemsControl
|
|
Grid.Row="1"
|
|
x:CompileBindings="False"
|
|
Items="{Binding Items^}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid ColumnDefinitions="Auto,*" Margin="0,0,0,20">
|
|
<TextBlock Text="{Binding Name}"/>
|
|
<TextBlock Margin="0,0,20,0" HorizontalAlignment="Right" Grid.Column="1" Text="{Binding Size,Converter={StaticResource FormatSizeConverter}, ConverterParameter=0}"/>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
|
|
<ItemsRepeater Items="{Binding AppState.PopupTexts}" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Top" IsVisible="{Binding AppState.PopupTexts.Count,Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
|
|
<ItemsRepeater.Styles>
|
|
<Style Selector="TextBlock">
|
|
<Style.Animations>
|
|
<Animation Duration="0:0:1">
|
|
<KeyFrame Cue="0%">
|
|
<Setter Property="Opacity" Value="0.0"/>
|
|
</KeyFrame>
|
|
<KeyFrame Cue="100%">
|
|
<Setter Property="Opacity" Value="1.0"/>
|
|
</KeyFrame>
|
|
</Animation>
|
|
</Style.Animations>
|
|
</Style>
|
|
</ItemsRepeater.Styles>
|
|
<ItemsRepeater.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border Background="{DynamicResource ContainerGradientBackgroundBrush}" Margin="5" Padding="5">
|
|
<TextBlock Text="{Binding}" Foreground="{DynamicResource AccentComplementBrush}" HorizontalAlignment="Center"/>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsRepeater.ItemTemplate>
|
|
</ItemsRepeater>
|
|
</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.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 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>
|
|
<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>
|
|
|
|
<Border
|
|
Background="{DynamicResource BarelyTransparentBackgroundColor}"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
IsVisible="{Binding AppState.Inputs, Converter={StaticResource IsNotNullConverter}}">
|
|
<Border
|
|
Background="{DynamicResource ContainerBackgroundBrush}"
|
|
Padding="20"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<ItemsControl
|
|
x:Name="InputList"
|
|
Items="{Binding AppState.Inputs}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid MinWidth="500" ColumnDefinitions="250,*" Margin="10,5" x:Name="ItemRoot">
|
|
<TextBlock
|
|
HorizontalAlignment="Left"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding InputElement.Label}" />
|
|
<Grid Grid.Column="1">
|
|
<TextBox
|
|
IsVisible="{Binding InputElement.InputType, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static interactions:InputType.Text}}"
|
|
AttachedToVisualTree="InputText_AttachedToVisualTree"
|
|
GotFocus="InputText_GotFocus"
|
|
LostFocus="InputText_LostFocus"
|
|
KeyDown="InputText_KeyDown"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding Value, Mode=TwoWay}" />
|
|
<TextBox
|
|
IsVisible="{Binding InputElement.InputType, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static interactions:InputType.Password}}"
|
|
PasswordChar="{Binding PasswordChar}"
|
|
AttachedToVisualTree="InputText_AttachedToVisualTree"
|
|
GotFocus="InputText_GotFocus"
|
|
LostFocus="InputText_LostFocus"
|
|
KeyDown="InputText_KeyDown"
|
|
VerticalAlignment="Top"
|
|
Text="{Binding Value, Mode=TwoWay}" />
|
|
<ListBox
|
|
Classes="RadioButtonListBox"
|
|
IsVisible="{Binding InputElement.InputType, Converter={StaticResource EqualityConverter}, ConverterParameter={x:Static interactions:InputType.Options}}"
|
|
Items="{Binding InputElement.Options}"
|
|
SelectedItem="{Binding Option}"/>
|
|
</Grid>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Orientation="Horizontal"
|
|
Margin="0,10,0,0">
|
|
<Button
|
|
HorizontalContentAlignment="Center"
|
|
Width="80"
|
|
Command="{Binding ProcessInputsCommand}"
|
|
Content="Ok" />
|
|
<Button
|
|
HorizontalContentAlignment="Center"
|
|
Width="80"
|
|
Margin="10,0,0,0"
|
|
Command="{Binding CancelInputsCommand}"
|
|
Content="Cancel" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
|
|
<Border
|
|
Background="{DynamicResource BarelyTransparentBackgroundColor}"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
IsVisible="{Binding AppState.MessageBoxText, Converter={StaticResource IsNotNullConverter}}">
|
|
<Border
|
|
Background="{DynamicResource ContainerBackgroundBrush}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Padding="20">
|
|
<Grid RowDefinitions="Auto,Auto">
|
|
|
|
<TextBlock Text="{Binding AppState.MessageBoxText}"/>
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
Orientation="Horizontal"
|
|
Margin="0,10,0,0">
|
|
<Button
|
|
HorizontalContentAlignment="Center"
|
|
Width="80"
|
|
Command="{Binding ProcessMessageBoxCommand}"
|
|
Content="Yes" />
|
|
<Button
|
|
HorizontalContentAlignment="Center"
|
|
Width="80"
|
|
Margin="10,0,0,0"
|
|
Command="{Binding CancelMessageBoxCommand}"
|
|
Content="No" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
|
|
<Border
|
|
Background="{DynamicResource TransparentContainerBackgroundBrush}"
|
|
Margin="20"
|
|
HorizontalAlignment="Center"
|
|
IsVisible="{Binding AppState.IsAllShortcutVisible}">
|
|
<Grid RowDefinitions="Auto, *" Margin="30,10">
|
|
<TextBlock Text="Shortcuts" Margin="0,0,0,20"/>
|
|
<ScrollViewer
|
|
Grid.Row="1"
|
|
HorizontalScrollBarVisibility="Disabled">
|
|
<ItemsControl
|
|
Items="{Binding KeyboardConfigurationService.AllShortcut}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Margin="0,5,10,5">
|
|
<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>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<Grid IsVisible="{Binding Loading}">
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
<Image Source="/Assets/filetime.ico" Width="128" Height="128"/>
|
|
<TextBlock Text="Loading..." HorizontalAlignment="Center" Margin="50"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|