Files
Keys/App/ViewModels/PasswordStoreShortcut.cs
2025-09-22 13:08:08 +02:00

54 lines
1.2 KiB
C#

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;
}
}
}