public SliceVisualizerControl(IToolWindowIntegration integration) { _context = integration.GetSliceVisualizerContext(); DataContext = _context; InitializeComponent(); var tableFontAndColor = new FontAndColorProvider(); _table = new SliceVisualizerTable(_context, tableFontAndColor); TableHost.Setup(_table); }
public VisualizerControl(IToolWindowIntegration integration, ActivateWindow activateWindow) { _context = integration.GetVisualizerContext(); _context.PropertyChanged += ContextPropertyChanged; _context.GroupFetched += GroupFetched; _context.GroupFetching += SetupDataFetch; _context.CellSelectionEvent += CellSelected; DataContext = _context; InitializeComponent(); _wavemap = new WavemapImage(HeaderHost.WavemapImage, _context); _wavemap.NavigationRequested += NavigateToWave; HeaderHost.WavemapSelector.Setup(_context, _wavemap); _activateWindow = activateWindow; _integration = integration; _integration.AddWatch += AddWatch; PropertyChangedEventManager.AddHandler(_context.Options.VisualizerOptions, OptionsChanged, ""); PropertyChangedEventManager.AddHandler(_context.Options.DebuggerOptions, OptionsChanged, ""); PropertyChangedEventManager.AddHandler(_context.Options.VisualizerAppearance, OptionsChanged, ""); PropertyChangedEventManager.AddHandler(_context.Options.VisualizerColumnStyling, VisualizerColumnStylingPropertyChanged, ""); _fontAndColorProvider = new FontAndColorProvider(); _fontAndColorProvider.FontAndColorInfoChanged += RefreshDataStyling; _table = new VisualizerTable( _context.Options, _fontAndColorProvider, getValidWatches: () => _context?.BreakData?.Watches); _table.WatchStateChanged += (newWatchState, invalidatedRows) => { _context.Options.DebuggerOptions.Watches.Clear(); _context.Options.DebuggerOptions.Watches.AddRange(newWatchState); if (invalidatedRows != null) { foreach (var row in invalidatedRows) { SetRowContentsFromBreakState(row); } } }; _table.SetScalingMode(_context.Options.VisualizerAppearance.ScalingMode); TableHost.Setup(_table); RestoreSavedState(); }