51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System.ComponentModel;
|
|
|
|
namespace App.UI.ViewModels;
|
|
|
|
public class PasswordStoreShortcut : INotifyPropertyChanged
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|