I have a WPF solution with two projects:
- **MyLibrary** — WPF class library with a custom control and TypeConverter
- **MyApp** — WPF application that references MyLibrary, where I write XAML
I want Ctrl+Space in the XAML editor (in MyApp) to show a dropdown list of suggested values for a custom DependencyProperty.
I implemented a `TypeConverter` with `GetStandardValues`, but **no completion list appears**.
### MyLibrary code
```csharp
public class FieldName
{
public string Value { get; set; } = string.Empty;
public FieldName() { }
public FieldName(string value) =\> Value = value;
public override string ToString() =\> Value;
}
public class FieldNameConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
=\> sourceType == typeof(string) || base.CanConvertFrom(context, sourceType);
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
=\> value is string s ? new FieldName(s) : base.ConvertFrom(context, culture, value);
public override bool GetStandardValuesSupported(ITypeDescriptorContext context) =\> true;
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) =\> false;
public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
=\> new StandardValuesCollection(new\[\] { "AAA", "BBB", "CCC" });
}
public class PropertyAxisBar : Control
{
public static readonly DependencyProperty FieldNameProperty =
DependencyProperty.Register(
nameof(FieldName),
typeof(FieldName),
typeof(PropertyAxisBar),
new PropertyMetadata(new FieldName()));
// Variant 1: TypeConverter on the property
\[TypeConverter(typeof(FieldNameConverter))\]
public FieldName FieldName
{
get =\> (FieldName)GetValue(FieldNameProperty);
set =\> SetValue(FieldNameProperty, value);
}
}
```
I also tested **Variant 2** — `[TypeConverter]` on the class itself:
```csharp
[TypeConverter(typeof(FieldNameConverter))]
public class FieldName { ... }
// no attribute on the property
public FieldName FieldName { ... }
```
**Neither variant works** — Ctrl+Space shows no completion list in XAML editor.
### MyApp XAML
```xml
```
### What I verified
- `Brush` property on the same control **does** show a completion list (SystemBrushes) — so IntelliSense works in general
- `GetStandardValues` breakpoint is **never hit** when pressing Ctrl+Space in XAML editor
- VS2022, .NET 8, WPF
### Question
Does VS2022 XAML editor call `TypeConverter.GetStandardValues` at all for custom types?
If not — what is the correct way to provide a custom completion list for a DependencyProperty value in the XAML editor?
Is a separate `.Design` assembly with `IProvideAttributeTable` the only option?