添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

  • Open a WPF project in Visual Studio 2022 Preview.
  • Navigate to a XAML file and start typing a binding.
  • Observe that Intellisense does not suggest abstract classes when specifying the type for RelativeSource.
  • Manually enter the name of an abstract class and run the application to verify that the binding works correctly at runtime.
  • <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=james:JamesContent}, Path=DataContext}"/>
    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

  • .NET Version: .NET 7.0
  • OS and version: Windows 11
  • Architecture: AnyCPU
  • 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.

    needs more information Not enough information has been provided. Please share more detail as requested label Nov 6, 2023

    Thank you for your response, @singhashish-wpf ! I have observed the same issue in the following environments:

    Visual Studio 2022 Preview with .NET 7.0
    Visual Studio 2022 Preview with .NET Framework 4.8.1

    Here are the relevant screenshots for reference: