Skip to content

Commit cfeda5a

Browse files
author
Kajetan Jonak
committed
Settings layout changed
1 parent 51b9c19 commit cfeda5a

File tree

7 files changed

+165
-7
lines changed

7 files changed

+165
-7
lines changed

Services/DialogServices/DialogWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
77
xmlns:local="clr-namespace:Services.DialogServices"
88
mc:Ignorable="d"
9-
Title="DialogWindow" Height="450" Width="800"
9+
Title="DialogWindow" Height="450" Width="900"
1010
WindowStartupLocation="CenterOwner"
1111
WindowStyle="None"
1212
ResizeMode="NoResize"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<UserControl x:Class="Services.DialogServices.SettingsDialog.AppSettings"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:Services.DialogServices.SettingsDialog"
7+
mc:Ignorable="d"
8+
d:DesignHeight="450" d:DesignWidth="800">
9+
<UserControl.Resources>
10+
<ResourceDictionary>
11+
<ResourceDictionary.MergedDictionaries>
12+
<ResourceDictionary Source="SettingsDialogStyle.xaml"/>
13+
</ResourceDictionary.MergedDictionaries>
14+
<BooleanToVisibilityConverter x:Key="VisibilityConverter"/>
15+
</ResourceDictionary>
16+
</UserControl.Resources>
17+
<Grid>
18+
<Grid.RowDefinitions>
19+
<RowDefinition Height="Auto"/>
20+
<RowDefinition Height="Auto"/>
21+
<RowDefinition Height="Auto"/>
22+
<RowDefinition Height="Auto"/>
23+
</Grid.RowDefinitions>
24+
<!--#region Network settings -->
25+
<Grid Background="{StaticResource OnBackgroundBrush}">
26+
<Grid.RowDefinitions>
27+
<RowDefinition Height="Auto"/>
28+
<RowDefinition Height="Auto"/>
29+
</Grid.RowDefinitions>
30+
<Label Content="Network" FontSize="{StaticResource HeaderSize}" FontWeight="Bold"/>
31+
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="5" Background="{StaticResource SettingsDialogSurfaceBrush}">
32+
<Label Content="IP: "/>
33+
<TextBox Width="120" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding JetsonIP}"/>
34+
<Label Content="control port: "/>
35+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding ControlPort}"/>
36+
37+
<Label Content="stream port: "/>
38+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding VideoStreamPort}"/>
39+
</StackPanel>
40+
</Grid>
41+
<!--#endregion-->
42+
<!--#region BatterySettings -->
43+
<Grid Grid.Row="1" Background="{StaticResource OnBackgroundBrush}" Margin="0 5">
44+
<Grid.RowDefinitions>
45+
<RowDefinition Height="Auto"/>
46+
<RowDefinition Height="Auto"/>
47+
</Grid.RowDefinitions>
48+
<Label Content="Battery" FontSize="{StaticResource HeaderSize}" FontWeight="Bold"/>
49+
<Grid Grid.Row="1" Margin="5">
50+
<Grid.RowDefinitions>
51+
<RowDefinition Height="Auto"/>
52+
<RowDefinition Height="Auto"/>
53+
<RowDefinition Height="Auto"/>
54+
</Grid.RowDefinitions>
55+
<StackPanel Orientation="Horizontal" Grid.Row="0" Background="{StaticResource SurfaceBrush}">
56+
<Label Content="Bat1: " FontWeight="Bold"/>
57+
<Label Content="Max: "/>
58+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat1.max}"/>
59+
<Label Content="Min: "/>
60+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat1.min}"/>
61+
<Label Content="Allert: "/>
62+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat1.allert}"/>
63+
</StackPanel>
64+
<StackPanel Orientation="Horizontal" Grid.Row="1" Background="{StaticResource SurfaceBrush}" Margin="0 5 0 0">
65+
<Label Content="Bat2: " FontWeight="Bold"/>
66+
<Label Content="Max: "/>
67+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat2.max}"/>
68+
<Label Content="Min: "/>
69+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat2.min}"/>
70+
<Label Content="Allert: "/>
71+
<TextBox Width="60" Margin="0 5" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding Bat2.allert}"/>
72+
</StackPanel>
73+
</Grid>
74+
</Grid>
75+
<!--#endregion-->
76+
<!--#region Hummidity -->
77+
<Grid Grid.Row="2" Background="{StaticResource OnBackgroundBrush}" Margin="0 5">
78+
<Grid.RowDefinitions>
79+
<RowDefinition Height="Auto"/>
80+
<RowDefinition Height="Auto"/>
81+
</Grid.RowDefinitions>
82+
<Label Content="Hummidity" FontSize="{StaticResource HeaderSize}" FontWeight="Bold"/>
83+
<Grid Grid.Row="1" Margin="5">
84+
<StackPanel Orientation="Horizontal" Background="{StaticResource SurfaceBrush}">
85+
<Label Content="Allert: "/>
86+
<TextBox Text="0" Width="60" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="5"/>
87+
</StackPanel>
88+
</Grid>
89+
90+
</Grid>
91+
<!--#endregion-->
92+
</Grid>
93+
94+
</UserControl>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace Services.DialogServices.SettingsDialog
17+
{
18+
/// <summary>
19+
/// Interaction logic for AppSettings.xaml
20+
/// </summary>
21+
public partial class AppSettings : UserControl
22+
{
23+
public AppSettings()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}

Services/DialogServices/SettingsDialog/ControlSettingsView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
<Grid.ColumnDefinitions>
7272
<ColumnDefinition Width="100"/>
73-
<ColumnDefinition Width="50"/>
73+
<ColumnDefinition Width="69"/>
7474
</Grid.ColumnDefinitions>
7575

7676
<Label Content="{Binding Key, Converter={StaticResource dictionaryConverter}}"/>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:local="clr-namespace:Services.DialogServices.SettingsDialog"
4+
xmlns:sys="clr-namespace:System;assembly=mscorlib">
5+
<sys:Double x:Key="HeaderSize">20</sys:Double>
6+
<sys:Double x:Key="FontSize">12</sys:Double>
7+
<SolidColorBrush x:Key="SurfaceBrush" Color="{StaticResource SurfaceColor}" Opacity="{StaticResource SurfaceOpacity}"/>
8+
<SolidColorBrush x:Key="OnBackgroundBrush" Color="{StaticResource PrimaryColor}" Opacity="{StaticResource OnBackgroundOpacity}"/>
9+
10+
</ResourceDictionary>

Services/DialogServices/SettingsDialog/SettingsDialogView.xaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@
88
mc:Ignorable="d"
99
Background="Transparent"
1010
d:DesignHeight="450" d:DesignWidth="800">
11-
<Border CornerRadius="5">
11+
<UserControl.Resources>
12+
<ResourceDictionary>
13+
<ResourceDictionary.MergedDictionaries>
14+
<ResourceDictionary Source="SettingsDialogStyle.xaml"/>
15+
</ResourceDictionary.MergedDictionaries>
16+
<BooleanToVisibilityConverter x:Key="VisibilityConverter"/>
17+
</ResourceDictionary>
18+
</UserControl.Resources>
19+
<Border CornerRadius="5">
1220
<Border.Background>
1321
<SolidColorBrush Color="{StaticResource SecondaryColor}"/>
1422
</Border.Background>
@@ -20,16 +28,22 @@
2028
<Grid Margin="5" Background="{StaticResource BackgroundBrush}">
2129
<Grid.ColumnDefinitions>
2230
<ColumnDefinition Width="Auto"/>
23-
<ColumnDefinition Width="*"/>
31+
<ColumnDefinition Width="Auto"/>
2432
</Grid.ColumnDefinitions>
2533
<Grid Margin="5">
26-
<local:NetworkSettings Background="{StaticResource SettingsDialogSurfaceBrush}" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Top"/>
34+
<local:AppSettings/>
2735
</Grid>
28-
<Grid Margin="5" Grid.Column="1">
29-
<local:ControlSettingsView Background="{StaticResource SettingsDialogSurfaceBrush}" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Top" DataContext="{Binding ControlSettingsViewModel}"/>
36+
<Grid Margin="5" Grid.Column="1" Background="{StaticResource SettingsDialogSurfaceBrush}">
37+
<Grid.RowDefinitions>
38+
<RowDefinition Height="Auto"/>
39+
<RowDefinition Height="*"/>
40+
</Grid.RowDefinitions>
41+
<Label Content="Keyboard settings" FontSize="{StaticResource HeaderSize}" FontWeight="Bold"/>
42+
<local:ControlSettingsView Grid.Row="1" Padding="5" HorizontalAlignment="Left" VerticalAlignment="Stretch" DataContext="{Binding ControlSettingsViewModel}"/>
3043
</Grid>
3144
</Grid>
3245

46+
<!--#region Footer -->
3347
<Grid Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 0 10 5">
3448
<Grid.Background>
3549
<SolidColorBrush Color="{StaticResource SecondaryColor}"/>
@@ -43,6 +57,7 @@
4357
</StackPanel>
4458

4559
</Grid>
60+
<!--#endregion-->
4661
</Grid>
4762
</Border>
4863
</UserControl>

Services/Services.csproj

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
</ItemGroup>
5959
<ItemGroup>
6060
<Compile Include="DialogServices\DialogResult.cs" />
61+
<Compile Include="DialogServices\SettingsDialog\AppSettings.xaml.cs">
62+
<DependentUpon>AppSettings.xaml</DependentUpon>
63+
</Compile>
6164
<Compile Include="DialogServices\SettingsDialog\ControlDicConverter.cs" />
6265
<Compile Include="DialogServices\SettingsDialog\ControlSettingsView.xaml.cs">
6366
<DependentUpon>ControlSettingsView.xaml</DependentUpon>
@@ -77,6 +80,10 @@
7780
<Compile Include="DialogServices\DialogWindow.xaml.cs">
7881
<DependentUpon>DialogWindow.xaml</DependentUpon>
7982
</Compile>
83+
<Page Include="DialogServices\SettingsDialog\AppSettings.xaml">
84+
<SubType>Designer</SubType>
85+
<Generator>MSBuild:Compile</Generator>
86+
</Page>
8087
<Page Include="DialogServices\SettingsDialog\ControlSettingsView.xaml">
8188
<SubType>Designer</SubType>
8289
<Generator>MSBuild:Compile</Generator>
@@ -85,6 +92,10 @@
8592
<SubType>Designer</SubType>
8693
<Generator>MSBuild:Compile</Generator>
8794
</Page>
95+
<Page Include="DialogServices\SettingsDialog\SettingsDialogStyle.xaml">
96+
<SubType>Designer</SubType>
97+
<Generator>MSBuild:Compile</Generator>
98+
</Page>
8899
<Page Include="DialogServices\SettingsDialog\SettingsDialogView.xaml">
89100
<SubType>Designer</SubType>
90101
<Generator>MSBuild:Compile</Generator>

0 commit comments

Comments
 (0)