|
| 1 | +<Window x:Class="Loki.Backups" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 6 | + xmlns:loki="clr-namespace:Loki" |
| 7 | + mc:Ignorable="d" |
| 8 | + WindowStyle="SingleBorderWindow" |
| 9 | + ResizeMode="NoResize" |
| 10 | + WindowStartupLocation="CenterOwner" |
| 11 | + Title="Restore from a backup" Height="520" Width="500" |
| 12 | + Loaded="Backups_OnLoaded"> |
| 13 | + |
| 14 | + <Window.CommandBindings> |
| 15 | + <CommandBinding Command="{x:Static loki:Commands.RestoreCharacter}" CanExecute="RestoreCanExecute" Executed="RestoreExecuted"></CommandBinding> |
| 16 | + <CommandBinding Command="Close" Executed="CloseExecuted"></CommandBinding> |
| 17 | + </Window.CommandBindings> |
| 18 | + <Window.Resources> |
| 19 | + <loki:BoolToVisibilityConverter x:Key="InvBoolToVis" False="Visible" True="Collapsed"/> |
| 20 | + <Style TargetType="Button"> |
| 21 | + <Setter Property="Width" Value="112"/> |
| 22 | + <Setter Property="Height" Value="28"/> |
| 23 | + <Setter Property="Margin" Value="4"/> |
| 24 | + </Style> |
| 25 | + </Window.Resources> |
| 26 | + <DockPanel> |
| 27 | + |
| 28 | + <!-- Bit at the bottom with buttons on --> |
| 29 | + <Border Background="{x:Static SystemColors.ControlDarkBrush}" |
| 30 | + DockPanel.Dock="Bottom"> |
| 31 | + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> |
| 32 | + <CheckBox IsChecked="True" x:Name="BackupCheckbox" VerticalAlignment="Center" |
| 33 | + ToolTip="Creates a new backup of the current character file before doing the restore operation."> |
| 34 | + Create new backup before restore |
| 35 | + </CheckBox> |
| 36 | + <Button Command="{x:Static loki:Commands.RestoreCharacter}" |
| 37 | + ToolTip="Restore from the selected backup"> |
| 38 | + Restore Selected |
| 39 | + </Button> |
| 40 | + <Button Command="Close" ToolTip="Cancel backup and return to main window"> |
| 41 | + Cancel |
| 42 | + </Button> |
| 43 | + </StackPanel> |
| 44 | + |
| 45 | + </Border> |
| 46 | + |
| 47 | + <!-- Warning for doing a naked backup --> |
| 48 | + <Border DockPanel.Dock="Bottom" Background="DarkRed" |
| 49 | + Visibility="{Binding ElementName=BackupCheckbox, Path=IsChecked, Converter={StaticResource InvBoolToVis}}"> |
| 50 | + <Label Foreground="WhiteSmoke" HorizontalAlignment="Center">Restoring will permanently overwrite current character data</Label> |
| 51 | + </Border> |
| 52 | + <!-- Main area above the buttons --> |
| 53 | + <Grid> |
| 54 | + |
| 55 | + <!-- List of Backups to select --> |
| 56 | + <ListView x:Name="BackupFileList" HorizontalContentAlignment="Stretch"> |
| 57 | + <ListView.ItemTemplate> |
| 58 | + <DataTemplate DataType="loki:BackupFileInfo"> |
| 59 | + <DockPanel Margin="2"> |
| 60 | + <Border DockPanel.Dock="Right" Background="{x:Static SystemColors.ControlLightBrush}" CornerRadius="4" Padding="2"> |
| 61 | + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" UseLayoutRounding="True"> |
| 62 | + <Image Source="Resources/calander-16.ico" Margin="8,2"/> |
| 63 | + <TextBlock Text="{Binding BackupDate}" Width="80" Margin="2"/> |
| 64 | + <Image Source="Resources/clock-16.ico" Margin="8,2"/> |
| 65 | + <TextBlock Text="{Binding BackupTimeOfDay}" Margin="2"/> |
| 66 | + </StackPanel> |
| 67 | + |
| 68 | + </Border> |
| 69 | + <TextBlock VerticalAlignment="Center" Text="{Binding Name}"/> |
| 70 | + </DockPanel> |
| 71 | + </DataTemplate> |
| 72 | + </ListView.ItemTemplate> |
| 73 | + </ListView> |
| 74 | + |
| 75 | + <!-- Loading Indicator --> |
| 76 | + <Label |
| 77 | + x:Name="StatusIndicator" |
| 78 | + Foreground="#2B2B2B" VerticalAlignment="Center" HorizontalAlignment="Center" |
| 79 | + FontSize="24">Loading</Label> |
| 80 | + |
| 81 | + </Grid> |
| 82 | + </DockPanel> |
| 83 | +</Window> |
0 commit comments