Help, key bindings

This commit is contained in:
2022-02-02 21:50:10 +01:00
parent f40c84a123
commit ee0c6f7a0b
5 changed files with 520 additions and 427 deletions

View File

@@ -59,6 +59,24 @@ namespace FileTime.App.Core.Tab
} }
} }
public async Task ClearMarkedItems(IContainer container)
{
if (_markedItems.ContainsKey(container))
{
var markedItems = _markedItems[container];
for (var i = 0; i < markedItems.Count; i++)
{
await ItemUnmarked.InvokeAsync(this, markedItems[i]);
markedItems.RemoveAt(i--);
}
}
}
public async Task ClearCurrentMarkedItems()
{
await ClearMarkedItems(await Tab.GetCurrentLocation());
}
public bool ContainsMarkedItem(IContainer container, AbsolutePath path) public bool ContainsMarkedItem(IContainer container, AbsolutePath path)
{ {
if (!_markedItems.ContainsKey(container)) return false; if (!_markedItems.ContainsKey(container)) return false;

View File

@@ -11,6 +11,7 @@
<ResourceDictionary> <ResourceDictionary>
<Color x:Key="AppBackgroundColor">#073642</Color> <Color x:Key="AppBackgroundColor">#073642</Color>
<Color x:Key="ContainerBackgroundColor">#083e4c</Color> <Color x:Key="ContainerBackgroundColor">#083e4c</Color>
<Color x:Key="TransparentContainerBackgroundColor">#D0083e4c</Color>
<Color x:Key="ItemBackgroundColor">#00000000</Color> <Color x:Key="ItemBackgroundColor">#00000000</Color>
<Color x:Key="AlternativeItemBackgroundColor">#10000000</Color> <Color x:Key="AlternativeItemBackgroundColor">#10000000</Color>
@@ -44,6 +45,9 @@
<SolidColorBrush <SolidColorBrush
x:Key="ContainerBackgroundBrush" x:Key="ContainerBackgroundBrush"
Color="{DynamicResource ContainerBackgroundColor}" /> Color="{DynamicResource ContainerBackgroundColor}" />
<SolidColorBrush
x:Key="TransparentContainerBackgroundBrush"
Color="{DynamicResource TransparentContainerBackgroundColor}" />
<SolidColorBrush <SolidColorBrush
x:Key="ItemBackgroundBrush" x:Key="ItemBackgroundBrush"

View File

@@ -54,7 +54,7 @@ namespace FileTime.Avalonia.Command
bool ctrlOrAlt = (key.Ctrl ?? false) || (key.Alt ?? false); bool ctrlOrAlt = (key.Ctrl ?? false) || (key.Alt ?? false);
if (ctrlOrAlt && currentText.Last() != ' ') s += " "; if (ctrlOrAlt && currentText.Length > 0 && currentText.Last() != ' ') s += " ";
if (key.Ctrl ?? false) s += "CTRL+"; if (key.Ctrl ?? false) s += "CTRL+";
if (key.Alt ?? false) s += "ALT+"; if (key.Alt ?? false) s += "ALT+";
@@ -69,7 +69,7 @@ namespace FileTime.Avalonia.Command
{ {
var s = ""; var s = "";
if (currentText.Last() != ' ' && !wasCtrlOrAlt) s += " "; if (currentText.Length > 0 && currentText.Last() != ' ' && !wasCtrlOrAlt) s += " ";
s += key.Key.ToString(); s += key.Key.ToString();
if (!wasCtrlOrAlt) s += " "; if (!wasCtrlOrAlt) s += " ";

View File

@@ -73,6 +73,12 @@ namespace FileTime.Avalonia.ViewModels
[Property] [Property]
private ObservableCollection<string> _popupTexts = new ObservableCollection<string>(); private ObservableCollection<string> _popupTexts = new ObservableCollection<string>();
[Property]
private bool _showAllShortcut;
[Property]
private List<CommandBinding> _allShortcut;
public ObservableCollection<ParallelCommandsViewModel> TimelineCommands { get; } = new(); public ObservableCollection<ParallelCommandsViewModel> TimelineCommands { get; } = new();
async partial void OnInitialize() async partial void OnInitialize()
@@ -95,6 +101,8 @@ namespace FileTime.Avalonia.ViewModels
_keysToSkip.Add(new KeyWithModifiers[] { new KeyWithModifiers(Key.PageUp) }); _keysToSkip.Add(new KeyWithModifiers[] { new KeyWithModifiers(Key.PageUp) });
_keysToSkip.Add(new KeyWithModifiers[] { new KeyWithModifiers(Key.F4, alt: true) }); _keysToSkip.Add(new KeyWithModifiers[] { new KeyWithModifiers(Key.F4, alt: true) });
AllShortcut = _commandBindings.Concat(_universalCommandBindings).ToList();
var tab = new Tab(); var tab = new Tab();
await tab.Init(LocalContentProvider); await tab.Init(LocalContentProvider);
@@ -428,6 +436,7 @@ namespace FileTime.Avalonia.ViewModels
{ {
_clipboard.AddContent(selectedItem); _clipboard.AddContent(selectedItem);
} }
await AppState.SelectedTab.TabState.ClearCurrentMarkedItems();
} }
else else
{ {
@@ -647,6 +656,12 @@ namespace FileTime.Avalonia.ViewModels
return Task.CompletedTask; return Task.CompletedTask;
} }
private Task ShowAllShortcut2()
{
ShowAllShortcut = true;
return Task.CompletedTask;
}
[Command] [Command]
public async void ProcessInputs() public async void ProcessInputs()
{ {
@@ -707,6 +722,7 @@ namespace FileTime.Avalonia.ViewModels
if (key == Key.Escape) if (key == Key.Escape)
{ {
ShowAllShortcut = false;
_previousKeys.Clear(); _previousKeys.Clear();
PossibleCommands = new(); PossibleCommands = new();
} }
@@ -750,7 +766,14 @@ namespace FileTime.Avalonia.ViewModels
if (key == Key.Escape) if (key == Key.Escape)
{ {
await ExitRapidTravelMode(); if (ShowAllShortcut)
{
ShowAllShortcut = false;
}
else
{
await ExitRapidTravelMode();
}
} }
else if (key == Key.Back) else if (key == Key.Back)
{ {
@@ -888,6 +911,11 @@ namespace FileTime.Avalonia.ViewModels
FileTime.App.Core.Command.Commands.CreateContainer, FileTime.App.Core.Command.Commands.CreateContainer,
new KeyWithModifiers[]{new KeyWithModifiers(Key.C),new KeyWithModifiers(Key.C)}, new KeyWithModifiers[]{new KeyWithModifiers(Key.C),new KeyWithModifiers(Key.C)},
CreateContainer), CreateContainer),
new CommandBinding(
"create container",
FileTime.App.Core.Command.Commands.CreateContainer,
new KeyWithModifiers[]{new KeyWithModifiers(Key.F7)},
CreateContainer),
new CommandBinding( new CommandBinding(
"create element", "create element",
FileTime.App.Core.Command.Commands.CreateElement, FileTime.App.Core.Command.Commands.CreateElement,
@@ -1008,6 +1036,11 @@ namespace FileTime.Avalonia.ViewModels
FileTime.App.Core.Command.Commands.Rename, FileTime.App.Core.Command.Commands.Rename,
new KeyWithModifiers[]{new KeyWithModifiers(Key.C),new KeyWithModifiers(Key.W)}, new KeyWithModifiers[]{new KeyWithModifiers(Key.C),new KeyWithModifiers(Key.W)},
Rename), Rename),
new CommandBinding(
"rename",
FileTime.App.Core.Command.Commands.Rename,
new KeyWithModifiers[]{new KeyWithModifiers(Key.F2)},
Rename),
new CommandBinding( new CommandBinding(
"timeline pause", "timeline pause",
FileTime.App.Core.Command.Commands.Dummy, FileTime.App.Core.Command.Commands.Dummy,
@@ -1028,16 +1061,26 @@ namespace FileTime.Avalonia.ViewModels
FileTime.App.Core.Command.Commands.Refresh, FileTime.App.Core.Command.Commands.Refresh,
new KeyWithModifiers[]{new KeyWithModifiers(Key.R)}, new KeyWithModifiers[]{new KeyWithModifiers(Key.R)},
RefreshCurrentLocation), RefreshCurrentLocation),
new CommandBinding(
"refresh",
FileTime.App.Core.Command.Commands.Refresh,
new KeyWithModifiers[]{new KeyWithModifiers(Key.F5)},
RefreshCurrentLocation),
new CommandBinding( new CommandBinding(
"go to", "go to",
FileTime.App.Core.Command.Commands.Dummy, FileTime.App.Core.Command.Commands.Dummy,
new KeyWithModifiers[]{new KeyWithModifiers(Key.L, ctrl: true)}, new KeyWithModifiers[] { new KeyWithModifiers(Key.L, ctrl: true) },
GoToContainer), GoToContainer),
new CommandBinding( new CommandBinding(
"toggle advanced icons", "toggle advanced icons",
FileTime.App.Core.Command.Commands.Dummy, FileTime.App.Core.Command.Commands.Dummy,
new KeyWithModifiers[]{new KeyWithModifiers(Key.Z),new KeyWithModifiers(Key.I)}, new KeyWithModifiers[] { new KeyWithModifiers(Key.Z), new KeyWithModifiers(Key.I) },
ToggleAdvancedIcons), ToggleAdvancedIcons),
new CommandBinding(
"show all shortcut",
FileTime.App.Core.Command.Commands.Dummy,
new KeyWithModifiers[] { new KeyWithModifiers(Key.F1) },
ShowAllShortcut2),
}; };
var universalCommandBindings = new List<CommandBinding>() var universalCommandBindings = new List<CommandBinding>()
{ {

View File

@@ -18,464 +18,492 @@
x:Name="RootContainer" x:Name="RootContainer"
Background="{DynamicResource AppBackgroundBrush}"> Background="{DynamicResource AppBackgroundBrush}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.ColumnDefinitions>
<RowDefinition Height="Auto" /> <ColumnDefinition Width="250" />
<RowDefinition Height="Auto" /> <ColumnDefinition Width="*" />
</Grid.RowDefinitions> </Grid.ColumnDefinitions>
<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 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}" />
<StackPanel
Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
Text="{Binding FullName}" />
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
Classes="SmallText"
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
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="2"
Maximum="100"
Value="{Binding UsedPercentage}" />
</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="PlacesItem" PointerPressed="OnPlacePointerPressed" 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="2" RowDefinitions="Auto,40,*,Auto">
<Grid> <Grid>
<ItemsControl Items="{Binding TimelineCommands}"> <Grid.RowDefinitions>
<ItemsControl.ItemsPanel> <RowDefinition Height="Auto" />
<ItemsPanelTemplate> <RowDefinition Height="Auto" />
<StackPanel Orientation="Horizontal" /> </Grid.RowDefinitions>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="{DynamicResource ContainerBackgroundColor}" Padding="5">
<ItemsControl Items="{Binding ParallelCommands}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}"/>
<ProgressBar Margin="0,5,0,0" Maximum="100" Value="{Binding Progress}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<Grid Grid.Row="1" ColumnDefinitions="*,Auto"> <Border CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="10" Margin="10">
<Grid RowDefinitions="Auto,Auto">
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="10,5"
Text="{Binding AppState.SelectedTab.TabNumber,StringFormat=({0})}" />
<local:PathPresenter Margin="10,5,0,5" DataContext="{Binding AppState.SelectedTab.CurrentLocation.Container.FullName}"/>
<TextBlock
Margin="0,5,10,5"
Text="{Binding AppState.SelectedTab.SelectedItem.Item.Name}" Foreground="{StaticResource AccentForegroundBrush}" />
</StackPanel>
<ItemsControl
Grid.Column="1"
HorizontalAlignment="Right"
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})}" />
<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
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
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">
<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">
<ListBox.ItemTemplate>
<DataTemplate>
<local:ItemView/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock <TextBlock
x:Name="CurrentEmpty" Margin="0,0,0,10"
Margin="10" Text="Drives" />
HorizontalAlignment="Center"
FontWeight="Bold"
Foreground="{DynamicResource ErrorBrush}"
IsVisible="{Binding AppState.SelectedTab.CurrentLocation.Items.Count, Converter={StaticResource EqualityConverter}, ConverterParameter=0}">
Empty
</TextBlock>
</Grid>
<Rectangle <ItemsRepeater
Grid.Column="3" Grid.Row="1"
Width="1" Items="{Binding RootDriveInfos}">
Margin="0,10,0,10" <ItemsRepeater.ItemTemplate>
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Fill="{DynamicResource ContentSeparatorBrush}" />
<Grid Grid.Column="4" IsVisible="{Binding AppState.SelectedTab.ChildContainer,Converter={StaticResource IsNotNullConverter}}">
<ListBox
Classes="ContentListView"
IsEnabled="False"
x:Name="ChildItems"
Items="{Binding AppState.SelectedTab.ChildContainer.Items}"
IsVisible="{Binding AppState.SelectedTab.ChildContainer.Items.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
<ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<local:ItemView/> <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}" />
<StackPanel
Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
Text="{Binding FullName}" />
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
Classes="SmallText"
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
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="2"
Maximum="100"
Value="{Binding UsedPercentage}" />
</Grid>
</DataTemplate> </DataTemplate>
</ListBox.ItemTemplate> </ItemsRepeater.ItemTemplate>
</ListBox> </ItemsRepeater>
<Grid
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 Text="{Binding, Converter={StaticResource ExceptionToStringConverter}}"/>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Grid>
</Grid>
</Grid> </Grid>
</Grid> </Border>
<Grid <Border Grid.Row="1" CornerRadius="10" Background="{DynamicResource ContainerBackgroundBrush}" Padding="0,10" Margin="10">
HorizontalAlignment="Center" <Grid RowDefinitions="Auto,Auto">
VerticalAlignment="Center"
IsVisible="{Binding Inputs, Converter={StaticResource IsNotNullConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ItemsControl <TextBlock
x:Name="InputList" Margin="10,0,10,10"
Items="{Binding Inputs}"> Text="Places" />
<ItemsRepeater
Grid.Row="1"
Items="{Binding Places}">
<ItemsRepeater.ItemTemplate>
<DataTemplate>
<Grid Classes="PlacesItem" PointerPressed="OnPlacePointerPressed" 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="2" RowDefinitions="Auto,40,*,Auto">
<Grid>
<ItemsControl Items="{Binding TimelineCommands}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid MinWidth="400"> <Border Background="{DynamicResource ContainerBackgroundColor}" Padding="5">
<Grid.ColumnDefinitions> <ItemsControl Items="{Binding ParallelCommands}">
<ColumnDefinition MinWidth="200" /> <ItemsControl.ItemTemplate>
<ColumnDefinition Width="*" /> <DataTemplate>
</Grid.ColumnDefinitions> <StackPanel>
<TextBlock Text="{Binding Name}"/>
<ProgressBar Margin="0,5,0,0" Maximum="100" Value="{Binding Progress}"/>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<TextBlock <Grid Grid.Row="1" ColumnDefinitions="*,Auto">
HorizontalAlignment="Left"
VerticalAlignment="Center" <StackPanel Orientation="Horizontal">
Text="{Binding InputElement.Text}" /> <TextBlock
<TextBox Margin="10,5"
AttachedToVisualTree="InputText_AttachedToVisualTree" Text="{Binding AppState.SelectedTab.TabNumber,StringFormat=({0})}" />
Grid.Column="1"
GotFocus="InputText_GotFocus" <local:PathPresenter Margin="10,5,0,5" DataContext="{Binding AppState.SelectedTab.CurrentLocation.Container.FullName}"/>
LostFocus="InputText_LostFocus"
KeyDown="InputText_KeyDown" <TextBlock
Text="{Binding Value, Mode=TwoWay}" /> Margin="0,5,10,5"
Text="{Binding AppState.SelectedTab.SelectedItem.Item.Name}" Foreground="{StaticResource AccentForegroundBrush}" />
</StackPanel>
<ItemsControl
Grid.Column="1"
HorizontalAlignment="Right"
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})}" />
<local:PathPresenter Margin="5,0,0,0" DataContext="{Binding CurrentLocation.Container.FullName}"/>
</StackPanel>
<Rectangle Fill="{DynamicResource ForegroundBrush}" Grid.Row="1" IsVisible="{Binding IsSelected}"/>
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
<StackPanel
Grid.Row="1"
Orientation="Horizontal">
<Button
Command="{Binding ProcessInputsCommand}"
Content="Ok" />
<Button
Command="{Binding CancelInputsCommand}"
Content="Cancel" />
</StackPanel>
</Grid> </Grid>
<Grid <Grid
HorizontalAlignment="Center" Grid.Row="2"
VerticalAlignment="Center" Margin="20,0,0,0">
IsVisible="{Binding MessageBoxText, Converter={StaticResource IsNotNullConverter}}"> <Grid>
<Grid.RowDefinitions> <Grid.ColumnDefinitions>
<RowDefinition Height="Auto" /> <ColumnDefinition Width="15*" />
<RowDefinition Height="Auto" /> <ColumnDefinition Width="10" />
</Grid.RowDefinitions> <ColumnDefinition Width="40*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="45*" />
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding MessageBoxText}"/> <Grid>
<StackPanel <ListBox
Grid.Row="1" Classes="ContentListView"
Orientation="Horizontal"> IsEnabled="False"
<Button Items="{Binding AppState.SelectedTab.Parent.Items}">
Command="{Binding ProcessMessageBoxCommand}" <ListBox.ItemTemplate>
Content="Yes" /> <DataTemplate>
<Button <local:ItemView ShowAttributes="False"/>
Command="{Binding CancelMessageBoxCommand}" </DataTemplate>
Content="No" /> </ListBox.ItemTemplate>
</StackPanel> </ListBox>
</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">
<ListBox.ItemTemplate>
<DataTemplate>
<local:ItemView/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<TextBlock
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" IsVisible="{Binding AppState.SelectedTab.ChildContainer,Converter={StaticResource IsNotNullConverter}}">
<ListBox
Classes="ContentListView"
IsEnabled="False"
x:Name="ChildItems"
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
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 Text="{Binding, Converter={StaticResource ExceptionToStringConverter}}"/>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsVisible="{Binding Inputs, Converter={StaticResource IsNotNullConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ItemsControl
x:Name="InputList"
Items="{Binding Inputs}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid MinWidth="400">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding InputElement.Text}" />
<TextBox
AttachedToVisualTree="InputText_AttachedToVisualTree"
Grid.Column="1"
GotFocus="InputText_GotFocus"
LostFocus="InputText_LostFocus"
KeyDown="InputText_KeyDown"
Text="{Binding Value, Mode=TwoWay}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel
Grid.Row="1"
Orientation="Horizontal">
<Button
Command="{Binding ProcessInputsCommand}"
Content="Ok" />
<Button
Command="{Binding CancelInputsCommand}"
Content="Cancel" />
</StackPanel>
</Grid>
<Grid
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsVisible="{Binding MessageBoxText, Converter={StaticResource IsNotNullConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding MessageBoxText}"/>
<StackPanel
Grid.Row="1"
Orientation="Horizontal">
<Button
Command="{Binding ProcessMessageBoxCommand}"
Content="Yes" />
<Button
Command="{Binding CancelMessageBoxCommand}"
Content="No" />
</StackPanel>
</Grid>
<ItemsRepeater Items="{Binding PopupTexts}" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom" IsVisible="{Binding 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>
<TextBlock Text="{Binding}" HorizontalAlignment="Center"/>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Grid> </Grid>
<ItemsRepeater Items="{Binding PopupTexts}" Margin="0,0,0,20" HorizontalAlignment="Center" VerticalAlignment="Bottom" IsVisible="{Binding PopupTexts.Count,Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}"> <Grid Grid.Row="3">
<ItemsRepeater.Styles> <Grid IsVisible="{Binding AppState.ViewMode, Converter={StaticResource EqualityConverter}, ConverterParameter=RapidTravel}">
<Style Selector="TextBlock"> <Grid.RowDefinitions>
<Style.Animations> <RowDefinition Height="1" />
<Animation Duration="0:0:1"> <RowDefinition Height="Auto" />
<KeyFrame Cue="0%"> </Grid.RowDefinitions>
<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>
<TextBlock Text="{Binding}" HorizontalAlignment="Center"/>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Grid>
<Grid Grid.Row="3"> <Rectangle
<Grid IsVisible="{Binding AppState.ViewMode, Converter={StaticResource EqualityConverter}, ConverterParameter=RapidTravel}"> Height="1"
<Grid.RowDefinitions> Margin="10,0"
<RowDefinition Height="1" /> HorizontalAlignment="Stretch"
<RowDefinition Height="Auto" /> VerticalAlignment="Center"
</Grid.RowDefinitions> Fill="{DynamicResource ContentSeparatorBrush}" />
<Rectangle <StackPanel
Height="1" Grid.Row="1"
Margin="10,0" Margin="30,10,10,10"
HorizontalAlignment="Stretch" Orientation="Horizontal">
VerticalAlignment="Center"
Fill="{DynamicResource ContentSeparatorBrush}" />
<StackPanel <TextBlock
Grid.Row="1" Margin="0,0,30,0"
Margin="30,10,10,10" Text="Rapid travel mode" />
Orientation="Horizontal">
<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 <TextBlock
Margin="0,0,30,0" Grid.Row="1"
Text="Rapid travel mode" /> Margin="10"
HorizontalAlignment="Center"
Foreground="{DynamicResource ErrorBrush}"
Text="No command found" />
</Grid>
<TextBlock Text="Filter " /> <Grid IsVisible="{Binding PossibleCommands.Count, Converter={StaticResource NotEqualsConverter}, ConverterParameter=0}">
<Grid.RowDefinitions>
<RowDefinition Height="1" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{Binding AppState.RapidTravelText}" /> <Rectangle
</StackPanel> Height="1"
Margin="10,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Fill="{DynamicResource ContentSeparatorBrush}" />
<ItemsRepeater
Grid.Row="1"
Items="{Binding PossibleCommands}">
<ItemsRepeater.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>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</Grid>
</Grid> </Grid>
</Grid>
</Grid>
<Grid IsVisible="{Binding NoCommandFound}"> <Border Background="{DynamicResource TransparentContainerBackgroundBrush}" Margin="20" HorizontalAlignment="Center" IsVisible="{Binding ShowAllShortcut}">
<Grid.RowDefinitions> <Grid RowDefinitions="Auto, *" Margin="30,10">
<RowDefinition Height="1" /> <TextBlock Text="Shortcuts" Margin="0,0,0,20"/>
<RowDefinition Height="Auto" /> <ScrollViewer
</Grid.RowDefinitions> Grid.Row="1"
HorizontalScrollBarVisibility="Disabled">
<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 <ItemsControl
Grid.Row="1" Items="{Binding AllShortcut}">
Items="{Binding PossibleCommands}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid> <Grid Margin="0,5,10,5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="200" /> <ColumnDefinition Width="200" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
@@ -487,8 +515,8 @@
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
</Grid> </ScrollViewer>
</Grid> </Grid>
</Grid> </Border>
</Grid> </Grid>
</Window> </Window>