
Is there any examples in question?
In particular for ComboBoxPropertyEditor and DialogTextBoxPropertyEditor.
Thanks,
Alex
In particular for ComboBoxPropertyEditor and DialogTextBoxPropertyEditor.
Thanks,
Alex
[Editor(typeof(ComboBoxPropertyEditor), typeof(PropertyEditor))]
public string MyProperty { ... }
PropertyEditor propertyEditor = new PropertyEditor() {
PropertyName = "MyProperty",
ValueTemplateKey = BuiltinEditors.ComboBoxValueTemplateKey
};
this.propGrid.PropertyEditors.Add(propertyEditor);
IPropertyDataAccessor propertyDataAccessor = VisualTreeHelperExtended.GetCurrentOrAncestor(container, typeof(IPropertyDataAccessor)) as IPropertyDataAccessor;
if (propertyDataAccessor == null)
return null;
// Check propertyDataAccessor.ValueName or ValueType
<DataTemplate x:Key="{x:Static propgrid:BuiltinEditors.DialogTextBoxValueTemplateKey}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Text="{Binding ValueAsString, ... }" />
<shared:PopupButton Grid.Column="1" Content="..." DisplayMode="ButtonOnly" IsTransparencyModeEnabled="True"
Command="{x:Static propgrid:PropertyGrid.ShowPropertyDialogCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}" />
</Grid>
</DataTemplate>
Please log in to a validated account to post comments.