void IValueProvider.SetValue(string value) { if (value == null) { throw new ArgumentNullException("value"); } if (!IsEnabled()) { throw new ElementNotEnabledException(); } PageTextBox owner = (PageTextBox)Owner; if (owner.IsReadOnly) { throw new ElementNotEnabledException(); } if (owner.IsValidInputString(value)) { owner.Text = value; owner._isEditingText = true; owner.OnPageNumberEdited(); } }
/// <summary> /// Constructor /// </summary> /// <param name="owner">Owner of the AutomationPeer.</param> public PageTextBoxAutomationPeer(PageTextBox owner) : base(owner) { }
/// <summary> /// Callback for the PageNumber DependencyProperty. When this event is fired /// PageTextBox updates the page number it is displaying. /// </summary> /// <param name="d">The PageTextBox to update.</param> /// <param name="e">The associated arguments.</param> private static void OnPageNumberChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PageTextBox PageTextBox = (PageTextBox)d; PageTextBox.SetPageNumber((int)e.NewValue); }