提交 8478f635 编写于 作者: D David Poeschl

Make IntellisenseTextBox LabeledBy work

上级 4277d623
......@@ -4,7 +4,9 @@
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Interop;
using System.Windows.Media;
using Microsoft.VisualStudio.ComponentModelHost;
......@@ -294,6 +296,9 @@ private void InitializeEditorControl(IntellisenseTextBoxViewModel viewModel, Con
IVsEditorAdaptersFactoryService editorAdapterFactory = componentModel.GetService<IVsEditorAdaptersFactoryService>();
this._textViewHost = editorAdapterFactory.GetWpfTextViewHost(viewModel.VsTextView);
BindingOperations.SetBinding(_textViewHost.HostControl, AutomationProperties.NameProperty, new Binding { Source = container, Path = new PropertyPath(AutomationProperties.NameProperty) });
BindingOperations.SetBinding(_textViewHost.HostControl, AutomationProperties.LabeledByProperty, new Binding { Source = container, Path = new PropertyPath(AutomationProperties.LabeledByProperty) });
// For non-blurry text
TextOptions.SetTextFormattingMode(this._textViewHost.HostControl, TextFormattingMode.Display);
this._textViewHost.HostControl.Loaded += this.HostControl_Loaded;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册