Develop #10

Merged
SemvdH merged 229 commits from develop into master 2020-10-29 22:50:49 +00:00
7 changed files with 69 additions and 25 deletions
Showing only changes of commit 5280e70feb - Show all commits

View File

@@ -8,25 +8,25 @@
</PropertyGroup>
<ItemGroup>
<None Remove="Images\CoolBackground.jpg" />
<None Remove="Images\Logo\icon1.ico" />
<None Remove="Images\re15.jpg" />
<None Remove="Images\stone.png" />
<None Remove="Images\CoolBackground.jpg" />
<None Remove="Images\Logo\icon1.ico" />
<None Remove="Images\re15.jpg" />
<None Remove="Images\stone.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\CoolBackground.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Logo\icon1.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\re15.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\stone.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\CoolBackground.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Logo\icon1.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\re15.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\stone.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
@@ -42,7 +42,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="Properties\" />
</ItemGroup>
<Import Project="..\Hashing\Hashing.projitems" Label="Shared" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;
using System.Windows.Media.Imaging;
namespace ClientApp.ValueConverters
{
//[ValueConversion(typeof(bool), typeof(BitmapImage))]
class BoolToMarkConverter : IValueConverter
{
public BitmapImage TrueImage { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Images/Icons/CheckMark.png"));
public BitmapImage FalseImage { get; set; } = new BitmapImage(new Uri("pack://application:,,,/Images/Icons/CrossMark.png"));
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (!(value is bool))
{
return null;
}
bool b = (bool)value;
if (b)
{
return this.TrueImage;
}
else
{
return this.FalseImage;
}
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@@ -20,14 +20,14 @@ namespace ClientApp.ViewModels
public bool InvertedLoginStatus { get; set; }
private MainWindowViewModel mainWindowViewModel;
private MainWindowViewModel MainWindowViewModel;
public LoginViewModel(MainWindowViewModel mainWindowViewModel)
{
this.mainWindowViewModel = mainWindowViewModel;
this.MainWindowViewModel = mainWindowViewModel;
LoginCommand = new RelayCommand<object>((parameter) =>
{
//TODO send username and password to server
this.mainWindowViewModel.client.tryLogin(Username, ((PasswordBox)parameter).Password);
this.MainWindowViewModel.client.tryLogin(Username, ((PasswordBox)parameter).Password);
});
}
@@ -35,11 +35,11 @@ namespace ClientApp.ViewModels
internal void setLoginStatus(bool status)
{
this.mainWindowViewModel.InfoModel.ConnectedToServer = status;
this.MainWindowViewModel.InfoModel.ConnectedToServer = status;
this.InvertedLoginStatus = !status;
if (status)
{
this.mainWindowViewModel.SelectedViewModel = new MainViewModel(mainWindowViewModel);
this.MainWindowViewModel.SelectedViewModel = new MainViewModel(MainWindowViewModel);
}
}
}

View File

@@ -89,7 +89,7 @@ namespace ClientApp.ViewModels
public int TitleHeight { get; set; } = 42;
public GridLength TitleHeightGridLegth { get { return new GridLength(TitleHeight + ResizeBorder); } }
public GridLength TitleHeightGridLength { get { return new GridLength(TitleHeight + ResizeBorder); } }
#endregion

View File

@@ -4,9 +4,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ClientApp.Views"
xmlns:converter="clr-namespace:ClientApp.ValueConverters"
ShowsNavigationUI="False"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Page.Resources>
<converter:BoolToMarkConverter x:Key="BoolToMarkConverter"/>
</Page.Resources>
<DockPanel>
<Grid>
<Grid.ColumnDefinitions>
@@ -21,8 +25,9 @@
</Grid.RowDefinitions>
<StackPanel Grid.Column="0" Grid.Row="0" Orientation="Horizontal" Margin="10">
<Label Content="Connected to server:"/>
<Label Content="true"/>
<Label Content="Connected to server:"/>
<Label Content="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer}"/>
<Image Source="{Binding Path=MainWindowViewModel.InfoModel.ConnectedToServer, Converter={StaticResource BoolToMarkConverter}}"/>
</StackPanel>
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal" Margin="10">