AvaloniaUI / AvaloniaVS

Visual Studio Extension for Avalonia
MIT License
412 stars 77 forks source link

AXAML designer does not work when code behind class has `internal` modifier #440

Open marinobjelopera26 opened 6 months ago

marinobjelopera26 commented 6 months ago

Describe the bug

Avalonia AXAML designer does not open when x:ClassModifier="internal" is added to the UserControl definition and also internal modifier is added to the code behind class. AXAML designer says that it's an Invalid Markup and to check the Error List, however there is nothing in the Error List. The application performs as expected during runtime.

With internal modifier: 1

Without internal modifier: 2

To Reproduce

  1. Create a new Avalonia WPF application
  2. Add new/modify existing UserControl - add x:ClassModifier="internal" in UserControl definition, i.e.:
    <UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Foo.Views.FooBar"
             x:ClassModifier="internal">
    Welcome to Avalonia!
    </UserControl>

Code behind:

using Avalonia.Controls;

namespace Foo.Views
{
    internal partial class FooBar : UserControl
    {
        public FooBar()
        {
            InitializeComponent();
        }
    }
}
  1. Avalonia AXAML designer does not open (says the markup is invalid)

AvaloniaVS plugin version

11.5

Avalonia version

11.0.6

Visual Studio version

17.8.4

Relevant log output

Not applicable

Additional context

No response

workgroupengineering commented 5 months ago

I tested with Avalonia 11.0.7 and it works as expected.