Created
January 25, 2021 20:32
-
-
Save rdelrosario/b5b019b6835f1e291e353890b94e8c51 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
namespace DynamicDataGroupingSample | |
{ | |
public class MainViewModel : ReactiveObject, IDisposable | |
{ | |
public MainViewModel() | |
{ | |
SortCommand = ReactiveCommand.CreateFromTask(ExecuteSort); | |
} | |
private async Task ExecuteSort() | |
{ | |
var sort = await App.Current.MainPage.DisplayActionSheet("Sort by", "Cancel", null, buttons: new string[] { "Name", "Type" }); | |
if (sort != "Cancel") | |
{ | |
SortBy = sort; | |
} | |
} | |
private string SortBy | |
{ | |
get => _sortBy; | |
set => this.RaiseAndSetIfChanged(ref _sortBy, value); | |
} | |
public ReactiveCommand<Unit, Unit> SortCommand { get; } | |
private string _sortBy; | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment