Skip to content

Database and server names containing underscores render wrong in the Excluded Databases and Manage Tags pickers #1857

Description

@erikdarlingdata

Found by the access-key audit in #1847, which fixed the same defect where the labels are static text but could not fix it where the label is data-bound.

WPF reads a single _ in a ContentControl's Content as an access-key marker: the character is removed from the rendered label and the following letter claims an Alt key. That applies to BOUND content exactly as it does to literals, and three checkboxes bind a user-supplied name straight into Content:

  • Lite/Windows/ExcludedDatabasesDialog.xaml:31 - <CheckBox Content="{Binding DisplayName}" (database names)
  • Darling/PerformanceMonitor.Darling.Viewer/ExcludedDatabasesDialog.xaml:34 - same (database names)
  • Darling/PerformanceMonitor.Darling.Viewer/ManageTagsWindow.xaml:93 - same (server names)

Underscores are extremely common in database names, so a database called Prod_Reporting renders in the Excluded Databases picker as ProdReporting with the R underlined - a name that does not match anything the user typed, in the one dialog whose whole job is picking databases by name. It also registers a stray Alt+R against that row, and a list of such names registers a pile of duplicate keys, which is the "Alt+key cycles focus instead of pressing anything" degradation #1847's audit exists to prevent.

Fix is one of:

  • wrap the bound value in a TextBlock as the checkbox's nested content (TextBlock.Text does not parse access keys), or
  • retemplate the checkbox's ContentPresenter with RecognizesAccessKey="False".

Either is a template edit rather than a Content-only edit, which is why it was left out of #1847's Content-and-IsCancel scope. Worth a quick sweep for any other Content="{Binding on a ContentControl at the same time - those three are the ones in the dialogs today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions