private void SetConsole(object sender, MouseButtonEventArgs e) { // Stop the timer from ticking. myClickWaitTimer.Stop(); e.Handled = true; Button button = sender as Button; MainViewModel.System system = button.DataContext as MainViewModel.System; MainViewModel vm = this.DataContext as MainViewModel; if (vm.FoundSystems.Count(x => x.IsVisible) == 1 && vm.FoundSystems.First(x => x.IsVisible).Name == system.Name) { foreach (var x in vm.FoundSystems) { x.IsVisible = true; } } else { foreach (var x in vm.FoundSystems) { x.IsVisible = x.Name == system.Name; } } vm.UpdateVisibleTitles(); }
private void mouseWaitTimer_Tick(object sender, EventArgs e) { myClickWaitTimer.Stop(); // Handle Single Click Actions Button button = sender as Button; MainViewModel.System system = button.DataContext as MainViewModel.System; MainViewModel vm = this.DataContext as MainViewModel; vm.FoundSystems.First(x => x.Name == system.Name).IsVisible = !vm.FoundSystems.First(x => x.Name == system.Name).IsVisible; vm.UpdateVisibleTitles(); }