Add button to save passwords

This commit is contained in:
Artem Bugaev
2025-12-05 20:21:15 +03:00
parent 59ddb1da06
commit b143d9233d
3 changed files with 15 additions and 0 deletions

View File

@@ -10,4 +10,9 @@ public class UnlockedRepositoryViewModel : ViewModelBase
{
passStore = store;
}
public void Save()
{
passStore.Save();
}
}

View File

@@ -44,6 +44,7 @@
</Border>
<!-- Save Passwords -->
<Button Content="Save Passwords"
Click="SaveButton_Click"
Height="30"
Foreground="White"
HorizontalAlignment="Left"

View File

@@ -1,5 +1,6 @@
using System;
using Avalonia.Controls;
using Avalonia.Interactivity;
using KeyKeeper.ViewModels;
namespace KeyKeeper.Views;
@@ -20,4 +21,12 @@ public partial class RepositoryWindow: Window
{
base.OnOpened(e);
}
private void SaveButton_Click(object sender, RoutedEventArgs args)
{
if (DataContext is RepositoryWindowViewModel vm && vm.CurrentPage is UnlockedRepositoryViewModel pageVm)
{
pageVm.Save();
}
}
}