-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUndoOperationMenuView.xaml
69 lines (63 loc) · 3.33 KB
/
UndoOperationMenuView.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<UserControl x:Class="MO2ExportImport.Views.UndoOperationMenuView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MO2ExportImport"
xmlns:behaviors="clr-namespace:MO2ExportImport.Behaviors"
mc:Ignorable="d"
Loaded="UserControl_Loaded"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<!-- List of Import Operations -->
<ListBox ItemsSource="{Binding ImportOperations}" ScrollViewer.VerticalScrollBarVisibility="Auto"
Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"
SelectedItem="{Binding SelectedOperation}"
HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Black" BorderThickness="1" CornerRadius="5">
<Grid Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Display the DateTime of the ImportOperation -->
<TextBlock Text="{Binding ImportTime, StringFormat='yyyy MM dd (HH:mm)'}" VerticalAlignment="Center" />
<!-- Red "x" Button to delete the entry -->
<Button Content="X"
Foreground="Red"
Background="Transparent"
BorderBrush="Transparent"
FontWeight="Bold"
Command="{Binding DataContext.DeleteOperationCommand, RelativeSource={RelativeSource AncestorType=ListBox}}"
CommandParameter="{Binding}"
Grid.Column="1"
VerticalAlignment="Center"
Margin="5,0,0,0" />
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!-- List of Mods Added in Selected Operation -->
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding CurrentOperationInfo}"/>
<ListBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding AddedModNames}"
SelectionMode="Extended"
behaviors:ListBoxBehaviors.BindableSelectedItems="{Binding SelectedMods}">
</ListBox>
<!-- Undo Button -->
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Content="Undo" HorizontalAlignment="Center"
Command="{Binding UndoCommand}" Margin="10"
IsEnabled="{Binding IsUndoEnabled}"/>
</Grid>
</UserControl>