-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
1,252 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace CryptoDesktop.Core.Interfaces; | ||
|
||
public interface IPasswordSupplier | ||
{ | ||
string GetPassword(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Markup; | ||
using Google.Protobuf.Reflection; | ||
|
||
namespace CryptoDesktop.MVVM.Convertors; | ||
|
||
/// <summary> | ||
/// A base value converter that allows direct XAML usage | ||
/// </summary> | ||
/// <typeparam name="T">The type of this value converter</typeparam> | ||
public abstract class BaseValueConverter<T> : MarkupExtension, IValueConverter | ||
where T : class, new() | ||
{ | ||
#region Private Members | ||
|
||
/// <summary> | ||
/// A single static instance of this value converter | ||
/// </summary> | ||
private static T mConverter = null; | ||
|
||
#endregion | ||
|
||
#region Markup Extension Methods | ||
|
||
/// <summary> | ||
/// Provides a static instance of the value converter | ||
/// </summary> | ||
/// <param name="serviceProvider">The service provider</param> | ||
/// <returns></returns> | ||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
return mConverter ?? (mConverter = new T()); | ||
} | ||
|
||
#endregion | ||
|
||
#region Value Converter Methods | ||
|
||
/// <summary> | ||
/// The method to convert one type to another | ||
/// </summary> | ||
/// <param name="value"></param> | ||
/// <param name="targetType"></param> | ||
/// <param name="parameter"></param> | ||
/// <param name="culture"></param> | ||
/// <returns></returns> | ||
public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture); | ||
|
||
/// <summary> | ||
/// The method to convert a value back to it's source type | ||
/// </summary> | ||
/// <param name="value"></param> | ||
/// <param name="targetType"></param> | ||
/// <param name="parameter"></param> | ||
/// <param name="culture"></param> | ||
/// <returns></returns> | ||
public abstract object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture); | ||
|
||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
CryptoDesktop/MainWindow.xaml.cs → CryptoDesktop/MVVM/View/MainWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<Window x:Class="CryptoDesktop.Registration" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" | ||
xmlns:viewModel="clr-namespace:CryptoDesktop.MVVM.ViewModel" | ||
mc:Ignorable="d" | ||
Title="Registration" Height="450" Width="380" | ||
AllowsTransparency="True" Background="Transparent" | ||
WindowStartupLocation="CenterScreen" | ||
WindowStyle="None" ResizeMode="NoResize" | ||
MouseDown="Registration_OnMouseDown"> | ||
<Grid> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition/> | ||
<RowDefinition/> | ||
</Grid.RowDefinitions> | ||
|
||
|
||
<Border CornerRadius="10" Grid.RowSpan="2"> | ||
<Border.Background> | ||
<LinearGradientBrush> | ||
<GradientStop Color="#252525" Offset="0.0"/> | ||
<GradientStop Color="#292B2A" Offset="0.5"/> | ||
<GradientStop Color="#252525" Offset="0.8"/> | ||
</LinearGradientBrush> | ||
</Border.Background> | ||
</Border> | ||
|
||
|
||
<StackPanel VerticalAlignment="Center"> | ||
<Border | ||
BorderBrush="Black" | ||
BorderThickness="1" | ||
CornerRadius="60" | ||
HorizontalAlignment="Center"> | ||
<Image Source="../../Resources/Icons/default_logo.png" Width="80"/> | ||
</Border> | ||
|
||
<TextBlock Text="Crypto Chat" | ||
FontWeight="Light" | ||
FontFamily="helvetica" | ||
FontSize="22" | ||
Foreground="White" | ||
HorizontalAlignment="Center"/> | ||
</StackPanel> | ||
|
||
|
||
|
||
<StackPanel Grid.Row="1" > | ||
<StackPanel Orientation="Horizontal"> | ||
<TextBox FontFamily="Helvetica" | ||
FontWeight="Light" | ||
Text="{Binding UserName}" | ||
FontSize="20" | ||
HorizontalAlignment="Center" | ||
Foreground="White" | ||
Background="Transparent" | ||
BorderThickness="0" | ||
Width="235" | ||
HorizontalContentAlignment="Left" | ||
Height="25" | ||
Margin="63,0,0,0"/> | ||
<iconPacks:PackIconMaterial Kind="Account" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
Foreground="White"/> | ||
</StackPanel> | ||
<Border Width="250" | ||
Height="2" | ||
Background="White" | ||
Opacity="0.5"/> | ||
|
||
|
||
|
||
<StackPanel Orientation="Horizontal" Margin="0,20,0,0"> | ||
<PasswordBox | ||
x:Name="PasswordBox" | ||
FontFamily="Helvetica" | ||
FontWeight="Light" | ||
Password="Password" | ||
FontSize="20" | ||
HorizontalAlignment="Center" | ||
Foreground="White" | ||
Background="Transparent" | ||
BorderThickness="0" | ||
Width="235" | ||
HorizontalContentAlignment="Left" | ||
Height="25" | ||
Margin="63,0,0,0"/> | ||
<iconPacks:PackIconMaterial Kind="FormTextboxPassword" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center" | ||
Foreground="White"/> | ||
</StackPanel> | ||
<Border Width="250" | ||
Height="2" | ||
Background="White" | ||
Opacity="0.5"/> | ||
|
||
|
||
<StackPanel Orientation="Horizontal" Margin="0,50,0,0"> | ||
<Button | ||
Command="{Binding LoginCommand}" | ||
CommandParameter="{Binding ElementName=PasswordBox}" | ||
Style="{StaticResource RoundCorner}" | ||
Width="100" Height="40" | ||
Content="LOGIN" Margin="60,0,60,0" | ||
Foreground="White"/> | ||
<Button | ||
Command="{Binding RegisterCommand}" | ||
CommandParameter="{Binding ElementName=PasswordBox}" | ||
Style="{StaticResource RoundCorner}" | ||
Width="100" Height="40" | ||
Content="REGISTER" | ||
Foreground="White"/> | ||
</StackPanel> | ||
|
||
</StackPanel> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</Grid> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Windows; | ||
using System.Windows.Input; | ||
|
||
namespace CryptoDesktop; | ||
|
||
public partial class Registration : Window | ||
{ | ||
public Registration() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Registration_OnMouseDown(object sender, MouseButtonEventArgs e) | ||
{ | ||
if (e.LeftButton == MouseButtonState.Pressed) | ||
DragMove(); | ||
} | ||
} |
Oops, something went wrong.