-
Notifications
You must be signed in to change notification settings - Fork 29
/
TaskPane.xaml
150 lines (149 loc) · 12.6 KB
/
TaskPane.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<UserControl x:Class="ME3Explorer.TaskPane"
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:ME3Explorer"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="650">
<UserControl.Resources>
<local:GameToIconConverter x:Key="gameToIconConverter"/>
<local:PathToFilenameConverter x:Key="pathToFilenameConverter"/>
<local:PathToLocationConverter x:Key="pathToLocationConverter"/>
<local:FileSizeToStringConverter x:Key="fileSizeToStringConverter"/>
<local:CountToStringConverter x:Key="countToStringConverter"/>
<local:RelativeDateTimeConverter x:Key="relativeDateTimeConverter"/>
<local:PeriodicUpdater Interval="60.0" x:Key="updater"/>
</UserControl.Resources>
<Grid x:Name="rootGrid" Width="650">
<Grid Width="650">
<Grid Margin="15,24">
<ScrollViewer x:Name="topScrollViewer" Foreground="{x:Null}" VerticalScrollBarVisibility="Hidden">
<ItemsControl x:Name="fileList">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate >
<StackPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid MinHeight="175" Margin="0,0,0,12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="416"/>
<ColumnDefinition Width="204"/>
</Grid.ColumnDefinitions>
<StackPanel Background="#7210192A">
<Grid Margin="7,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="16"/>
</Grid.ColumnDefinitions>
<Viewbox StretchDirection="DownOnly" HorizontalAlignment="Left" Width="375">
<TextBlock Text="{Binding FilePath, Converter={StaticResource pathToFilenameConverter}, Mode=OneWay}" FontSize="19"
FontFamily="{StaticResource TitilliumWeb-Regular}" Foreground="#FFFDFDFD"/>
</Viewbox>
<Image Grid.Column="1" Width="16" Height="16"
Source="{Binding Game, Converter={StaticResource gameToIconConverter}, Mode=OneWay}"/>
</Grid>
<Rectangle Fill="#A3FBFBFB" Height="2" Margin="7,0"/>
<ItemsControl x:Name="ToolList" ItemsSource="{Binding Tools, Mode=OneWay}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate >
<WrapPanel Margin="8,10,0,8"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Button Padding="0" Style="{StaticResource BorderlessButton}" Margin="0,5,0,0"
Click="Button_Click" MouseEnter="Button_MouseEnter" Width="204"
MouseRightButtonDown="Button_MouseRightButtonDown">
<StackPanel Orientation="Horizontal" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=Button}}">
<Image x:Name="toolIcon" Width="32" Height="32" Source="{Binding tool.icon}" Opacity="0.85">
</Image>
<StackPanel Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left">
<Viewbox StretchDirection="DownOnly" Width="162" HorizontalAlignment="Left">
<TextBlock x:Name="toolName" Style="{StaticResource styleFavoritable}" Text="{Binding tool.name}"
FontFamily="{StaticResource TitilliumWeb-Light}" FontSize="18"/>
</Viewbox>
<Rectangle x:Name="highlightUnderline" Height="3" Width="{Binding ActualWidth, ElementName=toolName}"
Fill="{StaticResource HighlightColor}" Visibility="Hidden" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</Button>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<Grid Grid.Column="1" Background="#6601050D">
<StackPanel Margin="14,17">
<TextBlock Text="Location:" FontFamily="{StaticResource TitilliumWeb-SemiBold}" FontSize="19" Foreground="#FFFDFDFD" VerticalAlignment="Center" Margin="0,-10,0,0"/>
<TextBlock Text="{Binding FilePath, Converter={StaticResource pathToLocationConverter}, Mode=OneWay}" Foreground="#FFF9F9F9"
FontSize="16" FontFamily="{StaticResource TitilliumWeb-Light}" Margin="0,-5,0,0"/>
<TextBlock FontFamily="{StaticResource TitilliumWeb-SemiBold}" FontSize="15" Foreground="#FFFDFDFD" Margin="10,0,0,0">
Open In: <Run Text="{Binding Tools.Count, Mode=OneWay, Converter={StaticResource countToStringConverter}, ConverterParameter=tool}"
Foreground="#CCF9F9F9" FontFamily="{StaticResource TitilliumWeb-Light}"/>
</TextBlock>
<TextBlock FontFamily="{StaticResource TitilliumWeb-SemiBold}" FontSize="15" Foreground="#FFFDFDFD" Margin="10,0,0,0">
Last Saved: <Run Foreground="#FFF9F9F9" FontFamily="{StaticResource TitilliumWeb-Light}">
<Run.Text>
<MultiBinding Converter="{StaticResource relativeDateTimeConverter}">
<Binding Path="LastSaved" Mode="OneWay"/>
<Binding Source="{StaticResource updater}" Path="Now" Mode="OneWay"/>
</MultiBinding>
</Run.Text>
</Run>
</TextBlock>
<TextBlock FontFamily="{StaticResource TitilliumWeb-SemiBold}" FontSize="15" Foreground="#FFFDFDFD" Margin="10,0,0,0">
File Size: <Run Text="{Binding FileSize, Mode=OneWay, Converter={StaticResource fileSizeToStringConverter}}"
Foreground="#FFF9F9F9" FontFamily="{StaticResource TitilliumWeb-Light}"/>
</TextBlock>
<Button Click="saveButton_Click" HorizontalAlignment="Center" HorizontalContentAlignment="Stretch" Padding="0">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource BorderedButton}">
<Setter Property="BorderBrush" Value="{x:Null}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#FF5692A2"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel Orientation="Horizontal" Height="32">
<Grid Width="32" Height="32" Background="#7FCFCFCF">
<Rectangle Width="24" Height="24"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle.Style>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="White"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsModified, Mode=OneWay}" Value="True">
<Setter Property="Fill" Value="#FFF05757"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/ME3Explorer;component/Resources/diskette_white.ico"/>
</Rectangle.OpacityMask>
</Rectangle>
</Grid>
<Grid Width="116" Height="32" Background="#7F808080">
<TextBlock Text="Save File" FontFamily="{StaticResource TitilliumWeb-Regular}" FontSize="20"
Foreground="#FFFDFDFD" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</StackPanel>
</Button>
</StackPanel>
</Grid>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
<Image x:Name="scrollIndicator" Source="../Resources/elipsis_icon.ico" Width="24" Height="24" VerticalAlignment="Bottom" Margin="0,0,0,-4" Visibility="Hidden"/>
</Grid>
</Grid>
</UserControl>