mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Additional fields Add, Update and Delete work (too well)
SelectableListView works when programmatically setting selection
This commit is contained in:
37
WinAppCommon/ViewModels/Items/FieldVm.cs
Normal file
37
WinAppCommon/ViewModels/Items/FieldVm.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using GalaSoft.MvvmLight;
|
||||
using Messages;
|
||||
|
||||
namespace ModernKeePass.ViewModels.ListItems
|
||||
{
|
||||
public class FieldVm: ViewModelBase
|
||||
{
|
||||
private string _name;
|
||||
private string _value;
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return _name; }
|
||||
set
|
||||
{
|
||||
MessengerInstance.Send(new EntryFieldNameChangedMessage { OldName = Name, NewName = value, Value = Value });
|
||||
Set(nameof(Name), ref _name, value);
|
||||
}
|
||||
}
|
||||
|
||||
public string Value
|
||||
{
|
||||
get { return _value; }
|
||||
set
|
||||
{
|
||||
MessengerInstance.Send(new EntryFieldValueChangedMessage { FieldName = Name, FieldValue = value });
|
||||
Set(nameof(Value), ref _value, value);
|
||||
}
|
||||
}
|
||||
|
||||
public FieldVm(string fieldName, string fieldValue)
|
||||
{
|
||||
_name = fieldName;
|
||||
_value = fieldValue;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user