Add option to hide TimeStamp columns in EventWindow View menu#2247
Merged
Add option to hide TimeStamp columns in EventWindow View menu#2247
Conversation
Co-authored-by: brianrob <[email protected]>
Copilot
AI
changed the title
[WIP] Provide the option to remove TimeStamp column from the Events page in PerfView
Add option to hide TimeStamp columns in EventWindow View menu
Jun 26, 2025
brianrob
reviewed
Jun 26, 2025
| } | ||
|
|
||
| private void DoUseOriginTime(object sender, RoutedEventArgs e) | ||
| private void DoShowTimeStampColumns(object sender, RoutedEventArgs e) |
Member
There was a problem hiding this comment.
When testing there is a NullReferenceException thrown by this method:
System.NullReferenceException: Object reference not set to an instance of an object.
at PerfView.EventWindow.DoShowTimeStampColumns(Object sender, RoutedEventArgs e)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.MenuItem.OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteEndMember()
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at PerfView.EventWindow..ctor(Window parent, PerfViewEventSource data)
at PerfView.PerfViewEventSource.<>c__DisplayClass15_0.<Open>b__1()
at PerfView.StatusBar.<>c__DisplayClass23_0.<EndWork>b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Contributor
Author
There was a problem hiding this comment.
Fixed the NullReferenceException by adding null checks in both DoShowTimeStampColumns and DoHideTimeStampColumns methods. The issue occurred because these event handlers were being triggered during XAML initialization when UI elements weren't fully constructed yet. Commit 6399125.
…ialization Co-authored-by: brianrob <[email protected]>
Member
|
Copilot Post-Mortem:
|
marklio
approved these changes
Jun 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the ability to hide/show TimeStamp columns in PerfView's Events page as requested in the issue. The implementation provides a new menu option in the View dropdown and properly handles the interaction with the existing timezone selection.
Changes Made
New Feature
Implementation Details
DoShowTimeStampColumns()andDoHideTimeStampColumns()methodsDoUseLocalTime()andDoUseOriginTime()to respect column visibilityUser Experience
App.UserConfigData["EventWindowShowTimeStampColumns"]and persists across sessionsMenu Structure
Example Usage
This addresses the scenario where timestamp columns are redundant and provides users with a cleaner view when timestamp information is not needed.
Fixes #2246.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.