dotnet / dotnet/wpf

Intellisense Fails to Display Abstract Classes for RelativeSource Binding in WPF

Open
#8,384 6 comments 0 reactions 0 assignees View on GitHub
needs more information
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### Description

In WPF applications, when using RelativeSource binding, Intellisense does not display abstract classes in the suggestion list while it does show concrete classes. This issue occurs in the Visual Studio 2022 Preview's XAML editing process. If an abstract class name is entered manually, the runtime binding functions correctly, indicating that the problem is limited to the Intellisense feature in the editor.

### Reproduction Steps

1. Open a WPF project in Visual Studio 2022 Preview.
2. Navigate to a XAML file and start typing a binding.
3. Observe that Intellisense does not suggest abstract classes when specifying the type for RelativeSource.
4. Manually enter the name of an abstract class and run the application to verify that the binding works correctly at runtime.

```xaml

```

```csharp
public abstract class JamesContent
{

}
```

### Expected behavior

Intellisense should list both abstract and concrete classes when specifying the type for RelativeSource in a WPF application's XAML file, aiding in the binding setup process.

### Actual behavior

Intellisense omits abstract classes from the suggestion list when specifying the type for RelativeSource. There are no error messages or exception stack traces as the application executes as expected when the class name is manually entered.

### Regression?

Intellisense omits abstract classes from the suggestion list when specifying the type for RelativeSource. There are no error messages or exception stack traces as the application executes as expected when the class name is manually entered.

### Known Workarounds

The current workaround involves manually typing the full name of the abstract class when using RelativeSource binding.

### Impact

The impact primarily affects developer experience, potentially causing confusion and slowing down the development process when using abstract classes in XAML bindings. It impacts developers who rely on Intellisense for coding assistance in WPF applications.

### Configuration

1. .NET Version: .NET 7.0
2. OS and version: Windows 11
3. Architecture: AnyCPU
4. Impact specific to configuration unknown: The issue has been observed in the Visual Studio 2022 Preview XAML editor and has not been tested in other environments.

### Other information

No additional information on the potential cause of the problem is available at this time. No relevant changes or related issues have been identified.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.