private void ExecuteSaveAgentStateCommand(object obj) { AgentProgressInfo = string.Format("Saving Agent States..."); ShowAll = Visibility.Collapsed; ShowAgentProgress = Visibility.Visible; AgentVisibility = Visibility.Collapsed; System.Threading.Tasks.Task.Factory.StartNew(() => { Hide.Name = HideOrDisable.ToString(); Hide.Description = string.Empty; AgentStates.Add(Hide); ScreenPopConfigModel.Instance.SaveAgentStates(AgentStates.ToList()); ExecuteSaveScreentSettings(new object()); BindAgentStates(); }).ContinueWith((wait) => { ShowAgentProgress = Visibility.Collapsed; AgentVisibility = Visibility.Visible; ShowAll = Visibility.Visible; }); }
private void UpdateTabItem(int index) { if (index == 1) { AgentStates.Clear(); tempAgents.ToList().ForEach(x => { if (!x.DefaultName.Equals("Buttons")) { AgentStates.Add(x); } }); Hide = tempAgents.FirstOrDefault(p => p.DefaultName == "Buttons"); HideOrDisable = Hide.Name.Equals("true", StringComparison.OrdinalIgnoreCase) ? true : false; } }