Skip to content

Instantly share code, notes, and snippets.

@philcleveland
Last active February 7, 2017 17:44
Show Gist options
  • Save philcleveland/f75213fa3e1412b011e4 to your computer and use it in GitHub Desktop.
Save philcleveland/f75213fa3e1412b011e4 to your computer and use it in GitHub Desktop.
Xamarin ReactiveUI Snippets
public ReactiveCommand<$type$> $name$ { get; private set; }
public static readonly DependencyProperty ViewModelProperty =
DependencyProperty.Register("ViewModel", typeof($classname$Model), typeof($classname$), new PropertyMetadata(null));
public $classname$Model ViewModel
{
get { return ($classname$Model)GetValue(ViewModelProperty); }
set { SetValue(ViewModelProperty, value); }
}
object IViewFor.ViewModel
{
get { return ViewModel; }
set { ViewModel = ($classname$Model)value; }
}
private ObservableAsPropertyHelper<$type$> _$name$;
public $type$ $name$
{
get {return _$name$.Value;}
}
private $type$ _$name$;
public $type$ $name$
{
get {return _$name$;}
set { this.RaiseAndSetIfChanged(ref _$name$, value); }
}
Locator.CurrentMutable.Register(() => new $name$View(), typeof(IViewFor<$name$ViewModel>));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment