dotnet / dotnet/wpf

The x:Key has no intellisense in XAML.

Open
#2,564 5 comments 1 reaction 0 assignees View on GitHub
issue-type-tracking-external
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: 3.1.1
* Windows version: 1909
* Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions [here](https://docs.microsoft.com/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2019).
* Security issues and bugs should be reported privately, learn more via our [responsible disclosure guidelines](https://github.com/dotnet/wpf/blob/master/README.md#reporting-security-issues-and-security-bugs).



**Problem description:**
I have a resource key defined as below:
```csharp
namespace Wpf1
{
public abstract class ResourceExtension : TypeExtension
{
public ResourceExtension()
{
this.Type = this.GetType();
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return this.Type;
}
}
public class NormalBackground : ResourceExtension
{
}
}
```

And I use it in XAML as below:
```xaml






```

**Actual behavior:**
When I type the **x:Key="{local:NormalBackground}"**, it has no intellisense, however when I type the **Background="{StaticResource {local:NormalBackground}}"**, the intellisense works fine.

**Expected behavior:**
The x:Key also has intellisense.

**Minimal repro:**
[Wpf1.zip](https://github.com/dotnet/wpf/files/4196339/Wpf1.zip)

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.