Gu.Wpf.Adorners icon indicating copy to clipboard operation
Gu.Wpf.Adorners copied to clipboard

IntelliSense XAML error: Watermark attachable properties not being found

Open geovanibruno opened this issue 3 years ago • 1 comments

Hello,

I'm currently using v2.1.1 installed via NuGet using Visual Studio Community 2019 (v16.9.3) in a WPF C# MVVM project (.NET Framework 4.7.2).

Project compiles as expected, but IntelliSense complains all the time about attachable properties not being found ("Text" and "VisibleWhen").

XAML code:

<UserControl x:Class="ardacam.Views.EditorSQL"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:adorners="http://gu.se/Adorners"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <GroupBox x:Name="GrupoBDs" Header="Bancos de Dados" HorizontalAlignment="Left" Height="55" Margin="0,10,0,0" VerticalAlignment="Top" Width="143">
            <ComboBox x:Name="comboBDs" HorizontalAlignment="Left" Height="23" Margin="7,7,0,0" VerticalAlignment="Top" Width="120" adorners:Watermark.Text="Selecione" adorners:Watermark.VisibleWhen="Empty">
            </ComboBox>
        </GroupBox>
        <GroupBox x:Name="GrupoQuery" Header="Consulta SQL" HorizontalAlignment="Left" Height="181" Margin="0,70,0,0" VerticalAlignment="Top" Width="790">
            <TextBox x:Name="InstrucaoSQL" HorizontalAlignment="Left" Margin="0,0,-2,7" TextWrapping="Wrap" AcceptsReturn="True" Text="" Width="780" Height="141" VerticalAlignment="Bottom"
                     adorners:Watermark.Text="It was a dark and stormy night. Watch your words..." adorners:Watermark.VisibleWhen="Empty" FontFamily="Courier New"/>
        </GroupBox>
        <GroupBox x:Name="GrupoConexaoManual" Header="Conexão Manual" HorizontalAlignment="Left" Height="55" Margin="148,10,0,0" VerticalAlignment="Top" Width="642">
            <Grid HorizontalAlignment="Left" Height="29" Margin="0,5,-2,-2" VerticalAlignment="Top" Width="632">
                <ComboBox x:Name="comboDriver" HorizontalAlignment="Left" Height="23" Margin="0,2,0,0" VerticalAlignment="Top" Width="62" 
                          adorners:Watermark.Text="Driver" adorners:Watermark.VisibleWhen="Empty">
                    <ComboBoxItem Content="Oracle" HorizontalAlignment="Left" Width="123"/>
                    <ComboBoxItem Content="SQL Server" HorizontalAlignment="Left" Width="123"/>
                    <ComboBoxItem Content="PostgreSQL" HorizontalAlignment="Left" Width="123"/>
                    <ComboBoxItem Content="MySQL" HorizontalAlignment="Left" Width="123"/>
                    <ComboBoxItem Content="Firebird" HorizontalAlignment="Left" Width="123"/>
                    <ComboBoxItem Content="InterSystems Caché" HorizontalAlignment="Left" Width="123"/>
                </ComboBox>
                <TextBox x:Name="Host" HorizontalAlignment="Left" Height="24" Margin="65,1,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="101" 
                         adorners:Watermark.Text="Host" adorners:Watermark.VisibleWhen="Empty"/>
                <TextBox x:Name="Porta" HorizontalAlignment="Left" Height="24" Margin="169,1,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="42" MaxLength="5"
                         adorners:Watermark.Text="Porta" adorners:Watermark.VisibleWhen="Empty" PreviewTextInput="ValidacaoInteiroTextBox" DataObject.Pasting="PastingHandler"/>
                <TextBox x:Name="Instancia" HorizontalAlignment="Left" Height="24" Margin="214,1,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="94" 
                         adorners:Watermark.Text="Instância" adorners:Watermark.VisibleWhen="Empty"/>
                <TextBox x:Name="Usuario" HorizontalAlignment="Left" Height="24" Margin="311,1,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="80" 
                         adorners:Watermark.Text="Usuário" adorners:Watermark.VisibleWhen="Empty"/>
                <PasswordBox x:Name="Senha" HorizontalAlignment="Left" Height="24" Margin="396,1,0,0" VerticalAlignment="Top" Width="80" 
                    adorners:Watermark.Text="Senha" adorners:Watermark.VisibleWhen="Empty"/>
            </Grid>

        </GroupBox>
        <GroupBox x:Name="GrupoResult" Header="Resultset" HorizontalAlignment="Left" Height="184" Margin="0,256,0,0" VerticalAlignment="Top" Width="790"/>
    </Grid>
</UserControl>

Error Code: XLS0415, 16 error occurrences in the aforementioned XAML code.

What I've tried to do to no avail:

  • Restart Visual Studio.
  • Delete .vs folder
  • Downgrade to v2.0.0
  • Upgrade again to v2.1.1

Is there anything else that can be done?

Thanks.

geovanibruno avatar Apr 13 '21 00:04 geovanibruno

This sounds like Visual Studio bugs, does it work when you run the project?

JohanLarsson avatar May 04 '21 08:05 JohanLarsson