本文整理汇总了C#中Windows.UI.Xaml.Controls.TextBox.AddHandler方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.AddHandler方法的具体用法?C# TextBox.AddHandler怎么用?C# TextBox.AddHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.AddHandler方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnApplyTemplate
protected override void OnApplyTemplate()
{
container = this.GetTemplateChild(ContainerName) as Grid;
textBox = this.GetTemplateChild(TextBoxName) as TextBox;
inkCanvas = this.GetTemplateChild(InkCanvasName) as InkCanvas;
inkBorder = this.GetTemplateChild(InkBorderName) as Border;
inkWindow = this.GetTemplateChild(InkWindowName) as Popup;
inkRecognizerContainer = new InkRecognizerContainer();
recognizers = inkRecognizerContainer.GetRecognizers();
// Set the text services so we can query when language changes
textServiceManager = CoreTextServicesManager.GetForCurrentView();
textServiceManager.InputLanguageChanged += TextServiceManager_InputLanguageChanged;
SetDefaultRecognizerByCurrentInputMethodLanguageTag();
// Create a timer that expires after 1 second
recognitionTimer = new DispatcherTimer();
recognitionTimer.Interval = new TimeSpan(0, 0, 1);
recognitionTimer.Tick += RecoTimer_Tick;
pointerTimer = new DispatcherTimer();
pointerTimer.Interval = new TimeSpan(0, 0, 2);
pointerTimer.Tick += PointerTimer_Tick;
textBox.PointerEntered += TextBox_PointerEntered;
textBox.AddHandler(PointerPressedEvent, new PointerEventHandler(TextBox_PointerPressed), true);
textBox.SelectionChanged += TextBox_SelectionChanged;
inkCanvas.PointerEntered += InkCanvas_PointerEntered;
inkCanvas.InkPresenter.StrokesCollected += InkCanvas_StrokesCollected;
inkCanvas.InkPresenter.StrokeInput.StrokeStarted += InkCanvas_StrokeStarted;
inkCanvas.InkPresenter.StrokesErased += InkPresenter_StrokesErased;
// Initialize drawing attributes. These are used in inking mode.
InkDrawingAttributes drawingAttributes = new InkDrawingAttributes();
drawingAttributes.Color = InkColor;
double penSize = PenSize;
drawingAttributes.Size = new Windows.Foundation.Size(penSize, penSize);
drawingAttributes.IgnorePressure = false;
drawingAttributes.FitToCurve = true;
// Initialize the InkCanvas
inkCanvas.InkPresenter.UpdateDefaultDrawingAttributes(drawingAttributes);
inkCanvas.InkPresenter.InputDeviceTypes = Windows.UI.Core.CoreInputDeviceTypes.Pen;
//InputPane inputPane = InputPane.GetForCurrentView();
//inputPane.Showing += InputPane_Showing;
this.SizeChanged += InkTextBox_SizeChanged;
enableText();
base.OnApplyTemplate();
}