|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 | 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
6 | 6 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
7 |
| - xmlns:local="clr-namespace:OATControl" |
8 |
| - mc:Ignorable="d" |
9 |
| - Title="Connect to OpenAstroTracker" Height="400" Width="600" ResizeMode="NoResize" WindowStyle="ToolWindow" FontSize="16" FontWeight="Bold"> |
| 7 | + xmlns:local="clr-namespace:OATControl" xmlns:converters="clr-namespace:OATControl.Converters" |
| 8 | + mc:Ignorable="d" |
| 9 | + Title="Connect to OpenAstroTracker" Height="500" Width="600" ResizeMode="NoResize" WindowStyle="ToolWindow" FontSize="16" FontWeight="Bold"> |
10 | 10 | <Controls:MetroWindow.Resources>
|
| 11 | + <converters:BoolToVisibilityConverter x:Key="ShowOnTrue" Collapse="True" /> |
| 12 | + <converters:BoolToVisibilityConverter x:Key="CollapseOnFalse" Collapse="True" /> |
11 | 13 | <Style x:Key="ListItemsStyle" TargetType="ListBoxItem">
|
12 | 14 | <Setter Property="Margin" Value="10,3,5,1" />
|
13 | 15 | <Setter Property="Padding" Value="6,3" />
|
|
27 | 29 | </Grid.ColumnDefinitions>
|
28 | 30 | <Grid.RowDefinitions>
|
29 | 31 | <RowDefinition Height="Auto" />
|
30 |
| - <RowDefinition Height="*" /> |
31 | 32 | <RowDefinition Height="Auto"/>
|
32 | 33 | <RowDefinition Height="Auto"/>
|
33 | 34 | <RowDefinition Height="Auto"/>
|
| 35 | + <RowDefinition Height="Auto"/> |
| 36 | + <RowDefinition Height="Auto"/> |
| 37 | + <RowDefinition Height="Auto"/> |
| 38 | + <RowDefinition Height="*"/> |
34 | 39 | <RowDefinition Height="Auto" />
|
35 | 40 | </Grid.RowDefinitions>
|
36 |
| - <TextBlock Grid.Row="0" Grid.Column="0" Text="Available Connections" Margin="10,24,10,0" Foreground="{StaticResource AccentSelectedColorBrush}" /> |
37 |
| - <ListBox Grid.Row="1" Grid.Column="1" |
| 41 | + <TextBlock Grid.Row="0" Grid.Column="0" Text="Available Connections" Margin="16" Foreground="{StaticResource AccentSelectedColorBrush}" /> |
| 42 | + <Button Grid.Row="0" Grid.Column="1" Content="Rescan" Margin="10,10,10,10" Width="80" Style="{StaticResource AccentedSquareButtonStyle}" HorizontalAlignment="Right" Command="{Binding RescanCommand}" /> |
| 43 | + <ListBox Grid.Row="0" |
| 44 | + Grid.Column="1" |
| 45 | + Grid.RowSpan="2" |
38 | 46 | VerticalAlignment="Top"
|
39 | 47 | ItemsSource="{Binding AvailableDevices,Mode=OneWay}"
|
40 | 48 | ItemsPanel="{StaticResource ListBoxItemsPanel}"
|
|
44 | 52 | MinHeight="18"
|
45 | 53 | HorizontalAlignment="Stretch"
|
46 | 54 | MinWidth="20"
|
47 |
| - Background="Transparent" > |
| 55 | + Background="Transparent" |
| 56 | + Margin="0,12,100,16"> |
48 | 57 | <ListBox.ItemTemplate>
|
49 | 58 | <DataTemplate DataType="string">
|
50 | 59 | <Grid >
|
|
53 | 62 | </DataTemplate>
|
54 | 63 | </ListBox.ItemTemplate>
|
55 | 64 | </ListBox>
|
56 |
| - <TextBlock Grid.Row="2" Grid.Column="0" Text="Latitude" HorizontalAlignment="Right" Margin="10" Foreground="{StaticResource AccentSelectedColorBrush}"/> |
57 |
| - <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Latitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5" HorizontalAlignment="Left"/> |
| 65 | + |
| 66 | + <TextBlock Grid.Row="2" Grid.Column="0" Text="Roll Level:" HorizontalAlignment="Right" Margin="0,10,10,10" Foreground="{StaticResource AccentSelectedColorBrush}" Visibility="{Binding ShowLevelDisplay, Converter={StaticResource CollapseOnFalse}}" /> |
| 67 | + <local:LevelDisplay Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Value="{Binding RollOffset}" Range="3" Labels="-3|-2|-1|0|1|2|3" Margin="10,5,20,5" Visibility="{Binding ShowLevelDisplay, Converter={StaticResource CollapseOnFalse}}" /> |
58 | 68 |
|
59 |
| - <TextBlock Grid.Row="3" Grid.Column="0" Text="Longitude" HorizontalAlignment="Right" Margin="10" Foreground="{StaticResource AccentSelectedColorBrush}"/> |
60 |
| - <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Longitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5" HorizontalAlignment="Left" /> |
| 69 | + <TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding GPSStatus}" HorizontalAlignment="Center" Margin="10,5,10,20" Foreground="{StaticResource AccentSelectedColorBrush}" Visibility="{Binding ShowGPSStatus, Converter={StaticResource ShowOnTrue}}"/> |
| 70 | + |
| 71 | + <TextBlock Grid.Row="4" Grid.Column="0" Text="Latitude" HorizontalAlignment="Right" Margin="0,5,9,10" Foreground="{StaticResource AccentSelectedColorBrush}" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
| 72 | + <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Latitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5,0,0,5" HorizontalAlignment="Left" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
| 73 | + |
| 74 | + <TextBlock Grid.Row="5" Grid.Column="0" Text="Longitude" HorizontalAlignment="Right" Margin="0,10,10,10" Foreground="{StaticResource AccentSelectedColorBrush}" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
| 75 | + <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding Longitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5,5,0,5" HorizontalAlignment="Left" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
61 | 76 |
|
62 |
| - <TextBlock Grid.Row="4" Grid.Column="0" Text="Altitude" HorizontalAlignment="Right" Margin="10" Foreground="{StaticResource AccentSelectedColorBrush}"/> |
63 |
| - <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Altitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5" HorizontalAlignment="Left"/> |
| 77 | + <TextBlock Grid.Row="6" Grid.Column="0" Text="Altitude" HorizontalAlignment="Right" Margin="0,10,9,10" Foreground="{StaticResource AccentSelectedColorBrush}" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
| 78 | + <TextBox Grid.Row="6" Grid.Column="1" Text="{Binding Altitude}" Width="150" FontWeight="Bold" FontSize="16" Foreground="{StaticResource AccentSelectedColorBrush}" Background="{StaticResource AccentColorBrush2}" Margin="5,5,0,5" HorizontalAlignment="Left" Visibility="{Binding ShowManualLocation, Converter={StaticResource CollapseOnFalse}}" /> |
64 | 79 |
|
65 |
| - <Grid Grid.Row="5" HorizontalAlignment="Stretch" Grid.ColumnSpan="2"> |
| 80 | + <Grid Grid.Row="8" HorizontalAlignment="Stretch" Grid.ColumnSpan="2"> |
66 | 81 | <Grid.ColumnDefinitions>
|
67 | 82 | <ColumnDefinition Width="Auto" />
|
68 | 83 | <ColumnDefinition Width="*" />
|
69 | 84 | <ColumnDefinition Width="Auto" />
|
70 | 85 | <ColumnDefinition Width="Auto" />
|
71 | 86 | </Grid.ColumnDefinitions>
|
72 |
| - <Button Grid.Column="0" Content="Rescan" Command="{Binding RescanCommand}" Margin="10,10,60,10" Width="80" Style="{StaticResource AccentedSquareButtonStyle}" HorizontalAlignment="Left" /> |
73 |
| - <Button Grid.Column="2" Content="OK" Command="{Binding OKCommand}" Margin="10" Width="80" Style="{StaticResource AccentedSquareButtonStyle}" IsDefault="True" HorizontalAlignment="Right"/> |
| 87 | + <Button Grid.Column="2" Content="Next" Command="{Binding ConnectAndNextCommand}" Margin="10" Width="80" Style="{StaticResource AccentedSquareButtonStyle}" IsDefault="True" HorizontalAlignment="Right" Visibility="{Binding ShowNextButton, Converter={StaticResource CollapseOnFalse}}"/> |
74 | 88 | <Button Grid.Column="3" Content="Cancel" Margin="10" Width="80" Style="{StaticResource AccentedSquareButtonStyle}" IsCancel="True" HorizontalAlignment="Right"/>
|
75 | 89 | </Grid>
|
76 | 90 | </Grid>
|
|
0 commit comments