Create a Visual Studio 2022 extension for WPF XAML which shows completions for some specific scenarios.


1. Attached Behaviours. If a class implements a specific signature, it becomes available to intellisense as an attached behaviour. However, if a base class implements the signature and a child class extends that base class, the child class does not show in intellisense. If the user manually types out the class name and property, it will compile and run.

An example of an attached behaviour class that will appear:

```
namespace Playground1
{
    public class MyStandaloneBehaviour
    {
        public static readonly DependencyProperty MyBoolProperty =
            DependencyProperty.RegisterAttached("MyBool", typeof(bool?), typeof(MyStandaloneBehaviour), new PropertyMetadata(null));

        public static bool? GetMyBool(DependencyObject obj)
        {
            return obj.GetValue(MyBoolProperty) as bool?;
        }

        public static void SetMyBool(DependencyObject d, bool val)
        {
            d.SetValue(MyBoolProperty, val);
        }
    }
}

```

Sample XAML:

```
<UserControl x:Class="Playground1.MyView"
             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:local="clr-namespace:Playground1"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance Type={x:Type local:MyViewModel}}">
    <Grid local:MyStandaloneBehaviour.MyBool="True">
            
    </Grid>
</UserControl>

```

And an example of a child class that won't appear:

First, the base class:
```
namespace Playground1
{
    public class MyBaseBehaviour<T,U>
    {
        public static readonly DependencyProperty MyDataProperty =
            DependencyProperty.RegisterAttached("MyData", typeof(T?), typeof(MyBaseBehaviour<T,U>), new PropertyMetadata(default(T?)));

        public static T? GetMyData(DependencyObject obj)
        {
            return (T?)obj.GetValue(MyDataProperty);
        }

        public static void SetMyData(DependencyObject d, T? val)
        {
            d.SetValue(MyDataProperty, val);
        }
    }
}
```

Now, the child:

```
namespace Playground1
{
    public class MyChildBehaviour : MyBaseBehaviour<int, MyChildBehaviour>
    {
    }
}

```

There won't be a completion for MyChildBehaviour, but the user can type it all out manually like so and it'll work:

Sample XAML:
```
<UserControl x:Class="Playground1.MyView"
             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:local="clr-namespace:Playground1"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance Type={x:Type local:MyViewModel}}">
    <Grid local:MyChildBehaviour.MyData="5">
            
    </Grid>
</UserControl>

```

So the extension needs to make completions work for child behaviours.


2. Styles, Triggers and Setters. Unfortunately, these don't have intellisense DataContext understanding. Manually typing out the Binding works and will compile and run.

Sample ViewModel:
```
namespace Playground1
{
    public class MyViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler? PropertyChanged;

        private double? _myNumber;
        public double? MyNumber
        {
            get => _myNumber;
            set
            {
                _myNumber = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(MyNumber));
            }
        }
    }
}

```

Sample XAML:

```
<UserControl x:Class="Playground1.MyView"
             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:local="clr-namespace:Playground1"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance Type={x:Type local:MyViewModel}}">
    <UserControl.Resources>
        <Style TargetType="{x:Type Grid}">
            <Setter Property="Tag" Value="{Binding MyNumber}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding MyNumber}" Value="0">
                    <Setter Property="Tag" Value="DataTriggerMatch!"/>
                </DataTrigger>
                <Trigger Property="Tag" Value="DataTriggerMatch!">
                    <Setter Property="MaxWidth" Value="{Binding MyNumber}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    <Grid>
        
    </Grid>
</UserControl>
```

"MyNumber" does not show up in any of the bindings shown in the xaml sample for styles, setters and triggers. This extension will need to show property completions based on the data context ```(d:DataContext="{d:DesignInstance Type={x:Type local:MyViewModel}}">)``` for this scenario --- all other scenarios seem to have correct completions based on data context

3. Related to 2, there is a general lack of Binding support. There is no intellisense support if referencing a static resource in a source binding when dealing with the same things mentioned in 2 (styles, triggers, setters). 

In the sample XAML, the user had to manually type "MyMarginStringResource" for the setter binding, but got intellisense completions for the Grid. The extension will need to deal with this as well.

Sample XAML
```
<UserControl x:Class="Playground1.MyView"
             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:local="clr-namespace:Playground1"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance Type={x:Type local:MyViewModel}}">
    <UserControl.Resources>
        <sys:String x:Key="MyMarginStringResource">10,10,10,10</sys:String>
        
        <Style TargetType="{x:Type Grid}">
            <Setter Property="Margin" Value="{Binding Source={StaticResource MyMarginStringResource}}"/>
        </Style>
    </UserControl.Resources>
    <Grid Margin="{Binding Source={StaticResource MyMarginStringResource}}">
        
    </Grid>
</UserControl>

```

4. We need to ensure we don't provide duplicate completions; if the default intellisense system does have a completion with a name that we would provide, then we should not provide anything.



--

Please provide a complete and full answer. Provide all steps to setup the development environment, then provide all the code with everything filled and functional without requiring my intervention to finish the job, and then provide testing and publishing steps. Make sure to only provide the final code in full, I don't want fragmented bits throughout. Explain the rationale of your code. Maximum verbosity.

Thanks.