namespace System.Activities.Presentation.PropertyEditing { using System; using System.Text; using System.Windows; using System.Runtime; /// /// Container for any and all exended editor logic for properties. This class can hold /// two DataTemplates - one for Inline editor and one for Extended editor. /// public class ExtendedPropertyValueEditor : PropertyValueEditor { private DataTemplate _extendedEditorTemplate; /// /// Creates an ExtendedPropertyValueEditor /// public ExtendedPropertyValueEditor() : this(null, null) { } /// /// Creates an ExtendedPropertyValueEditor with the specified extended and inline editor /// DataTemplates /// /// The DataTemplate used for the extended popup/pinned editor. /// When used, its DataContext will be set to a PropertyValue /// The DataTemplate used for the inline editor. /// When used, its DataContext will be set to a PropertyValue public ExtendedPropertyValueEditor(DataTemplate extendedEditorTemplate, DataTemplate inlineEditorTemplate) : base(inlineEditorTemplate) { _extendedEditorTemplate = extendedEditorTemplate; } /// /// The DataTemplate used for the extended popup/pinned editor. /// Its DataContext will be set to a PropertyValue /// [Fx.Tag.KnownXamlExternalAttribute] public DataTemplate ExtendedEditorTemplate { get { return _extendedEditorTemplate; } set { _extendedEditorTemplate = value; } } internal override DataTemplate GetPropertyValueEditor(PropertyContainerEditMode mode) { return base.GetPropertyValueEditor(mode) ?? ((mode == PropertyContainerEditMode.ExtendedPinned || mode == PropertyContainerEditMode.ExtendedPopup) ? _extendedEditorTemplate : (DataTemplate)null); } } }