-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
160 lines (145 loc) · 11.5 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
<Window x:Class="UniversalTelemetryReplay.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:UniversalTelemetryReplay.Controls"
mc:Ignorable="d"
Title="Universal Telemetry Replay"
Height="650"
MinHeight="550"
Width="900"
MinWidth="880"
Background="{DynamicResource PrimaryBackgroundColor}"
SizeChanged="Window_SizeChanged"
Closing="Window_Closing">
<Window.Icon>
<BitmapImage UriSource="pack://application:,,,/UniversalTelemetryReplay;component/Resources/utr_rd_logo.ico"/>
</Window.Icon>
<Grid>
<Border CornerRadius="10" Margin="5">
<Grid>
<!-- Main Grid Rows -->
<Grid.RowDefinitions>
<!-- Row 0 - Menu Items, 10% of window height -->
<RowDefinition Height="50" MinHeight="50"/>
<!-- Row 1 - Main Content View, remainder of height -->
<RowDefinition Height="*"/>
<!-- Row 2 - Controls, 25% of window height -->
<RowDefinition Height="25*" MinHeight="100" MaxHeight="150"/>
</Grid.RowDefinitions>
<!-- Row 0 - Menu Items -->
<Grid Grid.Row="0" Margin="5,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="SettingsViewButton" Style="{DynamicResource ModernButton}" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Left" Width="140" Height="25" Margin="5,0" Content="Settings" Click="MenuButton_Click"/>
<Image Grid.Column="1" Source="pack://application:,,,/UniversalTelemetryReplay;component/Resources/utr_logo_transparent.png"/>
<Button x:Name="ConfigurationsViewButton" Style="{DynamicResource ModernButton}" Grid.Column="2" VerticalAlignment="Center"
HorizontalAlignment="Right" Width="140" Height="25" Margin="5,0" Content="Message Configurations" Click="MenuButton_Click"/>
</Grid>
<!-- Row 1 - Main Content View -->
<Border Grid.Row="1" CornerRadius="10" Margin="5" Visibility="Visible" Background="{DynamicResource SecondaryBackgroundColor}">
<Frame x:Name="ContentArea" NavigationUIVisibility="Hidden"
Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type Border}}, Converter={StaticResource WidthConverter}}"
Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type Border}}, Converter={StaticResource HeightConverter}}"/>
</Border>
<!-- Row 2 - Controls -->
<Border Grid.Row="2" CornerRadius="10" Margin="5" Visibility="Visible" Background="{DynamicResource SecondaryBackgroundColor}">
<Grid x:Name="ControlsGrid" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition Height="*" MinHeight="80"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="ReplayStartTime" Grid.Column="0" Text="0.0" VerticalAlignment="Bottom" HorizontalAlignment="Left"
TextAlignment="Center" Margin="5,0,5,15" Width="70" Foreground="{DynamicResource TextSecondaryColor}"/>
<Grid Grid.Column="1">
<Canvas x:Name="LogLinesCanvas" Grid.Row="0" Margin="5,10,5,2" MinHeight="60" VerticalAlignment="Center"/>
<Slider x:Name="ReplaySlider" Grid.Row="1"
Minimum="0" Maximum="100" Value="0" VerticalAlignment="Bottom"
IsSnapToTickEnabled="True" TickPlacement="BottomRight" Margin="5,0,5,15"
Thumb.DragStarted="ReplaySlider_DragStarted" Thumb.DragCompleted="ReplaySlider_DragCompleted"/>
</Grid>
<TextBlock x:Name="ReplayEndTime" Grid.Column="2" Text="0.0" VerticalAlignment="Bottom" HorizontalAlignment="Right"
TextAlignment="Center" Margin="5,0,5,15" Width="70" Foreground="{DynamicResource TextSecondaryColor}"/>
</Grid>
<StackPanel Grid.Row="1" x:Name="CurrentStatus" HorizontalAlignment="Center" Visibility="Hidden">
<Border BorderThickness="1" BorderBrush="{DynamicResource ButtonDefaultColor}" CornerRadius="5">
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock Text="Current Timestamp: " Background="Transparent"
Margin="5,2,0,2" Foreground="{DynamicResource TextSecondaryColor}"/>
<TextBlock Width="90" Background="Transparent" TextAlignment="Right"
Margin="0,2,5,2" Foreground="{DynamicResource TextSecondaryColor}"
Text="{Binding ElementName=ReplaySlider, Path=Value, StringFormat={}{0:F2}}"/>
</StackPanel>
</Border>
</StackPanel>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="0,0,0,5">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<TextBlock Text="Playback Style" VerticalAlignment="Center" HorizontalAlignment="Center"
TextAlignment="Center" Width="80" Foreground="{DynamicResource TextSecondaryColor}"/>
</Grid>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock Text="Concurrent" VerticalAlignment="Center" HorizontalAlignment="Left"
TextAlignment="Center" Margin="5,0,5,0" Width="80" Foreground="{DynamicResource TextSecondaryColor}"/>
<controls:ModernToggleButton x:Name="PlaybackStyleButton" Grid.Row="9" Width="44" ButtonWidth="18"
Style="{StaticResource ModernToggleButton}" HorizontalAlignment="Center" Click="ActionButton_Click"/>
<TextBlock Text="Time Sync" VerticalAlignment="Center" HorizontalAlignment="Right"
TextAlignment="Center" Margin="5,0,5,0" Width="80" Foreground="{DynamicResource TextSecondaryColor}"/>
</StackPanel>
</Grid>
</Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="LoadButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Load" Click="ActionButton_Click"/>
<Button x:Name="RestartButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Restart" Click="ActionButton_Click" Visibility="Collapsed"/>
<Button x:Name="PlayButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Play" Click="ActionButton_Click" Visibility="Collapsed"/>
<Button x:Name="PauseButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Pause" Click="ActionButton_Click" Visibility="Collapsed"/>
<Button x:Name="ResumeButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Resume" Click="ActionButton_Click" Visibility="Collapsed"/>
<Button x:Name="StopButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Stop" Click="ActionButton_Click" Visibility="Collapsed"/>
<Button x:Name="ResetButton" Style="{DynamicResource ModernButton}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="100" Height="25" Margin="5" Content="Reset" Click="ActionButton_Click" Visibility="Collapsed"/>
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,20,5">
<TextBlock Grid.Column="0" Text="Playback Speed:" VerticalAlignment="Center" HorizontalAlignment="Left"
TextAlignment="Center" Margin="5,0,5,0" Width="100" Foreground="{DynamicResource TextSecondaryColor}"/>
<ComboBox x:Name="PlaybackSpeedComboBox" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5" Width="100"
SelectionChanged="PlaybackSpeedComboBox_SelectionChanged"/>
</StackPanel>
</Grid>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Window>