Skip to content

Instantly share code, notes, and snippets.

@Char0394
Last active October 28, 2020 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Char0394/5099221e476bf0e18e9415f4f695ca46 to your computer and use it in GitHub Desktop.
Save Char0394/5099221e476bf0e18e9415f4f695ca46 to your computer and use it in GitHub Desktop.
public class MainPageViewModel : INotifyPropertyChanged
{
public ICommand SelectItemCommand { get => new Command<string>((param) => PositionSelected = int.Parse(param)); }
public int _positionSelected = 0;
public int PositionSelected
{
set
{
if (_positionSelected != value)
{
_positionSelected = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(PositionSelected)));
}
}
get => _positionSelected;
}
public event PropertyChangedEventHandler PropertyChanged;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment