-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the "Description" column in Code Styles Options a "dataitem" control #18441
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ internal abstract class AbstractCodeStyleOptionViewModel : AbstractNotifyPropert | |
public string Description { get; set; } | ||
public double DescriptionMargin { get; set; } = 12d; | ||
public string GroupName { get; set; } | ||
public string GroupNameAndDescription { get; set; } | ||
public List<CodeStylePreference> Preferences { get; set; } | ||
public List<NotificationOptionViewModel> NotificationPreferences { get; set; } | ||
|
||
|
@@ -56,6 +57,7 @@ public AbstractCodeStyleOptionViewModel( | |
Preferences = preferences ?? GetDefaultPreferences(); | ||
NotificationPreferences = notificationPreferences ?? GetDefaultNotifications(); | ||
GroupName = groupName; | ||
GroupNameAndDescription = $"{groupName}, {description}"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We were getting around concatenating these before in a seriously ugly way. I can explain if needed. This is much better and actually sets the automation name to the full thing (whereas before we were just tricking Narrator into reading the right thing instead of setting the automation name correctly). |
||
} | ||
|
||
private static List<NotificationOptionViewModel> GetDefaultNotifications() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Windows.Automation.Peers; | ||
using System.Windows.Controls; | ||
|
||
namespace Microsoft.VisualStudio.LanguageServices.Implementation.Options | ||
{ | ||
internal class TextBlockWithDataItemControlType : TextBlock | ||
{ | ||
protected override AutomationPeer OnCreateAutomationPeer() | ||
{ | ||
return new TextBlockWithDataItemControlTypeAutomationPeer(this); | ||
} | ||
|
||
private class TextBlockWithDataItemControlTypeAutomationPeer : TextBlockAutomationPeer | ||
{ | ||
public TextBlockWithDataItemControlTypeAutomationPeer(TextBlock owner) : base(owner) | ||
{ | ||
} | ||
|
||
protected override AutomationControlType GetAutomationControlTypeCore() | ||
{ | ||
return AutomationControlType.DataItem; | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left everything the same as the "Setter" elements before, with the exceptions of "Text", "AutomationProperties.Name", and "Focusable".