Created
September 28, 2016 12:50
-
-
Save lisardggY/bff0c227b770d437eb6914fd2d91089c to your computer and use it in GitHub Desktop.
Selectable view model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Selectable<T> : ViewModelBase | |
{ | |
private bool _isSelected; | |
public Selectable(T item) | |
{ | |
Item = item; | |
IsSelected = false; | |
} | |
public T Item { get; private set; } | |
public bool IsSelected | |
{ | |
get { return _isSelected; } | |
set | |
{ | |
if (Equals(_isSelected, value)) | |
{ | |
return; | |
} | |
_isSelected = value; | |
OnPropertyChanged(() => IsSelected); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment