Skip to content

Commit 5618b65

Browse files
committed
feat: Add SelectionItem API
1 parent 6323f7c commit 5618b65

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.github/workflows/linux.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ jobs:
3737
uses: t1m0thyj/unlock-keyring@v1
3838
- name: "Setup Environment"
3939
run: |
40-
sudo apt-get install xdg-user-dirs xdg-user-dirs-gtk gettext tzdata locales libnotify-dev libsecret-tools notification-daemon xvfb -y
40+
export DEBIAN_FRONTEND=noninteractive
41+
sudo rm -rf /var/lib/apt/lists/*
42+
sudo apt-get clean
43+
sudo apt-get update
44+
sudo apt-get install -y xdg-user-dirs xdg-user-dirs-gtk gettext tzdata locales libnotify-dev libsecret-tools notification-daemon xvfb
4145
xdg-user-dirs-update
4246
xdg-user-dirs-gtk-update
4347
sudo locale-gen en_US.UTF-8
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.ComponentModel;
2+
3+
namespace Nickvision.Desktop.Application;
4+
5+
public interface ISelectionItem : INotifyPropertyChanged
6+
{
7+
string Label { get; }
8+
bool ShouldSelect { get; }
9+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.ComponentModel;
2+
using System.Runtime.CompilerServices;
3+
4+
namespace Nickvision.Desktop.Application;
5+
6+
public class SelectionItem<T> : ISelectionItem
7+
{
8+
public T Value { get; }
9+
public string Label { get; }
10+
public bool ShouldSelect { get; }
11+
12+
public event PropertyChangedEventHandler? PropertyChanged;
13+
14+
public SelectionItem(T value, string label, bool shouldSelect)
15+
{
16+
Value = value;
17+
Label = label;
18+
ShouldSelect = shouldSelect;
19+
}
20+
21+
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
22+
}

0 commit comments

Comments
 (0)