Skip to content

Instantly share code, notes, and snippets.

@tuyen-vuduc
Created March 7, 2017 04:32
Show Gist options
  • Save tuyen-vuduc/071fcfb6326fe518c994dd7a74aa7ac5 to your computer and use it in GitHub Desktop.
Save tuyen-vuduc/071fcfb6326fe518c994dd7a74aa7ac5 to your computer and use it in GitHub Desktop.
MVVM C# Shortcut
ObservableCollection<$Type$> _$Name$;
public ObservableCollection<$Type$> $Name$
{
get { return _$Name$; }
set
{
if (ReferenceEquals(_$Name$, value)) return;
_$Name$ = value;
OnPropertyChanged();
}
}
$Type$ _$Name$;
public $Type$ $Name$
{
get { return _$Name$; }
set
{
if (Equals(_$Name$, value)) return;
_$Name$ = value;
OnPropertyChanged();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment