private void OnFocusTrackerButtonClick(object sender, RoutedEventArgs e) { this.FocusTrackerButton = (ToolBarToggleButton)sender; var show = this.FocusTrackerButton.IsChecked.Value; if (show) { var vm = new FocusTrackerToolWindowViewModel(); DebugConsoleViewModel.Instance.ToolWindows.Add(vm); vm.Removed += this.OnFocusTrackerRemoved; } else { var vm = DebugConsoleViewModel.Instance.ToolWindows.OfType<FocusTrackerToolWindowViewModel>().First(); vm.Remove(); } }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { this.vm = (FocusTrackerToolWindowViewModel)this.DataContext; vm.FocusTracker = this.FocusVisualizer.FocusTracker; }