51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Media;
|
|
using Project.Controller;
|
|
|
|
namespace Project.View;
|
|
|
|
public partial class NewEntry : Window
|
|
{
|
|
readonly AppController? _controller;
|
|
public NewEntry()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
public NewEntry(AppController controller)
|
|
{
|
|
InitializeComponent();
|
|
_controller = controller;
|
|
}
|
|
private void NewEntry_Cancel_Click(object? sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void NewEntry_Save_Click(object? sender, RoutedEventArgs e)
|
|
{
|
|
string? name = NameBox.Text;
|
|
string? username = UsernameMailBox.Text;
|
|
string? url = URLBox.Text;
|
|
string? pass = PassBox.Text;
|
|
string? note = NoteBox.Text;
|
|
AppController.NewEntrySave(name, username, url, pass, note);
|
|
var newMenuView = new MenuView();
|
|
newMenuView.AfterSavingNewEntry();
|
|
Close();
|
|
}
|
|
|
|
private void NewEntry_ShowPW_Click(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (NewentryPW.PasswordChar == '*')
|
|
{
|
|
NewentryPW.PasswordChar = '\0';
|
|
}
|
|
else
|
|
{
|
|
NewentryPW.PasswordChar = '*';
|
|
}
|
|
}
|
|
|
|
} |