private async void OnItemSelected(object sender, SelectedItemChangedEventArgs e) { ResourceFileData resourceFileData = e.SelectedItem as ResourceFileData; if (resourceFileData == null) { return; } switch (resourceFileData.Type) { case ResourceType.Txt: await Navigation.PushModalAsync(new DetailPage(e.SelectedItem, _textFileReader)); break; case ResourceType.Image: await Navigation.PushModalAsync(new ImagePage(e.SelectedItem)); break; default: throw new ArgumentOutOfRangeException(); } }
public MainPage(ITextFileReader textFileReader) { _textFileReader = textFileReader; InitializeComponent(); nativeListView.Items = ResourceFileData.GetList(); }