Skip to content
This repository was archived by the owner on Jan 21, 2022. It is now read-only.

Commit 23877ca

Browse files
Merge branch 'development' into ProfileV2
2 parents 7544f43 + d0b31e7 commit 23877ca

14 files changed

Lines changed: 383 additions & 125 deletions

View/App.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:local="clr-namespace:View"
5+
xmlns:stylingHelperTools="clr-namespace:View.StylingHelperTools"
56
StartupUri="MainWindow.xaml">
67
<Application.Resources>
7-
8+
<ResourceDictionary Source="Styling/Main.xaml"/>
89
</Application.Resources>
910
</Application>

View/Authentication/LoginView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</Page.DataContext>
1313

1414
<Grid>
15-
<Border Background="#94D2E6" CornerRadius="10" Margin="10">
15+
<Border Background="{StaticResource BackgroundPrimary}" CornerRadius="10" Margin="10">
1616
<StackPanel Margin="10">
1717
<Label Content="E-mailadres van je schoolaccount" FontSize="14"/>
1818
<TextBox Margin="5 0" FontSize="14"
@@ -22,7 +22,7 @@
2222
<components:BindablePasswordBox Margin="5 0" FontSize="14"
2323
Password="{Binding Password}"/>
2424

25-
<Button Content="Inloggen" Margin="100 10" Background="#F16F6F" Foreground="White" FontSize="14" Command="{Binding LoginCommand}">
25+
<Button Content="Inloggen" Margin="100 10" Background="{StaticResource BackgroundTertiary}" Foreground="White" FontSize="14" Command="{Binding LoginCommand}">
2626
<Button.Resources>
2727
<Style TargetType="Border">
2828
<Setter Property="CornerRadius" Value="10"/>

View/Authentication/RegisterView.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</Page.DataContext>
1313

1414
<Grid>
15-
<Border Background="#94D2E6" CornerRadius="10" Margin="10">
15+
<Border Background="{StaticResource BackgroundPrimary}" CornerRadius="10" Margin="10">
1616
<StackPanel Margin="10">
1717
<Label Content="E-mailadres van je schoolaccount" FontSize="14"/>
1818
<TextBox Margin="5 0" FontSize="14"
@@ -23,9 +23,9 @@
2323
Password="{Binding Password}"/>
2424

2525
<Label Content="Wachtwoordsterkte:" FontSize="14" HorizontalAlignment="Center" Margin="0,0,-5,0"/>
26-
<ProgressBar Maximum="5" Value="{Binding PasswordStrength}" Height="7" Background="#F16F6F" Foreground="#fff78f"/>
26+
<ProgressBar Maximum="5" Value="{Binding PasswordStrength}" Height="7" Background="{StaticResource BackgroundTertiary}" Foreground="{StaticResource BackgroundQuaternary}"/>
2727

28-
<Button Name="registerSubmit" Content="Registreren" Margin="100 10" Background="#F16F6F" Foreground="White" FontSize="14" Command="{Binding RegisterCommand}">
28+
<Button Name="registerSubmit" Content="Registreren" Margin="100 10" Background="{StaticResource BackgroundTertiary}" Foreground="White" FontSize="14" Command="{Binding RegisterCommand}">
2929
<Button.Resources>
3030
<Style TargetType="Border">
3131
<Setter Property="CornerRadius" Value="10"/>

View/Authentication/VerificationView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
</Page.DataContext>
1313

1414
<Grid>
15-
<Border Background="#94D2E6" CornerRadius="10" Margin="10">
15+
<Border Background="{StaticResource BackgroundPrimary}" CornerRadius="10" Margin="10">
1616
<StackPanel Margin="10">
1717
<Label Content="Vul je verificatiecode in:" FontSize="14"/>
1818
<TextBox Margin="5 0" FontSize="14"
1919
Text="{Binding VerificationCode, UpdateSourceTrigger=PropertyChanged}"/>
2020

21-
<Button Name="VerifySubmit" Content="Verifiëren" Margin="100 10" Background="#F16F6F" Foreground="White" FontSize="14" Command="{Binding VerifyCommand}" Click="VerifySubmit_Click">
21+
<Button Name="VerifySubmit" Content="Verifiëren" Margin="100 10" Background="{StaticResource BackgroundTertiary}" Foreground="White" FontSize="14" Command="{Binding VerifyCommand}" Click="VerifySubmit_Click">
2222
<Button.Resources>
2323
<Style TargetType="Border">
2424
<Setter Property="CornerRadius" Value="10"/>

View/MainMenuData.cs

Lines changed: 0 additions & 55 deletions
This file was deleted.

View/MainWindow.xaml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,50 @@
44
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:View"
7+
xmlns:vm="clr-namespace:ViewModel;assembly=ViewModel"
8+
xmlns:vmc="clr-namespace:ViewModel.Commands;assembly=ViewModel"
79
mc:Ignorable="d"
8-
Title="MainWindow" Height="450" Width="800">
9-
<DockPanel LastChildFill="True">
10-
<DockPanel.DataContext>
11-
<local:MainMenuData/>
12-
</DockPanel.DataContext>
13-
<StackPanel DockPanel.Dock="Left" Width="100">
14-
<Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}">
15-
<Grid.ColumnDefinitions>
16-
<ColumnDefinition Width="1*" />
17-
<ColumnDefinition Width="1*" />
18-
</Grid.ColumnDefinitions>
19-
<Button x:Name="btPreviousButton" Content="&lt;" Margin="5,5,5,5" Click="NavigationNextPreviousButton_Click"/>
20-
<Button x:Name="btNextButton" Content="&gt;" Grid.Column="1" Margin="5" Click="NavigationNextPreviousButton_Click"/>
21-
</Grid>
22-
<!-- The Stackpanel doesn't allow a binding for its children, so we use a ItemsControl instead -->
23-
<ItemsControl x:Name="icMenuItems" ItemsSource="{Binding MainNavigationItems}">
10+
Style="{StaticResource {x:Type Window}}"
11+
Title="Stugether" Height="450" Width="800">
12+
<Window.DataContext>
13+
<vm:MainPageViewModel/>
14+
</Window.DataContext>
15+
<Grid>
16+
<Grid.ColumnDefinitions>
17+
<ColumnDefinition MaxWidth="150"/>
18+
<ColumnDefinition Width="6*"/>
19+
</Grid.ColumnDefinitions>
20+
<Grid.RowDefinitions>
21+
<RowDefinition Height="35"/>
22+
<RowDefinition Height="1*"/>
23+
</Grid.RowDefinitions>
24+
<Grid Height="{Binding ActualHeight, ElementName=tbContentTitle, Mode=OneWay}">
25+
<Grid.ColumnDefinitions>
26+
<ColumnDefinition Width="1*" />
27+
<ColumnDefinition Width="1*" />
28+
</Grid.ColumnDefinitions>
29+
<Button x:Name="btPreviousButton" Content="&lt;" Margin="5,5,5,5" Click="NavigationNextPreviousButton_Click"/>
30+
<Button x:Name="btNextButton" Content="&gt;" Grid.Column="1" Margin="5" Click="NavigationNextPreviousButton_Click"/>
31+
</Grid>
32+
<!-- The Stackpanel doesn't allow a binding for its children, so we use a ItemsControl instead -->
33+
<StackPanel Grid.Row="1"> <!-- TEMPORARY for login button -->
34+
<ItemsControl x:Name="icMenuItems" Grid.Row="1" ItemsSource="{Binding MainNavigationItems}">
2435
<ItemsControl.ItemsPanel>
2536
<ItemsPanelTemplate>
2637
<StackPanel IsItemsHost="True"/>
2738
</ItemsPanelTemplate>
2839
</ItemsControl.ItemsPanel>
2940
<ItemsControl.ItemTemplate>
3041
<ItemContainerTemplate>
31-
<local:MainWindowNavigationItem Content="{Binding Title}" Page="{Binding Page}" ExtraNavigationInformation="{Binding ExtraInformation}" Click="MainWindowNavigationItem_Click"/>
42+
<local:MainWindowNavigationItem Content="{Binding Title}" Page="{Binding Page}" ExtraNavigationInformation="{Binding ExtraInformation}" Command="{Binding Path=DataContext.NavigateButtonCommand, RelativeSource={RelativeSource AncestorType=Window},Mode=Default}" CommandParameter="{Binding Mode=OneWay}"/>
3243
</ItemContainerTemplate>
3344
</ItemsControl.ItemTemplate>
3445
</ItemsControl>
46+
<local:MainWindowNavigationItem Content="Login" ExtraNavigationInformation="" Click="Login_Click"/>
3547
</StackPanel>
36-
<TextBlock x:Name="tbContentTitle" DockPanel.Dock="Top" Text="Title" FontSize="22" FontWeight="Bold"/>
37-
<Frame x:Name="frContent" NavigationUIVisibility="Hidden" Navigated="frContent_Navigated"/>
38-
</DockPanel>
48+
<TextBlock x:Name="tbContentTitle" Grid.Column="1" FontSize="22" FontWeight="Bold" Text="{Binding Title}"/>
49+
<ScrollViewer Grid.Column="1" Grid.Row="1" VerticalScrollBarVisibility="Auto" >
50+
<Frame x:Name="frContent" Grid.Column="1" Grid.Row="1" NavigationUIVisibility="Hidden" Navigated="frContent_Navigated" Source="{Binding CurrentVisiblePage}"/>
51+
</ScrollViewer>
52+
</Grid>
3953
</Window>

View/MainWindow.xaml.cs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,9 @@ public partial class MainWindow : Window
1414
public MainWindow()
1515
{
1616
InitializeComponent();
17-
SSHConnection.InitializeSsh(); // Not MVVM, this needs to be moved somewhere soon
17+
SSHConnection.InitializeSsh(); // TODO: Not MVVM, this needs to be moved somewhere soon
1818
}
1919

20-
private void Button_Click(object sender, RoutedEventArgs e)
21-
{
22-
AuthenticationWindow authenticationWindow = new AuthenticationWindow();
23-
authenticationWindow.Show();
24-
}
25-
26-
/// <summary>
27-
/// Occurs when a navigation item is clicked to navigate to its page
28-
/// </summary>
29-
/// <param name="sender">The source of the event.</param>
30-
/// <param name="e">The event data.</param>
31-
private void MainWindowNavigationItem_Click(object sender, RoutedEventArgs e)
32-
{
33-
MainWindowNavigationItem mwniSender = (MainWindowNavigationItem)sender;
34-
tbContentTitle.Text = (string)mwniSender.Content;
35-
frContent.Navigate(mwniSender.Page);
36-
}
3720

3821
/// <summary>
3922
/// Occurs when the back/forward buttons are clicked
@@ -61,6 +44,21 @@ private void frContent_Navigated(object sender, NavigationEventArgs e)
6144
{
6245
btPreviousButton.IsEnabled = ((Frame)sender).CanGoBack;
6346
btNextButton.IsEnabled = ((Frame)sender).CanGoForward;
47+
if (((Frame)sender).Content.GetType() == typeof(Page))
48+
{
49+
tbContentTitle.Text = ((Page)((Frame)sender).Content).Title;
50+
}
51+
}
52+
53+
private void MainWindowNavigationItem_Checked(object sender, RoutedEventArgs e)
54+
{
55+
56+
}
57+
58+
private void Login_Click(object sender, RoutedEventArgs e)
59+
{
60+
AuthenticationWindow authenticationWindow = new AuthenticationWindow();
61+
authenticationWindow.Show();
6462
}
6563
}
6664
}

View/MainWindowNavigationItem.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xmlns:local="clr-namespace:View"
77
mc:Ignorable="d"
88
d:DesignHeight="50" d:DesignWidth="100"
9-
Style="{StaticResource {x:Type ToggleButton}}"
109
GroupName="MainNavigation">
11-
10+
<!-- Style="{StaticResource {x:Type ToggleButton}}"
11+
-->
1212
</RadioButton>

View/OpgevenRelaties.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<CheckBox Content="Zakelijk" Margin="79,36,0,0" Grid.Column="1" Height="15" VerticalAlignment="Top" HorizontalAlignment="Left" Width="99"/>
2727
<CheckBox Content="Vrienden" Margin="10,92,0,0" Grid.Column="1" Height="14" VerticalAlignment="Top" HorizontalAlignment="Left" Width="69"/>
2828
<CheckBox Content="Studiemaatje" Margin="79,92,0,0" Grid.Column="1" HorizontalAlignment="Left" Width="99" Height="14" VerticalAlignment="Top"/>
29-
<Frame Content="Hobby" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="3" Background="Aqua" Source="HobbyOptionsView.xaml"/>
29+
<Frame Content="Hobby" Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="3" Background="{StaticResource BackgroundPrimary}" Source="HobbyOptionsView.xaml"/>
3030
<Button Content="Opslaan" Grid.Column="3" HorizontalAlignment="Center" Margin="0,24,0,0" VerticalAlignment="Top" Height="20" Width="59"/>
3131
<Button Content="Annuleren" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Top" Height="20" Width="59" Margin="0,65,0,0"/>
3232

0 commit comments

Comments
 (0)