Started implementing backend
This commit is contained in:
53
App/ViewModels/PasswordStoreShortcut.cs
Normal file
53
App/ViewModels/PasswordStoreShortcut.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System.ComponentModel;
|
||||
using Logic;
|
||||
|
||||
namespace Keychain.ViewModels;
|
||||
|
||||
public class PasswordStoreShortcut : INotifyPropertyChanged
|
||||
{
|
||||
private IPasswordService passwordService;
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
private string displayName;
|
||||
private bool displayNameSet = false;
|
||||
private string? iconName;
|
||||
private string path;
|
||||
public bool DisplayNameSet { get => displayNameSet; }
|
||||
|
||||
|
||||
public string DisplayName
|
||||
{
|
||||
get => displayName;
|
||||
set
|
||||
{
|
||||
displayName = value;
|
||||
displayNameSet = true;
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(DisplayName)));
|
||||
}
|
||||
}
|
||||
|
||||
public string? IconName
|
||||
{
|
||||
get => iconName;
|
||||
set { iconName = value; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IconName))); }
|
||||
}
|
||||
|
||||
public string Path
|
||||
{
|
||||
get => path;
|
||||
}
|
||||
|
||||
public PasswordStoreShortcut(string path, string iconName = "text-x-generic-symbolic", string? displayName = null)
|
||||
{
|
||||
this.path = path;
|
||||
|
||||
this.iconName = iconName;
|
||||
|
||||
this.displayName = path;
|
||||
|
||||
if (displayName != null)
|
||||
{
|
||||
DisplayName = displayName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user