Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

IntelliSense does work with x:Static markup extension #2497

@mauler2025

Description

@mauler2025

Versions

  • Visual Studio Community version: 16.5.4

What happened

IntelliSense does not show Constants when typing local:. However, after typing local:Constants followed by a period, the IntelliSense shows Message field.

Steps to Reproduce

  1. Install Visual Studio Community Version 16.5.4 and open it.
  2. Create a new Xamarin.Forms project named IntellisenseNotWorking with a blank template. I set the platform to UWP only.
  3. Add a new class to the .Net Standard shared project, name it Constants as follows.
namespace IntellisenseNotWorking
{
    class Constants
    {
        public static readonly string Message = "Xamarin.Forms is fun!";
    }
}
  1. Modify the MainPage.xaml as follows.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:d="http://xamarin.com/schemas/2014/forms/design"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:local="clr-namespace:IntellisenseNotWorking"
             mc:Ignorable="d"
             x:Class="IntellisenseNotWorking.MainPage">

    <StackLayout>
        <Label Text="{x:Static }" />
    </StackLayout>

</ContentPage>
  1. Type local: right after x:Static. You will see only App shown, no Constants can be selected. However, after typing local:Constants followed by a period, the IntelliSense starts working again and provides you with Message field.

Expected behavior

After typing local:, IntelliSense should show Constants class so I can select it and proceed to type a period followed by typing Message field.

Screenshots

IntelliSense

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions