-
Notifications
You must be signed in to change notification settings - Fork 36
/
MainWindow.xaml
254 lines (249 loc) · 15.4 KB
/
MainWindow.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:HighVoltz.HBRelog"
xmlns:Controls="clr-namespace:HighVoltz.HBRelog.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
x:Class="HighVoltz.HBRelog.MainWindow"
Height="400" Width="750" MinWidth="750" MinHeight="400" Loaded="Window_Loaded"
DataContext="{Binding CharacterProfiles, Source={x:Static local:HbRelogManager.Settings}}"
Icon="Images/Logo.ico"
>
<!--
<Window.Resources>
<ResourceDictionary >
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Styles/BureauBlue.xaml"/>
<ResourceDictionary Source="Styles/ExpressionDark.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
-->
<Window.TaskbarItemInfo>
<TaskbarItemInfo>
<TaskbarItemInfo.ThumbButtonInfos>
<ThumbButtonInfo x:Name="StartThumbButton" Description="Start All" Click="StartThumbButtonClick" ImageSource="Images/play1pressed.png" />
<ThumbButtonInfo x:Name="PauseThumbButton" Description="Pause All" Click="PauseThumbButtonClick" ImageSource="Images/pausehot.png" />
<ThumbButtonInfo x:Name="StopThumbButton" Description="Stop All" Click="StopThumbButtonClick" ImageSource="Images/stop1normalred.png" />
</TaskbarItemInfo.ThumbButtonInfos>
</TaskbarItemInfo>
</Window.TaskbarItemInfo>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition x:Name="LogRow" Height="Auto" />
</Grid.RowDefinitions>
<Border BorderThickness="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="SelectAllButton" Click="SelectAllButtonClick">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/edit_select_all.png" Height="24" />
<TextBlock Text="Select All" Margin="4,0" VerticalAlignment="Center" TextWrapping="Wrap" Width="Auto" Grid.Column="1"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="StartButton" Click="StartSelButtonClick" Grid.Column="1">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/play1pressed.png" Height="24" />
<TextBlock Text="Start" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="PauseButton" Click="PauseButtonClick" Grid.Column="2">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/pausehot.png" Height="24" />
<TextBlock Text="Pause" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="StopButton" Click="StopSelButtonClick" Grid.Column="3">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/stop1normalred.png" Height="24" />
<TextBlock Text="Stop" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="AddButton" Click="AddAccountButton_Click" Grid.Column="4">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/112_Plus_Blue_32x32_72.png" Height="24" />
<TextBlock Text="Add" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="EditButton" Click="EditAccountButtonClick" Grid.Column="5">
<Button.Content>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/Settings.png" Height="24" />
<TextBlock Text="Edit" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
<Button x:Name="DelButton" Click="DeleteAccountButtonClick" Grid.Column="6">
<Button.Content>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="24" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="Images/delete.png" Height="24" />
<TextBlock Text="Delete" Margin="4,0" VerticalAlignment="Center" Grid.Column="1" TextWrapping="Wrap" Width="Auto"/>
</Grid>
</Button.Content>
</Button>
</Grid>
</Border>
<DataGrid x:Name="AccountGrid" IsSynchronizedWithCurrentItem="True"
GridLinesVisibility="Vertical"
ItemsSource="{Binding}" Grid.Row="1" CanUserAddRows="False"
CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False"
AutoGenerateColumns="False" CanUserResizeRows="False"
HorizontalContentAlignment="Left" SelectionChanged="AccountGridSelectionChanged"
MouseDoubleClick="AccountGridMouseDoubleClick"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
>
<DataGrid.Columns>
<DataGridTemplateColumn Header="*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate >
<!-- Bindings get destroyed once user changes the value of the checkbox so I'll have to use callbacks -->
<CheckBox x:Name="ProfileEnabledCheckBox" IsChecked="{Binding Settings.IsEnabled}"
Tag="{Binding Settings}" Checked="ProfileEnabledCheckBoxChecked" Unchecked="ProfileEnabledCheckBoxUnchecked"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn >
<DataGridTextColumn Binding="{Binding Settings.ProfileName}" Header="Profile" MinWidth="100" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Settings.WowSettings.ServerName}" Header="Server" MinWidth="70" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Settings.WowSettings.CharacterName}" Header="Character" MinWidth="70" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Status}" Header="Status" Width="*" IsReadOnly="True" />
</DataGrid.Columns>
<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource {x:Type DataGridRow}}">
<Setter Property="ToolTipService.ToolTip" Value="{Binding Tooltip}"/>
<Setter Property="ToolTipService.InitialShowDelay" Value="0"/>
<Setter Property="ToolTipService.ShowDuration" Value="10000"/>
<EventSetter Event="ContextMenuOpening" Handler="DataGridRowContextMenuOpening"/>
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu x:Name="RowContextMenu">
<MenuItem x:Name="SkipMenu" Header="Skip Current Task" Tag="{Binding}">
<!-- Visibility="{Binding Converter={StaticResource SkipTaskMenuVisibityConverter}}"> -->
<!-- Workaround for a bug. -->
<MenuItem.Style>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<EventSetter Event="Click" Handler="SkipTaskMenuItem_Click" />
</Style>
</MenuItem.Style>
</MenuItem>
<MenuItem x:Name="BringHbToForegroundMenu" Header="Bring HB To Foreground" Tag="{Binding}">
<MenuItem.Style>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<EventSetter Event="Click" Handler="BringHbToForegroundMenuItem_Click" />
</Style>
</MenuItem.Style>
</MenuItem>
<MenuItem x:Name="KillHBMenu" Header="Kill HB" Tag="{Binding}">
<MenuItem.Style>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<EventSetter Event="Click" Handler="KillHbMenuItem_Click" />
</Style>
</MenuItem.Style>
</MenuItem>
<MenuItem x:Name="BringWoWToForeground" Header="Bring WoW To Foreground" Tag="{Binding}">
<MenuItem.Style>
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
<EventSetter Event="Click" Handler="BringWoWToForeground_Click" />
</Style>
</MenuItem.Style>
</MenuItem>
</ContextMenu>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
</DataGrid>
<Grid x:Name="OptionsAndLogGrid" Grid.Row="2" Height="20">
<Grid.Resources>
<Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}" >
<Setter Property="Height" Value="20"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
</Grid.Resources>
<TabControl x:Name="OptionsAndLogTabCtrl" Grid.Row="2" Height="200" >
<TabItem x:Name="OptionsTab" VerticalContentAlignment="Stretch"
PreviewMouseLeftButtonDown="TabItem_PreviewMouseLeftButtonDown"
HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" >
<TabItem.Header>
<TextBlock Text="Options" Margin="-10" Padding="15,0"/>
</TabItem.Header>
<Controls:OptionsUserControl x:Name="HbrelogOptions"
DataContext="{x:Static local:HbRelogManager.Settings}"/>
</TabItem>
<TabItem PreviewMouseLeftButtonDown="TabItem_PreviewMouseLeftButtonDown"
VerticalContentAlignment="Stretch">
<TabItem.Header>
<TextBlock Text="Log" Margin="-10" Padding="15,0"/>
</TabItem.Header>
<RichTextBox Grid.Row="2" HorizontalAlignment="Stretch" x:Name="LogTextBox" VerticalAlignment="Stretch"
IsReadOnly="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Padding="0"
AcceptsReturn="False" AllowDrop="False" AutoWordSelection="False" FontFamily="Consolas" />
</TabItem>
</TabControl>
</Grid>
<Grid x:Name="AccountConfigGrid" Margin="0,4,-8,4" Grid.Row="1" Grid.RowSpan="2"
MinHeight="300" VerticalAlignment="Top" Width="0" HorizontalAlignment="Right">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Name="AccountConfigGridColumn" Width="275" MinWidth="275" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Border Grid.Column="1" Grid.RowSpan="2" BorderThickness="2" CornerRadius="4" />
<Controls:AccountConfigUserControl x:Name="AccountConfig" Grid.Column="1" Margin="4" />
<Button Content="Save and Close" Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,4,4"
x:Name="AccountConfigCloseButton" Grid.Row="1" FontSize="11" Click="AcountConfigCloseButtonClick"/>
</Grid>
</Grid>
</Window>