microsoft / xaml-designer-extensibility

Extensibility sample code for the Visual Studio XAML Designer
MIT License
67 stars 29 forks source link

[VS2019 Preview3.0 16.2.0][WPF Designer]Drag dll to toolbox, no useable Control #1

Closed TempeBrennan closed 5 years ago

TempeBrennan commented 5 years ago

Issue Title

Donwload Microsoft WPF custom control sample found an issue.

General

VS: VS2019 Preview3.0 16.2.0

download project from : Microsoft sample site

I found a custom control in project CustomControlLibrary.WpfCore CustomButton.cs file.

    public class CustomButton : Button
    {
        public CustomButton()
        {
            // The GetIsInDesignMode check and the following design-time 
            // code are optional and shown only for demonstration.
            if (DesignerProperties.GetIsInDesignMode(this))
            {
                Content = "Design mode active";
            }
        }
    }

build, drag output CustomControlLibrary.WpfCore.dll to a toolbox tab. then found a control CustomButton appear. It's ok.

Then I add some code to this sample:

    public class CustomButton : Button
    {
        public CustomButton()
        {
            // The GetIsInDesignMode check and the following design-time 
            // code are optional and shown only for demonstration.
            if (DesignerProperties.GetIsInDesignMode(this))
            {
                Content = "Design mode active";
            }
        }
    }

    // ADD this code
    public class CustomButtonHelper
    {

    }

Rebuild drag output CustomControlLibrary.WpfCore.dll to a toolbox tab. current tab onlys shows there is no usable control.

If you delete added code then rebuild. This issue disappear. I think maybe I miss some settings in Microsoft sample.

Is there anybody meet the same question? Please give me some suggetions. Thanks a lot!

hemantbajpai4 commented 5 years ago

This is a VS issue, not related to extensibility sample code.

benZhai01 commented 5 years ago

@hemantbajpai4 so where can I follow the VS issue? someone else has reported it?

hemantbajpai4 commented 5 years ago

Something similar is reported here: https://developercommunity.visualstudio.com/content/problem/591937/wpf-designer-extension-still-not-available-for-net.html