private async void ApplyLastState(LastState state, WorkInProgress wip) { if (state != null) { if (state.Group != null && GroupComboBox.HasItems && GroupComboBox.Items.Contains(state.Group)) { GroupComboBox.SelectedItem = state.Group; } if (await client.UpdateFiles()) { if (state.Path != null && FileListView.ItemsSource is ObservableCollection <FileItem> ff) { var f = ff.Where(x => x.Path == state.Path).FirstOrDefault(); if (f != null) { FileListView.SelectedItem = f; FileListView.ScrollIntoView(f); } } UpdateViewMenus(); } else { wip.SetFinalContent(Properties.Resources.InitializationFailure); } } UpdateStatusBar(new TimeSpan(0, 0, 10)); }
private WorkInProgress RequestInProgress(string message = null) { var wip = WorkInProgress.Create() .DisableControl(FileUrlMenuItem) .DisableControl(FileAuthMenuItem) .DisableControl(EditReloadGroupsMenuItem) .EnableControl(EditCancelRequestMenuItem) .DisableControl(ViewCheckMenuItem) .DisableControl(ViewUncheckMenuItem) .DisableControl(ViewClearMenuItem) .DisableControl(QueryTextBox) .DisableControl(QueryButton); if (!statusBarDelay.IsScheduled) { wip.SetContentControl(StatusBarLabel) .SetContent(message ?? Properties.Resources.WaitingForResponse); } return(wip); }