Example #1
0
        /// <summary>
        /// Creates a control based on a template from a a <see cref="TypeEditor" />.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <param name="editor">The editor.</param>
        /// <returns>
        /// A <see cref="ContentControl" />.
        /// </returns>
        protected virtual ContentControl CreateEditorControl(PropertyItem property, TypeEditor editor)
        {
            var c = new ContentControl
            {
                ContentTemplate     = editor.EditorTemplate,
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Left
            };

            c.SetBinding(FrameworkElement.DataContextProperty, property.CreateOneWayBinding());
            return(c);
        }
 /// <summary>
 /// Creates a control based on a template from a a <see cref="TypeEditor" />.
 /// </summary>
 /// <param name="property">The property.</param>
 /// <param name="editor">The editor.</param>
 /// <returns>
 /// A <see cref="ContentControl" />.
 /// </returns>
 protected virtual ContentControl CreateEditorControl(PropertyItem property, TypeEditor editor)
 {
     var c = new ContentControl
     {
         ContentTemplate = editor.EditorTemplate,
         VerticalAlignment = VerticalAlignment.Center,
         HorizontalAlignment = HorizontalAlignment.Left
     };
     c.SetBinding(FrameworkElement.DataContextProperty, property.CreateOneWayBinding());
     return c;
 }