/// <summary> /// Tries to fetch a given path and refreshes the views. /// </summary> /// <param name="path"></param> private void FetchStructure(string path) { string viewMode = _views[_viewIndex]; _workingPath = path; progress.IsVisible = true; progress.Text = "Fetching Structure..."; switch (viewMode) { case "tile": DetailList.Hide(); DetailList.Items.Clear(); TileViewContainer.Show(); // fadeout existig from tile view if (TileView.Children.Count == 0) { StartRequest(); } else { int itemsLeft = TileView.Children.Count; foreach (FrameworkElement item in TileView.Children) { item.FadeOut(100, () => { --itemsLeft; if (itemsLeft <= 0) { TileView.Children.Clear(); StartRequest(); } }); } } break; case "detail": TileViewContainer.Hide(); DetailList.Show(); // fadeout existing from detail view if (DetailList.Items.Count == 0) { StartRequest(); } else { int detailItemsLeft = DetailList.Items.Count; foreach (FrameworkElement item in DetailList.Items) { item.FadeOut(100, () => { --detailItemsLeft; if (detailItemsLeft <= 0) { DetailList.Items.Clear(); StartRequest(); } }); } } break; } // start overlay }
/// <summary> /// Tries to fetch a given path and refreshes the views. /// </summary> /// <param name="path"></param> private void FetchStructure(string path) { string viewMode = _views[_viewIndex]; _workingPath = path; if (_overlay == null) { _overlay = new ProgressOverlayPopup() { BackgroundColor = Colors.Transparent }; } switch (viewMode) { case "tile": DetailList.Hide(); DetailList.Items.Clear(); TileViewContainer.Show(); // fadeout existig from tile view if (TileView.Children.Count == 0) { _overlay.Show(); StartRequest(); } else { int itemsLeft = TileView.Children.Count; foreach (FrameworkElement item in TileView.Children) { item.FadeOut(100, () => { --itemsLeft; if (itemsLeft <= 0) { _overlay.Show(); TileView.Children.Clear(); StartRequest(); } }); } } break; case "detail": TileViewContainer.Hide(); DetailList.Show(); // fadeout existing from detail view if (DetailList.Items.Count == 0) { _overlay.Show(); StartRequest(); } else { int detailItemsLeft = DetailList.Items.Count; foreach (FrameworkElement item in DetailList.Items) { item.FadeOut(100, () => { --detailItemsLeft; if (detailItemsLeft <= 0) { _overlay.Show(); DetailList.Items.Clear(); StartRequest(); } }); } } break; } // start overlay }