Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public class ReactiveFodyViewModel : ReactiveObject
{
public ReactiveCommand<Unit, Unit> Clear { get; }
[ObservableAsProperty]
public string Greeting { get; }
[Reactive]
public string Name { get; set; } = string.Empty;
public ReactiveFodyViewModel()
{
Clear = ReactiveCommand.Create(() => { Name = string.Empty; });
this.WhenAnyValue(x => x.Name)
.Select(name => $"Hello, {name}!")
.ToPropertyEx(this, x => x.Greeting);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment