private async Task setLocalList(string path) { LocalList.IsEnabled = false; if (await LocalHelper.SetItemsAsync(path)) { if (LocalHelper.CurrentPath != LocalHelper.LastPath) { TextBoxLocalPath.Text = LocalHelper.CurrentPath; LocalBackForthStack.Save(LocalHelper.LastPath, LocalHelper.CurrentPath); } ButtonLocalBack.IsEnabled = LocalBackForthStack.CanBack; ButtonLocalForward.IsEnabled = LocalBackForthStack.CanForth; ButtonLocalHome.IsEnabled = (path != LocalHelper.Home); ButtonLocalUp.IsEnabled = !LocalHelper.ParentPath.NullEmpty(); LocalList.UnselectAll(); } LocalList.Focus(); LocalList.ItemsSource = LocalHelper.Items; if (LocalHelper.Items.Count > 0) { MenuItemLocalSelectAll.IsEnabled = true; LocalList.ScrollIntoView(LocalHelper.Items[0]); } LocalList.UnselectAll(); LocalList.IsEnabled = true; GC.Collect(); }
private void ButtonLocalForward_ToolTipOpening(object sender, ToolTipEventArgs e) { string peek = LocalBackForthStack.PeekForth(); if (!peek.NullEmpty()) { ButtonLocalForward.ToolTip = AppLanguage.Get("LangTextForwardToX").FormatC(peek); } else { ButtonLocalForward.ToolTip = AppLanguage.Get("LangTextForward"); } }
private async void localGoForward() { await setLocalList(LocalBackForthStack.Forth()); }
private async void localGoBack() { await setLocalList(LocalBackForthStack.Back()); }