mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
New boolean to visibility converter Base class to handle property changes notifications for all View Models Template selector to handle a different first item in listviews or gridviews
38 lines
988 B
C#
38 lines
988 B
C#
using System.Collections.ObjectModel;
|
|
using ModernKeePass.Common;
|
|
|
|
namespace ModernKeePass.ViewModels
|
|
{
|
|
public class RecentVm : NotifyPropertyChangedBase
|
|
{
|
|
private RecentItemVm _selectedItem;
|
|
private ObservableCollection<RecentItemVm> _recentItems;
|
|
|
|
public ObservableCollection<RecentItemVm> RecentItems
|
|
{
|
|
get { return _recentItems; }
|
|
set { SetProperty(ref _recentItems, value); }
|
|
}
|
|
|
|
public RecentItemVm SelectedItem
|
|
{
|
|
get { return _selectedItem; }
|
|
set
|
|
{
|
|
if (_selectedItem == value) return;
|
|
if (_selectedItem != null)
|
|
{
|
|
_selectedItem.IsSelected = false;
|
|
}
|
|
|
|
SetProperty(ref _selectedItem, value);
|
|
|
|
if (_selectedItem != null)
|
|
{
|
|
_selectedItem.IsSelected = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|