コード例 #1
0
        private void OnTextChanged(object sender, RoutedEventArgs e)
        {
            EditableTextBlock Ctrl = sender as EditableTextBlock;

            if (Ctrl != null)
            {
                StringPropertyEntry Entry = Ctrl.DataContext as StringPropertyEntry;
                if (Entry != null)
                {
                    Entry.UpdateText(Ctrl.Text);
                }
            }
        }
コード例 #2
0
 /// <param name="routedEvent">The event this argument is associated to.</param>
 /// <param name="source">The control from which editing is left.</param>
 /// <param name="Text">The current content of the control.</param>
 /// <param name="Cancellation">A token to hold cancellation information.</param>
 internal EditableTextBlockEventArgs(RoutedEvent routedEvent, EditableTextBlock source, string Text, CancellationToken Cancellation)
     : base(routedEvent, source)
 {
     this.Text         = Text;
     this.Cancellation = Cancellation;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EditLeaveEventArgs"/> class.
 /// If IsEditCanceled is true, the IsCanceled member will be ignored by the sender.
 /// </summary>
 /// <param name="routedEvent">The event this argument is associated to.</param>
 /// <param name="source">The control from which editing is left.</param>
 /// <param name="text">The current content of the control.</param>
 /// <param name="cancellation">A token to hold cancellation information.</param>
 /// <param name="isEditCanceled">A value that indicates if editing has been canceled.</param>
 internal EditLeaveEventArgs(RoutedEvent routedEvent, EditableTextBlock source, string text, CancellationToken cancellation, bool isEditCanceled)
     : base(routedEvent, source, text, cancellation)
 {
     IsEditCanceled = isEditCanceled;
 }
コード例 #4
0
        /// <summary>
        /// Called when the <see cref="IsEditing"/> dependency property is changed on <paramref name="modifiedObject"/>.
        /// </summary>
        /// <param name="modifiedObject">The object that had its property modified.</param>
        /// <param name="e">Information about the change.</param>
        private static void OnIsEditingChanged(DependencyObject modifiedObject, DependencyPropertyChangedEventArgs e)
        {
            EditableTextBlock ctrl = (EditableTextBlock)modifiedObject;

            ctrl.OnIsEditingChanged();
        }
コード例 #5
0
 /// <summary>
 ///     If IsEditCanceled is true, the IsCanceled member will be ignored by the sender.
 /// </summary>
 /// <param name="routedEvent">The event this argument is associated to.</param>
 /// <param name="source">The control from which editing is left.</param>
 /// <param name="Text">The current content of the control.</param>
 /// <param name="Cancellation">A token to hold cancellation information.</param>
 /// <param name="IsEditCanceled">A value that indicates if editing has been canceled.</param>
 internal EditLeaveEventArgs(RoutedEvent routedEvent, EditableTextBlock source, string Text, CancellationToken Cancellation, bool IsEditCanceled)
     : base(routedEvent, source, Text, Cancellation)
 {
     this.IsEditCanceled = IsEditCanceled;
 }
コード例 #6
0
        private void OnTextMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            EditableTextBlock Ctrl = (EditableTextBlock)sender;

            Ctrl.IsEditing = true;
        }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EditableTextBlockEventArgs"/> class.
 /// </summary>
 /// <param name="routedEvent">The event this argument is associated to.</param>
 /// <param name="source">The control from which editing is left.</param>
 /// <param name="text">The current content of the control.</param>
 /// <param name="cancellation">A token to hold cancellation information.</param>
 internal EditableTextBlockEventArgs(RoutedEvent routedEvent, EditableTextBlock source, string text, CancellationToken cancellation)
     : base(routedEvent, source)
 {
     Text         = text;
     Cancellation = cancellation;
 }