private void OnIsEditingChangedToFalse()
        {
            if (!isEditStarted)
            {
                return;
            }

            var e = new EditableContentEventArgs <T>(DisplayContent.Value.Value, EditContent.Value.Value);

            if (isEditCompleted)
            {
                OnEditCompleted(e);
            }
            else
            {
                OnEditCanceled(e);
            }

            ToDisplay();

            isEditStarted = false;
        }
Пример #2
0
        /// <summary>
        /// Sets the value from the edit content to the display content and
        /// raises the <see cref="EditableContentProperty{T}.EditCompleted"/> event with the specified event data.
        /// </summary>
        /// <param name="e">The event data.</param>
        protected override void OnEditCompleted(EditableContentEventArgs <T> e)
        {
            DisplayContent.Value.Value = EditContent.Value.Value;

            base.OnEditCompleted(e);
        }
Пример #3
0
        /// <summary>
        /// Sets the value from the display content to the edit content and
        /// raises the <see cref="EditableContentProperty{T}.EditStarted"/> event with the specified event data.
        /// </summary>
        /// <param name="e">The event data.</param>
        protected override void OnEditStarted(EditableContentEventArgs <string> e)
        {
            EditContent.Value.Value = DisplayContent.Value.Value;

            base.OnEditStarted(e);
        }
 /// <summary>
 /// Raises the <see cref="EditCanceled"/> event with the specified event data.
 /// </summary>
 /// <param name="e">The event data.</param>
 protected virtual void OnEditCanceled(EditableContentEventArgs <T> e) => EditCanceled?.Invoke(this, e);