public async Task Refresh(int p = -1) { switch (SelectedIndex) { case 0: await ReplyProvider.Refresh(p); break; case 1: await LikeProvider.Refresh(p); break; case 2: await ShareProvider.Refresh(p); break; } }
public async Task SetSelectedIndex(int value) { switch (value) { case -1: return; case 1: if (LikeProvider.Models.Count == 0) { await LikeProvider.Refresh(); } break; case 2: if (ShareProvider.Models.Count == 0) { await ShareProvider.Refresh(); } break; } SelectedIndex = value; }