Beispiel #1
0
            public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
            {
                object template = Binding.DoNothing;

                if (null != values[0])
                {
                    var editor = DesignObjectWrapperDynamicPropertyEditor.GetEditor((PropertyValue)values[0]);
                    if (null != editor)
                    {
                        template = editor.InlineEditorTemplate;
                    }
                }
                return(template);
            }
Beispiel #2
0
        public override void ShowDialog(PropertyValue propertyValue, IInputElement commandSource)
        {
            //get actual value editor
            var editor = DesignObjectWrapperDynamicPropertyEditor.GetEditor(propertyValue);

            Fx.Assert(editor is DialogPropertyValueEditor, "PropertyValueEditor is not assigned or is not derived from DialogPropertyValueEditor");

            //if we are here, the editor must derive from DialogPropertyEditor, if it doesn't user provided wrong template
            if (editor is DialogPropertyValueEditor)
            {
                try
                {
                    ((DialogPropertyValueEditor)editor).ShowDialog(propertyValue, commandSource);
                }
                catch (Exception err)
                {
                    ErrorReporting.ShowErrorMessage(err.ToString());
                }
            }
        }