forked from Slazanger/SMT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharactersWindow.xaml
163 lines (132 loc) · 7.96 KB
/
CharactersWindow.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
<Window x:Class="SMT.CharactersWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:SMT"
mc:Ignorable="d"
Closed="Window_Closed"
Title="Characters" Height="450" Width="750" ResizeMode="NoResize" WindowStartupLocation="CenterOwner">
<Window.Resources>
<ObjectDataProvider x:Key="navigationEnumData" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:RoutingMode" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>
<Grid Background="{DynamicResource ListBackground}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<ListView x:Name="characterLV" Grid.Row="0" BorderBrush="Black" SelectionChanged="characterLV_Selected" Margin="4">
<ListView.ItemTemplate>
<DataTemplate>
<WrapPanel>
<Image Source="{Binding Portrait}" Width="32" Height="32" Margin="1" />
<TextBlock Text="{Binding Name}" FontSize="16"/>
</WrapPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Button DockPanel.Dock="Bottom" Content="Add Character" Grid.Row="1" Click="AddCharacter_Click" Margin="4"/>
<Grid x:Name="characterInfoGrid" Grid.Column="1" Grid.RowSpan="2" Visibility="Hidden"
Background="{DynamicResource ListBackground}" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="190" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Image Source="{Binding Portrait}" Width="170" Height="170" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" Margin="10"/>
<StackPanel Orientation="Vertical" Grid.Row="0" Grid.Column="1" Margin="-40,30" Grid.RowSpan="2">
<TextBlock Text="{Binding Name}" FontSize="24" Foreground="White" />
<TextBlock FontSize="14" Foreground="LightGray">
<Run Text="{Binding CorporationName, FallbackValue='????'}"/>
<Run Text=" ["/>
<Run Text="{Binding CorporationTicker, FallbackValue='????'}"/>
<Run Text="]"/>
</TextBlock>
<TextBlock FontSize="14" Foreground="LightGray">
<Run Text="{Binding AllianceName, FallbackValue='No Alliance'}"/>
<Run Text=" ["/>
<Run Text="{Binding AllianceTicker , FallbackValue=''}"/>
<Run Text="]"/>
</TextBlock>
<TextBlock FontSize="14" Foreground="LightGray">
<Run Text="{Binding Location, FallbackValue='Unknown Location'}"/>
</TextBlock>
<TextBlock Text=" " />
<TextBlock Margin="0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding ESILinked}" Value="True">
<Setter Property="Text" Value="Authenticated" />
<Setter Property="Foreground" Value="Green" />
</DataTrigger>
<DataTrigger Binding="{Binding ESILinked}" Value="False">
<Setter Property="Text" Value="Unauthenticated" />
<Setter Property="Foreground" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock>
<TextBlock.Style>
<Style TargetType="TextBlock">
<Style.Triggers>
<DataTrigger Binding="{Binding IsOnline}" Value="True">
<Setter Property="Text" Value="Online" />
<Setter Property="Foreground" Value="LightGray" />
</DataTrigger>
<DataTrigger Binding="{Binding IsOnline}" Value="False">
<Setter Property="Text" Value="Offline" />
<Setter Property="Foreground" Value="DarkGray" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
<GroupBox Header="Navigation Options" Grid.Row="1" Grid.RowSpan="7" BorderBrush="DarkGray" Margin="5">
<StackPanel Margin="4">
<StackPanel Orientation="Horizontal" Margin="4">
<Label Content="Autopilot" />
<ComboBox ItemsSource="{Binding Source={StaticResource navigationEnumData}}" SelectedItem="{Binding NavigationMode, Mode=TwoWay}" Margin="2" Width="140" Background="Black"/>
</StackPanel>
<CheckBox IsChecked="{Binding UseAnsiblexGates}" HorizontalAlignment="Left" Content="Use Ansiblex Gates" Margin="4"/>
</StackPanel>
</GroupBox>
<GroupBox Header="DangerZone" Grid.Column="1" Grid.Row="1" Grid.RowSpan="7" BorderBrush="DarkGray" Margin="5">
<StackPanel Margin="4" >
<CheckBox IsChecked="{Binding DangerZoneActive}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Checked="dangerZoneEnabled_Checked" Content="DangerZone Enabled" Margin="4"/>
<StackPanel Orientation="Horizontal" Margin="4">
<xctk:IntegerUpDown Value="{Binding DangerZoneRange}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0" Width="45" Minimum="1" Maximum="6" Background="Transparent" Foreground="White" ValueChanged="dangerzone_ValueChanged" />
<Label Content="DangerZone Size" Grid.Column="0" Grid.Row="5" HorizontalAlignment="Right" />
</StackPanel>
</StackPanel>
</GroupBox>
<Button Content="Delete" Grid.Column="1" Grid.Row="8" Width="100" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="20,0" x:Name="deleteBtn" Click="deleteBtn_Click"/>
</Grid>
</Grid>
</Window>